aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-05-30 06:59:57 -0600
committerSelene ToyKeeper2023-05-30 06:59:57 -0600
commitff41bca13f218ffb14ad71c3efe258039488a937 (patch)
treed3c551c48e46831429676247a2ebf1d9f2ad60d9
parentWurkkos models: add red+blue police strobe (diff)
downloadanduril-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
-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"
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.