From cbc0e1ffcf4ad79d08ab199e2529941fa8c510d1 Mon Sep 17 00:00:00 2001 From: Huang bo Date: Wed, 17 Nov 2021 18:31:58 +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 | 30 +----- bsp/ti-tms320c6678/driver/drv_timer.c | 40 +++++--- libcpu/ti-dsp/c6x/c66xx.h | 18 ---- libcpu/ti-dsp/c6x/context.asm | 2 +- libcpu/ti-dsp/c6x/interrupt.c | 7 +- libcpu/ti-dsp/c6x/intexc.asm | 2 +- libcpu/ti-dsp/c6x/stack.asm | 122 ++++++++++++------------ libcpu/ti-dsp/c6x/trap.c | 1 + libcpu/ti-dsp/c6x/trap.h | 2 +- libcpu/ti-dsp/c6x/vector.asm | 2 +- 10 files changed, 102 insertions(+), 124 deletions(-) diff --git a/bsp/ti-tms320c6678/applications/board.c b/bsp/ti-tms320c6678/applications/board.c index a0f951d31e..0a96a82ff8 100644 --- a/bsp/ti-tms320c6678/applications/board.c +++ b/bsp/ti-tms320c6678/applications/board.c @@ -9,28 +9,12 @@ */ #include "board.h" -#include "trap.h" #include "interrupt.h" #include "drv_timer.h" #include "KeyStone_common.h" #include -/** - * This is the timer interrupt service routine. - * - */ -void rt_hw_systick_isr(void) -{ - /* enter interrupt */ - rt_interrupt_enter(); - - rt_tick_increase(); - - /* leave interrupt */ - rt_interrupt_leave(); -} - /** * This function will initial board. */ @@ -42,16 +26,12 @@ void rt_hw_board_init(void) // initial interrupt controller rt_hw_interrupt_init(); - // initial system trap - rt_trap_init(); - // initial system timer - hw_system_timer_init(); + hw_system_timer_init(); - /* initialize memory system */ - rt_kprintf("heap: 0x%08x - 0x%08x\n", RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); - rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); + /* initialize memory system */ + rt_kprintf("heap: 0x%08x - 0x%08x\n", RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); + rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); - hw_system_timer_start(); + hw_system_timer_start(); } - diff --git a/bsp/ti-tms320c6678/driver/drv_timer.c b/bsp/ti-tms320c6678/driver/drv_timer.c index 4cda450e49..163d802aca 100644 --- a/bsp/ti-tms320c6678/driver/drv_timer.c +++ b/bsp/ti-tms320c6678/driver/drv_timer.c @@ -15,41 +15,51 @@ #include /** - * @b Description - * @n - * The function initial system timer. - * Use local timer (==DNUM of a core) to generate a clock on TIMO0,interrupts are generated as well + * This is the timer interrupt service routine. * - * @param[] - * - * @retval - * NULL + */ +void rt_hw_systick_isr(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + rt_tick_increase(); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +/** + * The function initial system timer interrupt. */ void 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<TOUTSEL = (DNUM*2)<