aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-09-24 22:50:32 -0600
committerSelene ToyKeeper2017-09-24 22:50:32 -0600
commitfd9081b1587793e279c9c071b88769d1d90a7067 (patch)
tree73491a7a97b0e2ac327179a2d8903a6ab1063649 /spaghetti-monster
parentReduced standby power by 700X by turning off brownout detection. (diff)
downloadanduril-fd9081b1587793e279c9c071b88769d1d90a7067.tar.gz
anduril-fd9081b1587793e279c9c071b88769d1d90a7067.tar.bz2
anduril-fd9081b1587793e279c9c071b88769d1d90a7067.zip
Moved halfspeed thing so it'll affect goodnight mode too.
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/anduril.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index a1c9f5b..1cc9d7c 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -230,16 +230,6 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
ramp_step_size = ramp_discrete_step_size;
}
- if (actual_level < HALFSPEED_LEVEL) {
- // run at half speed
- CLKPR = 1<<CLKPCE;
- CLKPR = 1;
- } else {
- // run at full speed
- CLKPR = 1<<CLKPCE;
- CLKPR = 0;
- }
-
// turn LED on when we first enter the mode
if (event == EV_enter_state) {
// remember this level, unless it's moon or turbo
@@ -973,6 +963,15 @@ void loop() {
#ifdef USE_IDLE_MODE
else if ((state == steady_state)
|| (state == goodnight_state)) {
+ if (actual_level < HALFSPEED_LEVEL) {
+ // run at half speed
+ CLKPR = 1<<CLKPCE;
+ CLKPR = 1;
+ } else {
+ // run at full speed
+ CLKPR = 1<<CLKPCE;
+ CLKPR = 0;
+ }
// doze until next clock tick
idle_mode();
}
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.