aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-09-28 15:29:10 -0600
committerSelene ToyKeeper2017-09-28 15:29:10 -0600
commit6d729119a06180e6ee9d53056013273ae0bdbe03 (patch)
tree800d88f4b73d2072c52dda2ffabd5e8bee17e930
parentEr, set the clock speed *before* going idle, not after. :) (diff)
downloadanduril-6d729119a06180e6ee9d53056013273ae0bdbe03.tar.gz
anduril-6d729119a06180e6ee9d53056013273ae0bdbe03.tar.bz2
anduril-6d729119a06180e6ee9d53056013273ae0bdbe03.zip
Adjusted bike flasher floor and ceiling:
- floor high enough to make sure it always blinks - ceiling can be higher than halfway up the ramp
-rw-r--r--spaghetti-monster/anduril/anduril.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 9751296..5a6b6e0 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -27,6 +27,7 @@
#define USE_RAMPING
#define USE_SET_LEVEL_GRADUALLY
#define RAMP_LENGTH 150
+#define MAX_BIKING_LEVEL 120 // should be 127 or less
#define BLINK_AT_RAMP_BOUNDARIES
//#define BLINK_AT_RAMP_FLOOR
#define USE_BATTCHECK
@@ -414,7 +415,7 @@ uint8_t strobe_state(EventPtr event, uint16_t arg) {
}
// biking mode brighter
else if (strobe_type == 3) {
- if (bike_flasher_brightness < MAX_LEVEL/2)
+ if (bike_flasher_brightness < MAX_BIKING_LEVEL)
bike_flasher_brightness ++;
set_level(bike_flasher_brightness);
}
@@ -430,7 +431,7 @@ uint8_t strobe_state(EventPtr event, uint16_t arg) {
}
// biking mode dimmer
else if (strobe_type == 3) {
- if (bike_flasher_brightness > 1)
+ if (bike_flasher_brightness > 2)
bike_flasher_brightness --;
set_level(bike_flasher_brightness);
}
@@ -958,7 +959,6 @@ void loop() {
#ifdef USE_DYNAMIC_UNDERCLOCKING
auto_clock_speed();
#endif
-
if (0) {}
#ifdef USE_IDLE_MODE
@@ -1034,6 +1034,7 @@ void loop() {
// bike flasher
else if (strobe_type == 3) {
uint8_t burst = bike_flasher_brightness << 1;
+ if (burst > MAX_LEVEL) burst = MAX_LEVEL;
for(uint8_t i=0; i<4; i++) {
set_level(burst);
if (! nice_delay_ms(5)) return;