1 /*
2  * Copyright (c) 2017-2019, MindMotion AE Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2019-03-13     henryhuang   first version
9  */
10 
11 #include <board.h>
12 extern uint32_t SystemCoreClock;
13 extern void SystemInit(void);
bsp_clock_config(void)14 static void bsp_clock_config(void)
15 {
16     SystemInit();
17     SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
18     SysTick->CTRL |= 0x00000004UL;
19 }
SysTick_Handler(void)20 void SysTick_Handler(void)
21 {
22     /* enter interrupt */
23     rt_interrupt_enter();
24 
25     rt_tick_increase();
26 
27     /* leave interrupt */
28     rt_interrupt_leave();
29 }
30 
rt_hw_board_init()31 void rt_hw_board_init()
32 {
33     bsp_clock_config();
34 #if defined(RT_USING_HEAP)
35     rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
36 #endif
37 #ifdef RT_USING_COMPONENTS_INIT
38     rt_components_board_init();
39 #endif
40 #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
41     rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
42 #endif
43 }
44