From 1afe3758f58c1adc76c847d134e21f69faacc64e Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 16 Mar 2020 04:23:43 -0600 Subject: removed more references to THERM_HARD_TURBO_DROP --- spaghetti-monster/anduril/cfg-emisar-d1.h | 5 ----- spaghetti-monster/anduril/cfg-emisar-d1s.h | 5 ----- spaghetti-monster/anduril/cfg-emisar-d4.h | 4 ---- spaghetti-monster/anduril/cfg-emisar-d4s.h | 5 ----- 4 files changed, 19 deletions(-) diff --git a/spaghetti-monster/anduril/cfg-emisar-d1.h b/spaghetti-monster/anduril/cfg-emisar-d1.h index 35e91db..9276ba3 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1.h @@ -8,8 +8,3 @@ #undef THERM_FASTER_LEVEL #endif #define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high - -// no need to be extra-careful on this light -#ifdef THERM_HARD_TURBO_DROP -#undef THERM_HARD_TURBO_DROP -#endif diff --git a/spaghetti-monster/anduril/cfg-emisar-d1s.h b/spaghetti-monster/anduril/cfg-emisar-d1s.h index 56200a2..c01c37d 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1s.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1s.h @@ -8,8 +8,3 @@ #undef THERM_FASTER_LEVEL #endif #define THERM_FASTER_LEVEL 144 // throttle back faster when high - -// no need to be extra-careful on this light -#ifdef THERM_HARD_TURBO_DROP -#undef THERM_HARD_TURBO_DROP -#endif diff --git a/spaghetti-monster/anduril/cfg-emisar-d4.h b/spaghetti-monster/anduril/cfg-emisar-d4.h index 501b9c7..7700d88 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4.h @@ -18,10 +18,6 @@ #define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL #define RAMP_DISCRETE_STEPS 7 -// optional, makes initial turbo step-down faster so first peak isn't as hot -// the D4 runs very very hot, so be extra careful -//#define THERM_HARD_TURBO_DROP - // stop panicking at ~30% power or ~1200 lm #define THERM_FASTER_LEVEL 105 diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s.h b/spaghetti-monster/anduril/cfg-emisar-d4s.h index 88465da..f5addb2 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d4s.h +++ b/spaghetti-monster/anduril/cfg-emisar-d4s.h @@ -37,8 +37,3 @@ #endif #define MIN_THERM_STEPDOWN 60 // lowest value it'll step down to #define THERM_FASTER_LEVEL (RAMP_SIZE-20) // don't throttle back faster when high - -// no need to be extra-careful on this light -#ifdef THERM_HARD_TURBO_DROP -#undef THERM_HARD_TURBO_DROP -#endif -- cgit v1.2.3 From ff9eedb56927387201f96f90bf3d39b99f86e283 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 22 Mar 2020 01:25:55 -0600 Subject: apparently the D1 can also be purchased with a D4v2 driver... so it's basically a D1v2 --- spaghetti-monster/anduril/cfg-emisar-d1v2.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spaghetti-monster/anduril/cfg-emisar-d1v2.h diff --git a/spaghetti-monster/anduril/cfg-emisar-d1v2.h b/spaghetti-monster/anduril/cfg-emisar-d1v2.h new file mode 100644 index 0000000..63cb0e9 --- /dev/null +++ b/spaghetti-monster/anduril/cfg-emisar-d1v2.h @@ -0,0 +1,17 @@ +// Emisar D1v2 config options for Anduril (D1 w/ D4v2 driver) +// ATTINY: 1634 +// same as Emisar D4v2, mostly +#include "cfg-emisar-d4v2.h" + +// there are no aux LED on a D1 +#undef USE_AUX_RGB_LEDS +// ... and no button LED +#undef USE_BUTTON_LED +// no aux LEDs means no need for sleep ticks +#undef TICK_DURING_STANDBY + +// stop panicking at ~75% power or ~1000 lm (D1 has a decent power-to-thermal-mass ratio) +#ifdef THERM_FASTER_LEVEL +#undef THERM_FASTER_LEVEL +#endif +#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high -- cgit v1.2.3 From c6db8faca50762aea53fb38c48c1bd5fae092f19 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 13 Apr 2020 19:50:05 -0600 Subject: recalibrated timing of nice_delay_ms() based on strobe speed measurements... gets very close to 24.2 Hz and 10.0 Hz for default strobe settings now --- spaghetti-monster/anduril/anduril.c | 2 +- spaghetti-monster/fsm-events.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index cb48b45..0758327 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -490,7 +490,7 @@ volatile strobe_mode_te strobe_type = 0; #if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE) // party / tactical strobe timing -volatile uint8_t strobe_delays[] = { 40, 67 }; // party strobe, tactical strobe +volatile uint8_t strobe_delays[] = { 41, 67 }; // party strobe 24 Hz, tactical strobe 10 Hz #endif // bike mode config options diff --git a/spaghetti-monster/fsm-events.c b/spaghetti-monster/fsm-events.c index a1b013a..ad869a6 100644 --- a/spaghetti-monster/fsm-events.c +++ b/spaghetti-monster/fsm-events.c @@ -120,7 +120,7 @@ uint8_t nice_delay_ms(uint16_t ms) { uint8_t level = actual_level; // volatile, avoid repeat access if (level < QUARTERSPEED_LEVEL) { clock_prescale_set(clock_div_4); - _delay_loop_2(BOGOMIPS*95/100/4); + _delay_loop_2(BOGOMIPS*90/100/4); } //else if (level < HALFSPEED_LEVEL) { // clock_prescale_set(clock_div_2); @@ -128,7 +128,7 @@ uint8_t nice_delay_ms(uint16_t ms) { //} else { clock_prescale_set(clock_div_1); - _delay_loop_2(BOGOMIPS*95/100); + _delay_loop_2(BOGOMIPS*90/100); } // restore regular clock speed clock_prescale_set(clock_div_1); @@ -136,13 +136,13 @@ uint8_t nice_delay_ms(uint16_t ms) { // underclock MCU to save power clock_prescale_set(clock_div_4); // wait - _delay_loop_2(BOGOMIPS*95/100/4); + _delay_loop_2(BOGOMIPS*90/100/4); // restore regular clock speed clock_prescale_set(clock_div_1); #endif // ifdef USE_RAMPING #else // wait - _delay_loop_2(BOGOMIPS*95/100); + _delay_loop_2(BOGOMIPS*90/100); #endif // ifdef USE_DYNAMIC_UNDERCLOCKING // run pending system processes while we wait -- cgit v1.2.3 From 1c741d98cc30a62511120ec80f73f30e9ba30eb8 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 13 Apr 2020 19:50:41 -0600 Subject: added a noFET build for D4v2, by request --- spaghetti-monster/anduril/cfg-emisar-d1v2.h | 2 +- spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h | 34 +++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h diff --git a/spaghetti-monster/anduril/cfg-emisar-d1v2.h b/spaghetti-monster/anduril/cfg-emisar-d1v2.h index 63cb0e9..91be3f3 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d1v2.h +++ b/spaghetti-monster/anduril/cfg-emisar-d1v2.h @@ -3,7 +3,7 @@ // same as Emisar D4v2, mostly #include "cfg-emisar-d4v2.h" -// there are no aux LED on a D1 +// there are no aux LEDs on a D1 #undef USE_AUX_RGB_LEDS // ... and no button LED #undef USE_BUTTON_LED diff --git a/spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h b/spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h new file mode 100644 index 0000000..cbb5891 --- /dev/null +++ b/spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h @@ -0,0 +1,34 @@ +// Emisar D4v2-noFET config options for Anduril +#include "cfg-emisar-d4v2.h" +// ATTINY: 1634 + +#undef PWM_CHANNELS +#define PWM_CHANNELS 1 +#undef PWM1_LEVELS +#undef PWM2_LEVELS +#define PWM1_LEVELS 1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,6,6,7,8,8,9,9,10,10,11,12,13,13,14,15,16,16,17,18,19,20,21,22,23,23,24,26,27,28,29,30,31,32,33,34,36,37,38,39,41,42,43,45,46,47,49,50,52,53,55,56,58,59,61,62,64,66,67,69,71,72,74,76,78,80,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,116,118,120,122,125,127,129,132,134,136,139,141,144,146,148,151,154,156,159,161,164,166,169,172,174,177,180,183,185,188,191,194,197,200,203,205,208,211,214,217,220,223,226,230,233,236,239,242,245,249,252,255 +#undef MAX_1x7135 +#define MAX_1x7135 150 +#undef QUARTERSPEED_LEVEL +#undef HALFSPEED_LEVEL +#define QUARTERSPEED_LEVEL 8 +#define HALFSPEED_LEVEL 16 + +#define DEFAULT_LEVEL 80 + +#undef RAMP_SMOOTH_CEIL +#define RAMP_SMOOTH_CEIL 150 +// 10, 45, 80, 115, 150 +#undef RAMP_DISCRETE_FLOOR +#undef RAMP_DISCRETE_CEIL +#undef RAMP_DISCRETE_STEPS +#define RAMP_DISCRETE_FLOOR 10 +#define RAMP_DISCRETE_CEIL 150 +#define RAMP_DISCRETE_STEPS 5 + +#define CANDLE_AMPLITUDE 60 + +#undef THERM_FASTER_LEVEL +#define THERM_FASTER_LEVEL 150 + +#undef USE_THERMAL_REGULATION -- cgit v1.2.3 From 635d013abd690315e4e57caf1f47f1f06b6eba58 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 29 Apr 2020 01:40:25 -0600 Subject: removed unused TEMP_CHANNEL thing from FSM-related code --- hwdef-BLF_GT.h | 2 -- hwdef-Emisar_D18.h | 3 --- hwdef-Emisar_D4.h | 3 --- hwdef-Emisar_D4Sv2.h | 2 -- hwdef-Emisar_D4v2.h | 2 -- hwdef-FW3A.h | 3 --- hwdef-Mateminco_MF01-Mini.h | 2 -- hwdef-Mateminco_MF01S.h | 2 -- hwdef-Noctigon_K1-12V.h | 2 -- hwdef-Noctigon_K1.h | 2 -- hwdef-Noctigon_KR4.h | 2 -- hwdef-TK_Saber.h | 3 --- tk-attiny.h | 5 +++-- 13 files changed, 3 insertions(+), 30 deletions(-) diff --git a/hwdef-BLF_GT.h b/hwdef-BLF_GT.h index 99adc8f..51b391d 100644 --- a/hwdef-BLF_GT.h +++ b/hwdef-BLF_GT.h @@ -52,8 +52,6 @@ #define ADC_22 (92*4) #endif -#define TEMP_CHANNEL 0b00001111 - #define FAST 0xA3 // fast PWM both channels #define PHASE 0xA1 // phase-correct PWM both channels diff --git a/hwdef-Emisar_D18.h b/hwdef-Emisar_D18.h index 3046143..3a238eb 100644 --- a/hwdef-Emisar_D18.h +++ b/hwdef-Emisar_D18.h @@ -40,9 +40,6 @@ #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V #endif -//#define TEMP_DIDR ADC4D -#define TEMP_CHANNEL 0b00001111 - #define FAST 0xA3 // fast PWM both channels #define PHASE 0xA1 // phase-correct PWM both channels diff --git a/hwdef-Emisar_D4.h b/hwdef-Emisar_D4.h index d3b6802..d062d6f 100644 --- a/hwdef-Emisar_D4.h +++ b/hwdef-Emisar_D4.h @@ -41,9 +41,6 @@ #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V #endif -//#define TEMP_DIDR ADC4D -#define TEMP_CHANNEL 0b00001111 - #define FAST 0xA3 // fast PWM both channels #define PHASE 0xA1 // phase-correct PWM both channels diff --git a/hwdef-Emisar_D4Sv2.h b/hwdef-Emisar_D4Sv2.h index 7c3fe86..d68b7ac 100644 --- a/hwdef-Emisar_D4Sv2.h +++ b/hwdef-Emisar_D4Sv2.h @@ -59,8 +59,6 @@ #define VOLTAGE_FUDGE_FACTOR 4 // add 0.20V (measured 0.22V) #endif -#define TEMP_CHANNEL 0b00001111 - // this light has aux LEDs under the optic #define AUXLED_R_PIN PA5 // pin 2 #define AUXLED_G_PIN PA4 // pin 3 diff --git a/hwdef-Emisar_D4v2.h b/hwdef-Emisar_D4v2.h index 60f3fae..fc95e22 100644 --- a/hwdef-Emisar_D4v2.h +++ b/hwdef-Emisar_D4v2.h @@ -55,8 +55,6 @@ #define VOLTAGE_FUDGE_FACTOR 4 // add 0.20V (measured 0.22V) #endif -#define TEMP_CHANNEL 0b00001111 - // this light has aux LEDs under the optic #define AUXLED_R_PIN PA5 // pin 2 #define AUXLED_G_PIN PA4 // pin 3 diff --git a/hwdef-FW3A.h b/hwdef-FW3A.h index a223b08..e8875d7 100644 --- a/hwdef-FW3A.h +++ b/hwdef-FW3A.h @@ -42,9 +42,6 @@ #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V #endif -//#define TEMP_DIDR ADC4D -#define TEMP_CHANNEL 0b00001111 - #define FAST 0xA3 // fast PWM both channels #define PHASE 0xA1 // phase-correct PWM both channels diff --git a/hwdef-Mateminco_MF01-Mini.h b/hwdef-Mateminco_MF01-Mini.h index 0fea1e2..c0de533 100644 --- a/hwdef-Mateminco_MF01-Mini.h +++ b/hwdef-Mateminco_MF01-Mini.h @@ -41,8 +41,6 @@ #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V #endif -#define TEMP_CHANNEL 0b00001111 - #define FAST 0xA3 // fast PWM both channels #define PHASE 0xA1 // phase-correct PWM both channels diff --git a/hwdef-Mateminco_MF01S.h b/hwdef-Mateminco_MF01S.h index cb5a416..78a64a6 100644 --- a/hwdef-Mateminco_MF01S.h +++ b/hwdef-Mateminco_MF01S.h @@ -52,8 +52,6 @@ #define ADC_22 (117*4) #endif -#define TEMP_CHANNEL 0b00001111 - #define FAST 0xA3 // fast PWM both channels #define PHASE 0xA1 // phase-correct PWM both channels diff --git a/hwdef-Noctigon_K1-12V.h b/hwdef-Noctigon_K1-12V.h index 7beb205..8781d8e 100644 --- a/hwdef-Noctigon_K1-12V.h +++ b/hwdef-Noctigon_K1-12V.h @@ -90,8 +90,6 @@ #define ADC_22 482 // manually tweaked so 4.16V will blink out 4.2 #endif -#define TEMP_CHANNEL 0b00001111 - // this light has aux LEDs under the optic #define AUXLED_R_PIN PA5 // pin 2 #define AUXLED_G_PIN PA4 // pin 3 diff --git a/hwdef-Noctigon_K1.h b/hwdef-Noctigon_K1.h index 8c8a4db..4c0ce05 100644 --- a/hwdef-Noctigon_K1.h +++ b/hwdef-Noctigon_K1.h @@ -87,8 +87,6 @@ #define ADC_22 482 // manually tweaked so 4.16V will blink out 4.2 #endif -#define TEMP_CHANNEL 0b00001111 - // this light has aux LEDs under the optic #define AUXLED_R_PIN PA5 // pin 2 #define AUXLED_G_PIN PA4 // pin 3 diff --git a/hwdef-Noctigon_KR4.h b/hwdef-Noctigon_KR4.h index 4eec585..073fe27 100644 --- a/hwdef-Noctigon_KR4.h +++ b/hwdef-Noctigon_KR4.h @@ -97,8 +97,6 @@ #define ADC_22 482 // manually tweaked so 4.16V will blink out 4.2 #endif -#define TEMP_CHANNEL 0b00001111 - // this light has aux LEDs under the optic #define AUXLED_R_PIN PA5 // pin 2 #define AUXLED_G_PIN PA4 // pin 3 diff --git a/hwdef-TK_Saber.h b/hwdef-TK_Saber.h index 9458398..e6476b8 100644 --- a/hwdef-TK_Saber.h +++ b/hwdef-TK_Saber.h @@ -28,9 +28,6 @@ // average drop across diode on this hardware #define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V -//#define TEMP_DIDR ADC4D -#define TEMP_CHANNEL 0b00001111 - #define FAST 0xA3 // fast PWM both channels #define PHASE 0xA1 // phase-correct PWM both channels diff --git a/tk-attiny.h b/tk-attiny.h index 76c9c9b..49f1195 100644 --- a/tk-attiny.h +++ b/tk-attiny.h @@ -63,9 +63,10 @@ #define F_CPU 8000000UL #define V_REF REFS1 #define BOGOMIPS (F_CPU/4000) - // (1 << V_REF) | (0 << ADLAR) | (VCC_CHANNEL) + // DS table 19-3, 19-4, 1.1V ref / VCC #define ADMUX_VCC 0b00001101 - // (1 << V_REF) | (0 << ADLAR) | (THERM_CHANNEL) + // (1 << V_REF) | (THERM_CHANNEL) + // DS table 19-3, 19-4, internal sensor / 1.1V ref #define ADMUX_THERM 0b10001110 #define DELAY_ZERO_TIME 1020 //#define SWITCH_PORT PINA // set this in hwdef -- cgit v1.2.3 From 11e2778dabb5ff6fa12475c752044c7ff35cf94c Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 14 May 2020 16:20:33 -0600 Subject: fixed build when USE_GOODNIGHT_MODE not enabled --- spaghetti-monster/anduril/anduril.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 8a9584e..a23b2e1 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -1593,11 +1593,25 @@ uint8_t battcheck_state(Event event, uint16_t arg) { set_state(off_state, 0); return MISCHIEF_MANAGED; } + #ifdef USE_GOODNIGHT_MODE // 2 clicks: goodnight mode else if (event == EV_2clicks) { set_state(goodnight_state, 0); return MISCHIEF_MANAGED; } + #elif defined(USE_BEACON_MODE) + // 2 clicks: beacon mode + else if (event == EV_2clicks) { + set_state(beacon_state, 0); + return MISCHIEF_MANAGED; + } + #elif defined(USE_THERMAL_REGULATION) + // 2 clicks: tempcheck mode + else if (event == EV_2clicks) { + set_state(tempcheck_state, 0); + return MISCHIEF_MANAGED; + } + #endif return EVENT_NOT_HANDLED; } #endif -- cgit v1.2.3 From 72542bdb90a0ab9e7a7dc8faad86a646507ef6f7 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 14 May 2020 16:29:29 -0600 Subject: fixed build of "momentary" example UI --- spaghetti-monster/fsm-events.h | 2 +- spaghetti-monster/momentary/momentary.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/spaghetti-monster/fsm-events.h b/spaghetti-monster/fsm-events.h index 6760fdd..a132d5a 100644 --- a/spaghetti-monster/fsm-events.h +++ b/spaghetti-monster/fsm-events.h @@ -218,8 +218,8 @@ void emit(Event event, uint16_t arg); void emit_current_event(uint16_t arg); uint8_t nice_delay_ms(uint16_t ms); -//uint8_t nice_delay_4ms(uint8_t ms); //uint8_t nice_delay_s(); inline void interrupt_nice_delays(); +void delay_4ms(uint8_t ms); #endif diff --git a/spaghetti-monster/momentary/momentary.c b/spaghetti-monster/momentary/momentary.c index 26acd44..c7a8cf1 100644 --- a/spaghetti-monster/momentary/momentary.c +++ b/spaghetti-monster/momentary/momentary.c @@ -22,7 +22,6 @@ #include "hwdef-Emisar_D4.h" #define USE_LVP #define USE_DEBUG_BLINK -#define USE_DELAY_4MS #include "spaghetti-monster.h" volatile uint8_t brightness; -- cgit v1.2.3 From 4958a769029f7d1f444c5662fc0bee54a377229e Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 14 May 2020 16:49:14 -0600 Subject: fixed eeprom_wl functions on attiny1634 (didn't build before, due to a data type mismatch) --- spaghetti-monster/fsm-eeprom.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spaghetti-monster/fsm-eeprom.c b/spaghetti-monster/fsm-eeprom.c index 77352cf..0de7e05 100644 --- a/spaghetti-monster/fsm-eeprom.c +++ b/spaghetti-monster/fsm-eeprom.c @@ -67,7 +67,7 @@ void save_eeprom() { #ifdef USE_EEPROM_WL uint8_t eeprom_wl[EEPROM_WL_BYTES]; -EEP_OFFSET_T eep_wl_prev_offset; +uint8_t * eep_wl_prev_offset; uint8_t load_eeprom_wl() { #ifdef LED_ENABLE_PIN @@ -77,11 +77,11 @@ uint8_t load_eeprom_wl() { cli(); // check if eeprom has been initialized; abort if it hasn't uint8_t found = 0; - EEP_OFFSET_T offset; + uint8_t * offset; for(offset = 0; - offset < EEP_WL_SIZE - EEPROM_WL_BYTES - 1; + offset < (uint8_t *)(EEP_WL_SIZE - EEPROM_WL_BYTES - 1); offset += (EEPROM_WL_BYTES + 1)) { - if (eeprom_read_byte((uint8_t *)offset) == EEP_MARKER) { + if (eeprom_read_byte(offset) == EEP_MARKER) { found = 1; eep_wl_prev_offset = offset; break; @@ -91,7 +91,7 @@ uint8_t load_eeprom_wl() { if (found) { // load the actual data for(uint8_t i=0; i EEP_WL_SIZE-EEPROM_WL_BYTES-1) offset = 0; + if (offset > (uint8_t *)(EEP_WL_SIZE-EEPROM_WL_BYTES-1)) offset = 0; eep_wl_prev_offset = offset; // marker byte // FIXME: write the marker last, to signal completed transaction - eeprom_update_byte((uint8_t *)offset, EEP_MARKER); + eeprom_update_byte(offset, EEP_MARKER); offset ++; // user data for(uint8_t i=0; i TICKS_PER_SECOND*5) { // sleep after 5 seconds go_to_standby = 1; // sleep while light is off // turn off lighted button @@ -1898,7 +1902,9 @@ uint8_t momentary_state(Event event, uint16_t arg) { rgb_led_update(0, 0); #endif } + #ifdef USE_STROBE_STATE } + #endif return MISCHIEF_MANAGED; } -- cgit v1.2.3 From 45c6e163739d3ac095f283d07b31e65d6218e0b6 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 1 Jun 2020 20:58:45 -0600 Subject: "SOS" is treated as one "letter" in Morse code... it's not three letters (so, don't put the normal inter-letter gap between) --- spaghetti-monster/anduril/anduril.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 167c14d..01904dc 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -1572,7 +1572,8 @@ void sos_blink(uint8_t num, uint8_t dah) { nice_delay_ms(DIT_LENGTH); } // three "off" dits (or one "dah") between letters - nice_delay_ms(DIT_LENGTH*2); + // (except for SOS, which is collectively treated as a single "letter") + //nice_delay_ms(DIT_LENGTH*2); } inline void sos_mode_iter() { -- cgit v1.2.3