1 #include "ab32vg1_hal.h" 2 3 static uint32_t hw_ticks = 0; 4 5 static void (*tick_cfg_hook)(uint32_t ticks) = HAL_NULL; 6 hal_set_tick_hook(void (* hook)(uint32_t ticks))7void hal_set_tick_hook(void (*hook)(uint32_t ticks)) 8 { 9 tick_cfg_hook = hook; 10 } 11 hal_set_ticks(uint32_t ticks)12void hal_set_ticks(uint32_t ticks) 13 { 14 if (ticks != hw_ticks) 15 { 16 hw_ticks = ticks; 17 } 18 if (tick_cfg_hook != HAL_NULL) 19 { 20 tick_cfg_hook(hw_ticks); 21 } 22 } 23 hal_mdelay(uint32_t nms)24WEAK void hal_mdelay(uint32_t nms) 25 { 26 } 27 hal_udelay(uint32_t nus)28WEAK void hal_udelay(uint32_t nus) 29 { 30 } 31 hal_printf(const char * fmt,...)32WEAK void hal_printf(const char *fmt, ...) 33 { 34 } 35