diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-07-12 10:57:02 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-07-12 10:57:02 +0200 |
commit | 68eb5f7bf403f4a8cfc42b54b6a7fea087d34960 (patch) | |
tree | 2f8063bb7461a263610f45da3bf2c7008bae92e0 /src | |
parent | 136d16ad4248d9cbd5aae871ffb76632ca8dfdc9 (diff) |
Add delay_us on AVR arch
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/arduino-nano/arch.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/arch/arduino-nano/arch.cc b/src/arch/arduino-nano/arch.cc index f35cb1d..16d09fb 100644 --- a/src/arch/arduino-nano/arch.cc +++ b/src/arch/arduino-nano/arch.cc @@ -1,6 +1,7 @@ #include "arch.h" #include <avr/io.h> #include <avr/interrupt.h> +#include <util/delay.h> void Arch::setup(void) { @@ -54,6 +55,11 @@ void Arch::idle_loop(void) } } +void Arch::delay_us(unsigned char const us) +{ + __builtin_avr_delay_cycles(1600); +} + Arch arch; #if defined(WITH_LOOP) || defined(TIMER_S) |