From 2b13e2fa57a8cc2f536b8279eb0c952c6e3b49d7 Mon Sep 17 00:00:00 2001 From: Huang bo Date: Thu, 18 Nov 2021 09:23:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/ti-tms320c6678/applications/board.c | 10 +-- bsp/ti-tms320c6678/applications/main.c | 52 +++++++-------- bsp/ti-tms320c6678/driver/drv_timer.c | 12 ++-- libcpu/ti-dsp/c6x/c66xx.h | 88 ++++++++++++------------- libcpu/ti-dsp/c6x/context.asm | 80 +++++++++++----------- libcpu/ti-dsp/c6x/contextinc.asm | 44 ++++++------- libcpu/ti-dsp/c6x/cpuport.c | 1 - libcpu/ti-dsp/c6x/interrupt.c | 4 +- libcpu/ti-dsp/c6x/intexc.asm | 16 ++--- libcpu/ti-dsp/c6x/stack.asm | 88 ++++++++++++------------- libcpu/ti-dsp/c6x/trap.c | 12 ++-- libcpu/ti-dsp/c6x/trap.h | 28 ++++---- 12 files changed, 216 insertions(+), 219 deletions(-) diff --git a/bsp/ti-tms320c6678/applications/board.c b/bsp/ti-tms320c6678/applications/board.c index b6a4105599..51a21f6cd8 100644 --- a/bsp/ti-tms320c6678/applications/board.c +++ b/bsp/ti-tms320c6678/applications/board.c @@ -20,13 +20,13 @@ */ void rt_hw_board_init(void) { - // initial CPU core - KeyStone_common_CPU_init(); + // initial CPU core + KeyStone_common_CPU_init(); - // initial interrupt controller - rt_hw_interrupt_init(); + // initial interrupt controller + rt_hw_interrupt_init(); - // initial system timer + // initial system timer rt_hw_system_timer_init(); /* initialize memory system */ diff --git a/bsp/ti-tms320c6678/applications/main.c b/bsp/ti-tms320c6678/applications/main.c index a8b9e17efc..f72b93b9dc 100644 --- a/bsp/ti-tms320c6678/applications/main.c +++ b/bsp/ti-tms320c6678/applications/main.c @@ -15,8 +15,8 @@ void rt_init_thread_entry(void *parameter) { - rt_kprintf("hello rt-thread\n"); - return 0; + rt_kprintf("hello rt-thread\n"); + return 0; } int rt_application_init(void) @@ -39,42 +39,42 @@ int rt_application_init(void) */ void rtthread_startup(void) { - /* disable interrupt first */ - rt_hw_interrupt_disable(); + /* disable interrupt first */ + rt_hw_interrupt_disable(); + + /* init board */ + rt_hw_board_init(); - /* init board */ - rt_hw_board_init(); + /* show version */ + rt_show_version(); - /* show version */ - rt_show_version(); + /* init timer system */ + rt_system_timer_init(); - /* init timer system */ - rt_system_timer_init(); + /* init scheduler system */ + rt_system_scheduler_init(); - /* init scheduler system */ - rt_system_scheduler_init(); + /* init application */ + rt_application_init(); - /* init application */ - rt_application_init(); + /* init timer thread */ + rt_system_timer_thread_init(); - /* init timer thread */ - rt_system_timer_thread_init(); + /* init idle thread */ + rt_thread_idle_init(); - /* init idle thread */ - rt_thread_idle_init(); + /* start scheduler */ + rt_system_scheduler_start(); - /* start scheduler */ - rt_system_scheduler_start(); - - /* never reach here */ - return ; + /* never reach here */ + return ; } void main(void) { - /* startup RT-Thread RTOS */ - rtthread_startup(); + /* startup RT-Thread RTOS */ + rtthread_startup(); - for ( ; ; ); + for ( ; ; ); } diff --git a/bsp/ti-tms320c6678/driver/drv_timer.c b/bsp/ti-tms320c6678/driver/drv_timer.c index 330e04dcde..b2a9319875 100644 --- a/bsp/ti-tms320c6678/driver/drv_timer.c +++ b/bsp/ti-tms320c6678/driver/drv_timer.c @@ -20,13 +20,13 @@ */ void rt_hw_systick_isr(void) { - /* enter interrupt */ - rt_interrupt_enter(); + /* enter interrupt */ + rt_interrupt_enter(); - rt_tick_increase(); + rt_tick_increase(); - /* leave interrupt */ - rt_interrupt_leave(); + /* leave interrupt */ + rt_interrupt_leave(); } /** @@ -34,7 +34,7 @@ void rt_hw_systick_isr(void) */ void rt_hw_system_timer_init(void) { - // initial system timer interrupt, map local timer interrupt to INT14 + // initial system timer interrupt, map local timer interrupt to INT14 gpCGEM_regs->INTMUX3 = (CSL_GEM_TINTLN<