diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-06-09 20:26:30 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-06-09 20:27:57 -0400 |
commit | 700e35c6ac74a64719fbc38fe66386dd422613f3 (patch) | |
tree | 2a829c04c12f3b6393d842f1835c2f8f8df023dc /src/lpc176x/main.c | |
parent | 97840f9851772ffbcc99b8e33c82b0af4770baa8 (diff) | |
download | kutter-700e35c6ac74a64719fbc38fe66386dd422613f3.tar.gz kutter-700e35c6ac74a64719fbc38fe66386dd422613f3.tar.xz kutter-700e35c6ac74a64719fbc38fe66386dd422613f3.zip |
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>
Diffstat (limited to 'src/lpc176x/main.c')
-rw-r--r-- | src/lpc176x/main.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/lpc176x/main.c b/src/lpc176x/main.c index c417a2c7..d522a014 100644 --- a/src/lpc176x/main.c +++ b/src/lpc176x/main.c @@ -67,20 +67,6 @@ command_reset(uint32_t *args) } DECL_COMMAND_FLAGS(command_reset, HF_IN_SHUTDOWN, "reset"); -// Implement simple early-boot delay mechanism -void -udelay(uint32_t usecs) -{ - if (!(CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk)) { - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - } - - uint32_t end = timer_read_time() + timer_from_us(usecs); - while (timer_is_before(timer_read_time(), end)) - ; -} - // Main entry point int main(void) |