aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/anduril/version-check-mode.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/anduril/version-check-mode.c42
1 files changed, 13 insertions, 29 deletions
diff --git a/spaghetti-monster/anduril/version-check-mode.c b/spaghetti-monster/anduril/version-check-mode.c
index edb1723..a47706f 100644
--- a/spaghetti-monster/anduril/version-check-mode.c
+++ b/spaghetti-monster/anduril/version-check-mode.c
@@ -1,24 +1,8 @@
-/*
- * version-check-mode.c: Version check mode for Anduril.
- *
- * Copyright (C) 2017 Selene ToyKeeper
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
+// version-check-mode.c: Version check mode for Anduril.
+// Copyright (C) 2017-2023 Selene ToyKeeper
+// SPDX-License-Identifier: GPL-3.0-or-later
-#ifndef VERSION_CHECK_MODE_C
-#define VERSION_CHECK_MODE_C
+#pragma once
#include "version-check-mode.h"
@@ -30,18 +14,18 @@ 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);
}
-
-#endif
-