From b2f7f066dbeed346e6d70414593cad2d918c2bd4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 12 Jul 2018 15:24:36 +0200 Subject: Add arch.idle() command --- src/arch/arduino-nano/arch.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/arch/arduino-nano') diff --git a/src/arch/arduino-nano/arch.cc b/src/arch/arduino-nano/arch.cc index 16d09fb..fda518c 100644 --- a/src/arch/arduino-nano/arch.cc +++ b/src/arch/arduino-nano/arch.cc @@ -55,6 +55,14 @@ void Arch::idle_loop(void) } } +void Arch::idle(void) +{ + SMCR = _BV(SE); + asm("sleep"); + SMCR = 0; + asm("wdr"); +} + void Arch::delay_us(unsigned char const us) { __builtin_avr_delay_cycles(1600); -- cgit v1.2.3