aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/rampingios
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-08-11 15:16:23 -0600
committerSelene ToyKeeper2019-08-11 15:16:23 -0600
commit89a86871aa6330218043586f0347c0c1e7c79dab (patch)
treee3a4cc2a4517e5563e91cdaaf86718170d4f0a37 /spaghetti-monster/rampingios
parentAdded setup info for Fedora. (diff)
parentadded scripts to flash attiny1634, which were missing before (diff)
downloadanduril-89a86871aa6330218043586f0347c0c1e7c79dab.tar.gz
anduril-89a86871aa6330218043586f0347c0c1e7c79dab.tar.bz2
anduril-89a86871aa6330218043586f0347c0c1e7c79dab.zip
merged fsm to trunk... lots of updates:
+ attiny1634 support + Emisar D4v2 support + Mateminco MF01S / MT18 support + Fireflies E01 and E07v2 support + RGB aux LED support + added factory reset function + added manual / automatic memory toggle + added 2-level brightness during lockout + added Fireflies UI + made momentary mode also support strobe-group modes * thermal regulation rewritten, behaves mostly better now * strobe modes auto-reverse their ramp now * muggle mode fixes * UI diagram and manual updated * button timing adjusted, and compile-time options added for it * general refactoring
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/rampingios/rampingiosv3.c43
1 files changed, 12 insertions, 31 deletions
diff --git a/spaghetti-monster/rampingios/rampingiosv3.c b/spaghetti-monster/rampingios/rampingiosv3.c
index e4eb2fa..d72e971 100644
--- a/spaghetti-monster/rampingios/rampingiosv3.c
+++ b/spaghetti-monster/rampingios/rampingiosv3.c
@@ -148,9 +148,6 @@ void blink_confirm(uint8_t num);
#if defined(USE_INDICATOR_LED) && defined(TICK_DURING_STANDBY)
void indicator_blink(uint8_t arg);
#endif
-#ifdef USE_INDICATOR_LED
-uint8_t auxled_next_state(Event event, uint16_t arg);
-#endif
// remember stuff even after battery was changed
void load_config();
@@ -347,7 +344,18 @@ uint8_t off_state(Event event, uint16_t arg) {
// 7 clicks: next aux LED mode
else if (event == EV_7clicks) {
blink_confirm(1);
- set_state(auxled_next_state, 0);
+ uint8_t mode = (indicator_led_mode & 3) + 1;
+ #ifdef TICK_DURING_STANDBY
+ mode = mode & 3;
+ #else
+ mode = mode % 3;
+ #endif
+ #ifdef INDICATOR_LED_SKIP_LOW
+ if (mode == 1) { mode ++; }
+ #endif
+ indicator_led_mode = (indicator_led_mode & 0b11111100) | mode;
+ indicator_led(mode);
+ save_config();
return MISCHIEF_MANAGED;
}
#endif
@@ -811,33 +819,6 @@ uint8_t lockout_state(Event event, uint16_t arg) {
}
-#ifdef USE_INDICATOR_LED
-uint8_t auxled_next_state(Event event, uint16_t arg) {
- if (event == EV_enter_state) {
- uint8_t mode = indicator_led_mode & 3;
- #ifdef TICK_DURING_STANDBY
- mode = (mode + 1) & 3;
- #else
- mode = (mode + 1) % 3;
- #endif
- #ifdef INDICATOR_LED_SKIP_LOW
- if (mode == 1) { mode ++; }
- #endif
- indicator_led_mode = mode + (indicator_led_mode & 0b00001100);
- indicator_led(mode);
- save_config();
- return MISCHIEF_MANAGED;
- }
- else if (event == EV_tick) {
- set_state(off_state, 0);
- return MISCHIEF_MANAGED;
- }
-
- return EVENT_NOT_HANDLED;
-}
-#endif
-
-
uint8_t momentary_state(Event event, uint16_t arg) {
// TODO: momentary strobe here? (for light painting)
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.