summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorHuang bo <[email protected]>2021-11-17 18:31:58 +0800
committerHuang bo <[email protected]>2021-11-17 18:31:58 +0800
commitcbc0e1ffcf4ad79d08ab199e2529941fa8c510d1 (patch)
tree103e0a757dbeec8d686d25ce0383a0a1a2c607aa /bsp
parent456492e7eab69c7e9bb3feb2129dc5a905491efc (diff)
修改格式
Diffstat (limited to 'bsp')
-rw-r--r--bsp/ti-tms320c6678/applications/board.c30
-rw-r--r--bsp/ti-tms320c6678/driver/drv_timer.c40
2 files changed, 30 insertions, 40 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,7 +9,6 @@
*/
#include "board.h"
-#include "trap.h"
#include "interrupt.h"
#include "drv_timer.h"
#include "KeyStone_common.h"
@@ -17,21 +16,6 @@
#include <rtthread.h>
/**
- * 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.
*/
void rt_hw_board_init(void)
@@ -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 <rtthread.h>
/**
- * @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<<CSL_CGEM_INTMUX3_INTSEL14_SHIFT);
- // enable INT14
+ // enable CPU INT14
CPU_interrupt_enable(1<<14);
return ;
}
+/**
+ * The function initial system timer.
+ * Use local timer (==DNUM of a core) to generate a clock on TIMO0,interrupts are generated as well
+ *
+ */
void hw_system_timer_start(void)
{
Timer64_Config tmrCfg;
- //select output on TIMO0 from local timer.
+ // select output on TIMO0 from local timer.
gpBootCfgRegs->TOUTSEL = (DNUM*2)<<CSL_BOOTCFG_TOUTSEL_TOUTSEL0_SHIFT;
- /* configure the timer to generate clocks and interrupts */
+ // configure the timer to generate clocks and interrupts
tmrCfg.timer_num= DNUM;
tmrCfg.timerMode= TIMER_PERIODIC_CLOCK;
tmrCfg.period= (unsigned long long) RT_TICK_PER_SECOND*gDSP_Core_Speed_Hz/6000;
- tmrCfg.reload_period= 0; //not used for this case
+ tmrCfg.reload_period= 0;
// initial timer
Timer64_Init(&tmrCfg);
}
-