483.12.14
by Selene ToyKeeper
switched the rest of FSM + Anduril to use SPDX license headers |
1 |
// version-check-mode.c: Version check mode for Anduril.
|
2 |
// Copyright (C) 2017-2023 Selene ToyKeeper
|
|
3 |
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
483.1.11
by Selene Scriven
more progress on refactoring Anduril into separate files... nearly done with the initial split |
4 |
|
483.12.14
by Selene ToyKeeper
switched the rest of FSM + Anduril to use SPDX license headers |
5 |
#pragma once
|
483.1.11
by Selene Scriven
more progress on refactoring Anduril into separate files... nearly done with the initial split |
6 |
|
7 |
#include "version-check-mode.h" |
|
8 |
||
9 |
// empty state; logic is handled in FSM loop() instead
|
|
10 |
uint8_t version_check_state(Event event, uint16_t arg) { |
|
11 |
return EVENT_NOT_HANDLED; |
|
12 |
}
|
|
13 |
||
14 |
// this happens in FSM loop()
|
|
15 |
inline void version_check_iter() { |
|
16 |
for (uint8_t i=0; i<sizeof(version_number)-1; i++) { |
|
483.12.60
by Selene ToyKeeper
changed version check from YYYYMMDDXXXX to XXXX.YYYY-MM-DD, |
17 |
uint8_t digit = pgm_read_byte(version_number + i) - '0'; |
18 |
if (digit < 10) blink_digit(digit); |
|
19 |
else { // "buzz" for non-numeric characters |
|
20 |
for(uint8_t frame=0; frame<25; frame++) { |
|
21 |
set_level((frame&1) << 5); |
|
22 |
nice_delay_ms(16); |
|
23 |
}
|
|
24 |
nice_delay_ms(BLINK_SPEED * 8 / 12); |
|
25 |
}
|
|
483.1.11
by Selene Scriven
more progress on refactoring Anduril into separate files... nearly done with the initial split |
26 |
nice_delay_ms(300); |
27 |
}
|
|
28 |
||
483.1.90
by Selene Scriven
reworked nice_delay interrupt system and fixed some old issues: |
29 |
set_state_deferred(off_state, 0); |
483.1.11
by Selene Scriven
more progress on refactoring Anduril into separate files... nearly done with the initial split |
30 |
}
|
31 |