summaryrefslogtreecommitdiff
path: root/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal.c
blob: 0a2d5d9b7cb76cd71d144548cc89ac213d4b2b9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "ab32vg1_hal.h"

static uint32_t hw_ticks = 0;

static void (*tick_cfg_hook)(uint32_t ticks) = HAL_NULL;

void hal_set_tick_hook(void (*hook)(uint32_t ticks))
{
    tick_cfg_hook = hook;
}

void hal_set_ticks(uint32_t ticks)
{
    if (ticks != hw_ticks) {
        hw_ticks = ticks;
    }
    if (tick_cfg_hook != HAL_NULL) {
        tick_cfg_hook(hw_ticks);
    }
}

WEAK void hal_mdelay(uint32_t nms)
{

}

void hal_udelay(uint16_t nus)
{
   int i;
   for (i = 0; i < nus*10; i++) {
        asm("nop");
   }
}

WEAK void hal_printf(const char *fmt, ...)
{}