summaryrefslogtreecommitdiff
path: root/src/arch/arduino-nano
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-07-12 15:24:36 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-07-12 15:24:36 +0200
commitb2f7f066dbeed346e6d70414593cad2d918c2bd4 (patch)
tree14d61f487fadc109e38485e74e65fb7741ffe5e8 /src/arch/arduino-nano
parent7f6b7ecfb0fb60a08dcc6c174d313eee052a94dc (diff)
Add arch.idle() command
Diffstat (limited to 'src/arch/arduino-nano')
-rw-r--r--src/arch/arduino-nano/arch.cc8
1 files changed, 8 insertions, 0 deletions
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);