diff options
| author | Selene ToyKeeper | 2023-05-30 06:59:57 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-05-30 06:59:57 -0600 |
| commit | ff41bca13f218ffb14ad71c3efe258039488a937 (patch) | |
| tree | d3c551c48e46831429676247a2ebf1d9f2ad60d9 /spaghetti-monster | |
| parent | Wurkkos models: add red+blue police strobe (diff) | |
| download | anduril-ff41bca13f218ffb14ad71c3efe258039488a937.tar.gz anduril-ff41bca13f218ffb14ad71c3efe258039488a937.tar.bz2 anduril-ff41bca13f218ffb14ad71c3efe258039488a937.zip | |
changed version check from YYYYMMDDXXXX to XXXX.YYYY-MM-DD,
where the punctuation makes a "buzz" instead of number blinks
Diffstat (limited to 'spaghetti-monster')
| -rwxr-xr-x | spaghetti-monster/anduril/build-all.sh | 2 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/version-check-mode.c | 15 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/version-check-mode.h | 2 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/version.h | 2 |
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" |
