summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arduino-nano/arch.cc8
-rw-r--r--src/arch/esp8266/arch.cc4
-rw-r--r--src/arch/msp430fr5969lp/arch.cc11
-rw-r--r--src/arch/posix/arch.cc4
4 files changed, 27 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);
diff --git a/src/arch/esp8266/arch.cc b/src/arch/esp8266/arch.cc
index f5d1c91..3490ffe 100644
--- a/src/arch/esp8266/arch.cc
+++ b/src/arch/esp8266/arch.cc
@@ -57,6 +57,10 @@ void Arch::idle_loop(void)
{
}
+void ArcH::idle(void)
+{
+}
+
extern "C" void user_init(void)
{
system_init_done_cb(jump_to_main);
diff --git a/src/arch/msp430fr5969lp/arch.cc b/src/arch/msp430fr5969lp/arch.cc
index aee46f3..3016842 100644
--- a/src/arch/msp430fr5969lp/arch.cc
+++ b/src/arch/msp430fr5969lp/arch.cc
@@ -91,6 +91,17 @@ void Arch::idle_loop(void)
}
}
+void Arch::idle(void)
+{
+ __eint();
+ asm volatile("nop");
+ __bis_SR_register(LPM2_bits);
+ asm volatile("nop");
+#ifdef WITH_WAKEUP
+ wakeup();
+#endif
+}
+
Arch arch;
#if defined(WITH_LOOP) || defined(TIMER_S)
diff --git a/src/arch/posix/arch.cc b/src/arch/posix/arch.cc
index efcf90e..54ee8e1 100644
--- a/src/arch/posix/arch.cc
+++ b/src/arch/posix/arch.cc
@@ -10,4 +10,8 @@ void Arch::idle_loop(void)
}
}
+void Arch::idle(void)
+{
+}
+
Arch arch;