Skip to content

Commit ee46417

Browse files
author
ganghe
committed
soc: sifli: sf32lb52x: Overwrite SiFli HAL delay function with Zephyr k_sleep
SiFli HAL is using HAL_Delay_us to delay for certain microseconds. This is a weak function. I overwrites this function with Zephyr k_sleep. Signed-off-by: ganghe <[email protected]>
1 parent ee21280 commit ee46417

File tree

1 file changed

+9
-0
lines changed
  • soc/sifli/sf32/sf32lb52x

1 file changed

+9
-0
lines changed

soc/sifli/sf32/sf32lb52x/soc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <zephyr/arch/cpu.h>
77
#include <zephyr/cache.h>
88
#include <zephyr/sys/util.h>
9+
#include <bf0_hal.h>
910

1011
#define BOOTROM_BKP_REG DT_REG_ADDR(DT_INST(0, sifli_sf32lb_rtc_backup))
1112
#define BOOTROM_FLASH_OFF_DELAY_MSK GENMASK(11U, 4U)
@@ -28,3 +29,11 @@ void soc_early_init_hook(void)
2829
sys_write32(val, BOOTROM_BKP_REG);
2930
#endif
3031
}
32+
33+
void HAL_Delay_us(uint32_t us)
34+
{
35+
k_sleep (K_USEC(us));
36+
}
37+
38+
39+

0 commit comments

Comments
 (0)