armcm_timer: Unify udelay() implementation

Move the udelay() code from various arm board directories into the
src/generic/armcm_timer.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-06-09 20:26:30 -04:00
parent 97840f9851
commit 700e35c6ac
10 changed files with 24 additions and 42 deletions

View File

@@ -9,7 +9,6 @@
extern uint8_t const avail_pins[];
void udelay(uint32_t usecs);
void gpio_init(void);
void TimerInit(void);

View File

@@ -84,15 +84,6 @@ void clock_config(void)
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
}
// Implement simple early-boot delay mechanism
void
udelay(uint32_t usecs)
{
uint32_t end = timer_read_time() + timer_from_us(usecs);
while (timer_is_before(timer_read_time(), end))
;
}
void
watchdog_reset(void)
{