From caecdb12209b5be67824a19591fbb3949896972e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 10 Sep 2020 12:40:31 +0200 Subject: blinkenrocket: make delay_ms, sleep_ms work with non-compile time constants --- src/arch/blinkenrocket/arch.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/arch/blinkenrocket') diff --git a/src/arch/blinkenrocket/arch.cc b/src/arch/blinkenrocket/arch.cc index d49bfda..ffe68a0 100644 --- a/src/arch/blinkenrocket/arch.cc +++ b/src/arch/blinkenrocket/arch.cc @@ -62,12 +62,16 @@ void Arch::idle(void) void Arch::delay_us(unsigned int const us) { - _delay_us(us); + for (unsigned int i = 0; i < us; i++) { + _delay_us(1); + } } void Arch::delay_ms(unsigned int const ms) { - _delay_ms(ms); + for (unsigned int i = 0; i < ms; i++) { + _delay_ms(1); + } } Arch arch; -- cgit v1.2.3