aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-main.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-09-24 22:45:59 -0600
committerSelene ToyKeeper2017-09-24 22:45:59 -0600
commit9bde4b7bd0588b1d74f9b89f89419e8f11e3f25f (patch)
treeb49863fb0b24c52fe70a3f2eb3eb1364e3d582a1 /spaghetti-monster/fsm-main.c
parentAdded idle to goodnight mode, for 2mA less power at all levels. (diff)
downloadanduril-9bde4b7bd0588b1d74f9b89f89419e8f11e3f25f.tar.gz
anduril-9bde4b7bd0588b1d74f9b89f89419e8f11e3f25f.tar.bz2
anduril-9bde4b7bd0588b1d74f9b89f89419e8f11e3f25f.zip
Cut moon power from ~4mA to ~2.5mA by running clock at half speed on very low modes.
Adjusted default FET+1 ramp to compensate for speed bump. Added define(s) for whether to blink at ramp floor/ceiling/channel edges. Lowered default moon level to 1, since slower speed makes it brighter and more stable.
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/fsm-main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-main.c b/spaghetti-monster/fsm-main.c
index bc41cd6..5efcd4c 100644
--- a/spaghetti-monster/fsm-main.c
+++ b/spaghetti-monster/fsm-main.c
@@ -40,6 +40,12 @@ int main() {
// Don't allow interrupts while booting
cli();
+ #ifdef HALFSPEED
+ // run at half speed
+ CLKPR = 1<<CLKPCE;
+ CLKPR = 1;
+ #endif
+
// configure PWM channels
#if PWM_CHANNELS >= 1
DDRB |= (1 << PWM1_PIN);