aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
Diffstat (limited to 'spaghetti-monster')
-rwxr-xr-xspaghetti-monster/anduril/build-all.sh2
-rw-r--r--spaghetti-monster/anduril/version-check-mode.c15
-rw-r--r--spaghetti-monster/anduril/version-check-mode.h2
-rw-r--r--spaghetti-monster/anduril/version.h2
4 files changed, 12 insertions, 9 deletions
diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh
index 768559c..b3fc5d3 100755
--- a/spaghetti-monster/anduril/build-all.sh
+++ b/spaghetti-monster/anduril/build-all.sh
@@ -9,7 +9,7 @@ fi
UI=anduril
-date '+#define VERSION_NUMBER "%Y%m%d"' > version.h
+date '+#define VERSION_NUMBER "%Y-%m-%d"' > version.h
PASS=0
FAIL=0
diff --git a/spaghetti-monster/anduril/version-check-mode.c b/spaghetti-monster/anduril/version-check-mode.c
index 2b7112e..a47706f 100644
--- a/spaghetti-monster/anduril/version-check-mode.c
+++ b/spaghetti-monster/anduril/version-check-mode.c
@@ -14,14 +14,17 @@ uint8_t version_check_state(Event event, uint16_t arg) {
// this happens in FSM loop()
inline void version_check_iter() {
for (uint8_t i=0; i<sizeof(version_number)-1; i++) {
- blink_digit(pgm_read_byte(version_number + i) - '0');
+ uint8_t digit = pgm_read_byte(version_number + i) - '0';
+ if (digit < 10) blink_digit(digit);
+ else { // "buzz" for non-numeric characters
+ for(uint8_t frame=0; frame<25; frame++) {
+ set_level((frame&1) << 5);
+ nice_delay_ms(16);
+ }
+ nice_delay_ms(BLINK_SPEED * 8 / 12);
+ }
nice_delay_ms(300);
}
- // FIXME: when user interrupts with button, "off" takes an extra click
- // before it'll turn back on, because the click to cancel gets sent
- // to the "off" state instead of version_check_state
- //while (button_is_pressed()) {}
- //empty_event_sequence();
set_state_deferred(off_state, 0);
}
diff --git a/spaghetti-monster/anduril/version-check-mode.h b/spaghetti-monster/anduril/version-check-mode.h
index db2086e..72bad3f 100644
--- a/spaghetti-monster/anduril/version-check-mode.h
+++ b/spaghetti-monster/anduril/version-check-mode.h
@@ -13,7 +13,7 @@
#endif
#include "version.h"
-const PROGMEM uint8_t version_number[] = VERSION_NUMBER MODEL_NUMBER;
+const PROGMEM uint8_t version_number[] = MODEL_NUMBER "." VERSION_NUMBER;
uint8_t version_check_state(Event event, uint16_t arg);
inline void version_check_iter();
diff --git a/spaghetti-monster/anduril/version.h b/spaghetti-monster/anduril/version.h
index 8cf3c90..b548e13 100644
--- a/spaghetti-monster/anduril/version.h
+++ b/spaghetti-monster/anduril/version.h
@@ -1,4 +1,4 @@
// this file is replaced automatically by the build script
// set your own date here if you're not using the build script
// otherwise, default to first human contact with the moon
-#define VERSION_NUMBER "19690720"
+#define VERSION_NUMBER "1969-07-20"