ab32vg1_hal.c 567 B

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