From ce07a791ecb5dd9c2bd6ac773c4b6b2e993ad681 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 18 Mar 2019 02:53:27 -0600 Subject: Made default level configurable per build target, made moon hint blip a bit more noticeable. --- spaghetti-monster/anduril/anduril.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 09c7927..7f19a5a 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -242,7 +242,10 @@ void save_config_wl(); #endif // brightness control -uint8_t memorized_level = MAX_1x7135; +#ifndef DEFAULT_LEVEL +#define DEFAULT_LEVEL MAX_1x7135 +#endif +uint8_t memorized_level = DEFAULT_LEVEL; // smooth vs discrete ramping volatile uint8_t ramp_style = 0; // 0 = smooth, 1 = discrete volatile uint8_t ramp_smooth_floor = RAMP_SMOOTH_FLOOR; @@ -369,7 +372,7 @@ uint8_t off_state(Event event, uint16_t arg) { // let the user know they can let go now to stay at moon uint8_t temp = actual_level; set_level(0); - delay_4ms(2); + delay_4ms(3); set_level(temp); } else #endif -- cgit v1.2.3 From 7599d9827a94f199c170298b97b482faaf19520e Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 18 Mar 2019 03:00:56 -0600 Subject: added Emisar D18 config (not final) --- spaghetti-monster/anduril/cfg-emisar-d18.h | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 spaghetti-monster/anduril/cfg-emisar-d18.h (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/cfg-emisar-d18.h b/spaghetti-monster/anduril/cfg-emisar-d18.h new file mode 100644 index 0000000..5171dba --- /dev/null +++ b/spaghetti-monster/anduril/cfg-emisar-d18.h @@ -0,0 +1,38 @@ +// Emisar FET+13+1 config options for Anduril +#include "hwdef-Emisar_D18.h" + +// front-facing aux LEDs +#define USE_INDICATOR_LED +//#define USE_INDICATOR_LED_WHILE_RAMPING +// enable blinking indicator LED while off +#define TICK_DURING_STANDBY +#define STANDBY_TICK_SPEED 3 // every 0.128 s +#define USE_FANCIER_BLINKING_INDICATOR +// off mode: low (1) +// lockout: blinking (3) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) + +// Emisar wanted a shortcut to this +#define USE_TENCLICK_THERMAL_CONFIG + + +// FW3A 1x7135 ramp: +// ../../bin/level_calc.py cube 1 65 7135 1 0.8 150 +// ... mixed with this: +// ../../../bin/level_calc.py ninth 3 150 7135 1 2.5 150 7135 1 1 1600 FET 1 10 5265 +#define RAMP_LENGTH 150 +#define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,6,7,8,9,10,12,13,14,15,17,19,20,22,24,26,29,31,34,36,39,42,45,48,51,55,59,62,66,70,75,79,84,89,93,99,104,110,115,121,127,134,140,147,154,161,168,176,184,192,200,209,217,226,236,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,5,6,8,9,11,13,14,16,18,20,22,25,27,29,32,34,37,40,43,46,49,53,56,60,63,67,71,76,80,85,89,94,100,105,110,116,122,128,135,142,148,156,163,171,179,187,196,205,214,224,234,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,16,21,27,33,39,46,52,59,66,74,81,89,97,105,114,123,132,142,151,162,172,183,194,205,217,229,242,255 +#define MAX_1x7135 65 +#define MAX_Nx7135 120 +#define HALFSPEED_LEVEL 14 +#define QUARTERSPEED_LEVEL 5 + +// start at ~1500 lm, not ~150 lm +#define DEFAULT_LEVEL MAX_Nx7135 + +// stop panicking at about 4.9A or ~1750 lm +#define THERM_FASTER_LEVEL MAX_Nx7135 +// optional, makes initial turbo step-down faster so first peak isn't as hot +#define THERM_HARD_TURBO_DROP -- cgit v1.2.3 From de0c7eadd70220d29ab6a332d0c47b80c91985c8 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 18 Mar 2019 04:06:37 -0600 Subject: made mid-ramp blinks more configurable per build target (allows for 1 or 2 mid-ramp blinks, at arbitrary levels, but it defaults to the old behavior at power channel boundaries) also merged anduril updates into rampingios --- spaghetti-monster/anduril/anduril.c | 39 +++++++++++++++++------- spaghetti-monster/anduril/cfg-blf-gt.h | 2 +- spaghetti-monster/anduril/cfg-ff-pl47.h | 2 +- spaghetti-monster/anduril/cfg-ff-rot66.h | 2 +- spaghetti-monster/anduril/cfg-sofirn-sp36.h | 4 +-- spaghetti-monster/rampingios/rampingiosv3.c | 46 +++++++++++++++++++++-------- 6 files changed, 66 insertions(+), 29 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index a9ae959..93f8c16 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -33,7 +33,7 @@ // or too short) #define MOON_TIMING_HINT // short blips while ramping -#define BLINK_AT_CHANNEL_BOUNDARIES +#define BLINK_AT_RAMP_MIDDLE //#define BLINK_AT_RAMP_FLOOR #define BLINK_AT_RAMP_CEILING //#define BLINK_AT_STEPS // whenever a discrete ramp mode is passed in smooth mode @@ -275,6 +275,23 @@ void save_config_wl(); #define RAMP_DISCRETE_STEPS 7 #endif +// mile marker(s) partway up the ramp +// default: blink only at border between regulated and FET +#ifdef BLINK_AT_RAMP_MIDDLE + #if PWM_CHANNELS >= 3 + #ifndef BLINK_AT_RAMP_MIDDLE_1 + #define BLINK_AT_RAMP_MIDDLE_1 MAX_Nx7135 + #ifndef BLINK_AT_RAMP_MIDDLE_2 + #define BLINK_AT_RAMP_MIDDLE_2 MAX_1x7135 + #endif + #endif + #else + #ifndef BLINK_AT_RAMP_MIDDLE_1 + #define BLINK_AT_RAMP_MIDDLE_1 MAX_1x7135 + #endif + #endif +#endif + // brightness control #ifndef DEFAULT_LEVEL #define DEFAULT_LEVEL MAX_1x7135 @@ -619,15 +636,15 @@ uint8_t steady_state(Event event, uint16_t arg) { #ifdef USE_THERMAL_REGULATION target_level = memorized_level; #endif - #if defined(BLINK_AT_RAMP_CEILING) || defined(BLINK_AT_CHANNEL_BOUNDARIES) + #if defined(BLINK_AT_RAMP_CEILING) || defined(BLINK_AT_RAMP_MIDDLE) // only blink once for each threshold if ((memorized_level != actual_level) && ( 0 // for easier syntax below - #ifdef BLINK_AT_CHANNEL_BOUNDARIES - || (memorized_level == MAX_1x7135) - #if PWM_CHANNELS >= 3 - || (memorized_level == MAX_Nx7135) + #ifdef BLINK_AT_RAMP_MIDDLE_1 + || (memorized_level == BLINK_AT_RAMP_MIDDLE_1) #endif + #ifdef BLINK_AT_RAMP_MIDDLE_2 + || (memorized_level == BLINK_AT_RAMP_MIDDLE_2) #endif #ifdef BLINK_AT_RAMP_CEILING || (memorized_level == mode_max) @@ -684,15 +701,15 @@ uint8_t steady_state(Event event, uint16_t arg) { #ifdef USE_THERMAL_REGULATION target_level = memorized_level; #endif - #if defined(BLINK_AT_RAMP_FLOOR) || defined(BLINK_AT_CHANNEL_BOUNDARIES) + #if defined(BLINK_AT_RAMP_FLOOR) || defined(BLINK_AT_RAMP_MIDDLE) // only blink once for each threshold if ((memorized_level != actual_level) && ( 0 // for easier syntax below - #ifdef BLINK_AT_CHANNEL_BOUNDARIES - || (memorized_level == MAX_1x7135) - #if PWM_CHANNELS >= 3 - || (memorized_level == MAX_Nx7135) + #ifdef BLINK_AT_RAMP_MIDDLE_1 + || (memorized_level == BLINK_AT_RAMP_MIDDLE_1) #endif + #ifdef BLINK_AT_RAMP_MIDDLE_2 + || (memorized_level == BLINK_AT_RAMP_MIDDLE_2) #endif #ifdef BLINK_AT_RAMP_FLOOR || (memorized_level == mode_min) diff --git a/spaghetti-monster/anduril/cfg-blf-gt.h b/spaghetti-monster/anduril/cfg-blf-gt.h index b8f4d6d..6a74bbc 100644 --- a/spaghetti-monster/anduril/cfg-blf-gt.h +++ b/spaghetti-monster/anduril/cfg-blf-gt.h @@ -9,8 +9,8 @@ #define TICK_DURING_STANDBY // don't blink during ramp, it's irrelevant and annoying on this light -#undef BLINK_AT_CHANNEL_BOUNDARIES #undef BLINK_AT_RAMP_CEILING +#undef BLINK_AT_RAMP_MIDDLE #undef BLINK_AT_RAMP_FLOOR //#undef USE_SET_LEVEL_GRADUALLY diff --git a/spaghetti-monster/anduril/cfg-ff-pl47.h b/spaghetti-monster/anduril/cfg-ff-pl47.h index 8e21013..f9c8974 100644 --- a/spaghetti-monster/anduril/cfg-ff-pl47.h +++ b/spaghetti-monster/anduril/cfg-ff-pl47.h @@ -65,6 +65,6 @@ #define THERM_HARD_TURBO_DROP // don't do this -#undef BLINK_AT_CHANNEL_BOUNDARIES +#undef BLINK_AT_RAMP_MIDDLE #undef BLINK_AT_RAMP_CEILING diff --git a/spaghetti-monster/anduril/cfg-ff-rot66.h b/spaghetti-monster/anduril/cfg-ff-rot66.h index 78d7f66..6073ce0 100644 --- a/spaghetti-monster/anduril/cfg-ff-rot66.h +++ b/spaghetti-monster/anduril/cfg-ff-rot66.h @@ -42,6 +42,6 @@ #define THERM_HARD_TURBO_DROP // don't do this -#undef BLINK_AT_CHANNEL_BOUNDARIES +#undef BLINK_AT_RAMP_MIDDLE #undef BLINK_AT_RAMP_CEILING diff --git a/spaghetti-monster/anduril/cfg-sofirn-sp36.h b/spaghetti-monster/anduril/cfg-sofirn-sp36.h index 1150a62..494a263 100644 --- a/spaghetti-monster/anduril/cfg-sofirn-sp36.h +++ b/spaghetti-monster/anduril/cfg-sofirn-sp36.h @@ -16,8 +16,8 @@ // don't blink during the ramp; the button LED brightness is sufficient // to indicate which power channel(s) are being used -#ifdef BLINK_AT_CHANNEL_BOUNDARIES -#undef BLINK_AT_CHANNEL_BOUNDARIES +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE #endif #ifdef BLINK_AT_RAMP_CEILING #undef BLINK_AT_RAMP_CEILING diff --git a/spaghetti-monster/rampingios/rampingiosv3.c b/spaghetti-monster/rampingios/rampingiosv3.c index c6886e7..e4eb2fa 100644 --- a/spaghetti-monster/rampingios/rampingiosv3.c +++ b/spaghetti-monster/rampingios/rampingiosv3.c @@ -33,7 +33,7 @@ // or too short) #define MOON_TIMING_HINT // short blips while ramping -#define BLINK_AT_CHANNEL_BOUNDARIES +#define BLINK_AT_RAMP_MIDDLE //#define BLINK_AT_RAMP_FLOOR #define BLINK_AT_RAMP_CEILING //#define BLINK_AT_STEPS // whenever a discrete ramp mode is passed in smooth mode @@ -177,8 +177,28 @@ void save_config(); #define RAMP_DISCRETE_STEPS 7 #endif +// mile marker(s) partway up the ramp +// default: blink only at border between regulated and FET +#ifdef BLINK_AT_RAMP_MIDDLE + #if PWM_CHANNELS >= 3 + #ifndef BLINK_AT_RAMP_MIDDLE_1 + #define BLINK_AT_RAMP_MIDDLE_1 MAX_Nx7135 + #ifndef BLINK_AT_RAMP_MIDDLE_2 + #define BLINK_AT_RAMP_MIDDLE_2 MAX_1x7135 + #endif + #endif + #else + #ifndef BLINK_AT_RAMP_MIDDLE_1 + #define BLINK_AT_RAMP_MIDDLE_1 MAX_1x7135 + #endif + #endif +#endif + // brightness control -uint8_t memorized_level = MAX_1x7135; +#ifndef DEFAULT_LEVEL +#define DEFAULT_LEVEL MAX_1x7135 +#endif +uint8_t memorized_level = DEFAULT_LEVEL; // smooth vs discrete ramping volatile uint8_t ramp_style = 0; // 0 = smooth, 1 = discrete volatile uint8_t ramp_smooth_floor = RAMP_SMOOTH_FLOOR; @@ -262,7 +282,7 @@ uint8_t off_state(Event event, uint16_t arg) { // let the user know they can let go now to stay at moon uint8_t temp = actual_level; set_level(0); - delay_4ms(2); + delay_4ms(3); set_level(temp); } else #endif @@ -444,15 +464,15 @@ uint8_t steady_state(Event event, uint16_t arg) { #ifdef USE_THERMAL_REGULATION target_level = memorized_level; #endif - #if defined(BLINK_AT_RAMP_CEILING) || defined(BLINK_AT_CHANNEL_BOUNDARIES) + #if defined(BLINK_AT_RAMP_CEILING) || defined(BLINK_AT_RAMP_MIDDLE) // only blink once for each threshold if ((memorized_level != actual_level) && ( 0 // for easier syntax below - #ifdef BLINK_AT_CHANNEL_BOUNDARIES - || (memorized_level == MAX_1x7135) - #if PWM_CHANNELS >= 3 - || (memorized_level == MAX_Nx7135) + #ifdef BLINK_AT_RAMP_MIDDLE_1 + || (memorized_level == BLINK_AT_RAMP_MIDDLE_1) #endif + #ifdef BLINK_AT_RAMP_MIDDLE_2 + || (memorized_level == BLINK_AT_RAMP_MIDDLE_2) #endif #ifdef BLINK_AT_RAMP_CEILING || (memorized_level == mode_max) @@ -506,15 +526,15 @@ uint8_t steady_state(Event event, uint16_t arg) { #ifdef USE_THERMAL_REGULATION target_level = memorized_level; #endif - #if defined(BLINK_AT_RAMP_FLOOR) || defined(BLINK_AT_CHANNEL_BOUNDARIES) + #if defined(BLINK_AT_RAMP_FLOOR) || defined(BLINK_AT_RAMP_MIDDLE) // only blink once for each threshold if ((memorized_level != actual_level) && ( 0 // for easier syntax below - #ifdef BLINK_AT_CHANNEL_BOUNDARIES - || (memorized_level == MAX_1x7135) - #if PWM_CHANNELS >= 3 - || (memorized_level == MAX_Nx7135) + #ifdef BLINK_AT_RAMP_MIDDLE_1 + || (memorized_level == BLINK_AT_RAMP_MIDDLE_1) #endif + #ifdef BLINK_AT_RAMP_MIDDLE_2 + || (memorized_level == BLINK_AT_RAMP_MIDDLE_2) #endif #ifdef BLINK_AT_RAMP_FLOOR || (memorized_level == mode_min) -- cgit v1.2.3 From 6e645f9f442493e55b00ce801a8d8e1219833198 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 18 Mar 2019 04:07:47 -0600 Subject: adjusted Emisar D18 ramp shape and other config options --- spaghetti-monster/anduril/cfg-emisar-d18.h | 34 ++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/cfg-emisar-d18.h b/spaghetti-monster/anduril/cfg-emisar-d18.h index 5171dba..bba846f 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d18.h +++ b/spaghetti-monster/anduril/cfg-emisar-d18.h @@ -16,23 +16,31 @@ #define USE_TENCLICK_THERMAL_CONFIG -// FW3A 1x7135 ramp: -// ../../bin/level_calc.py cube 1 65 7135 1 0.8 150 -// ... mixed with this: -// ../../../bin/level_calc.py ninth 3 150 7135 1 2.5 150 7135 1 1 1600 FET 1 10 5265 +// level_calc.py ninth 3 150 7135 1 2.0 130.2 7135 1 1 2203.62 FET 1 10 12000 +// (designed to make 1x hit at level 55, and Nx hit at level 110) #define RAMP_LENGTH 150 -#define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,6,7,8,9,10,12,13,14,15,17,19,20,22,24,26,29,31,34,36,39,42,45,48,51,55,59,62,66,70,75,79,84,89,93,99,104,110,115,121,127,134,140,147,154,161,168,176,184,192,200,209,217,226,236,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 -#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,5,6,8,9,11,13,14,16,18,20,22,25,27,29,32,34,37,40,43,46,49,53,56,60,63,67,71,76,80,85,89,94,100,105,110,116,122,128,135,142,148,156,163,171,179,187,196,205,214,224,234,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 -#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,16,21,27,33,39,46,52,59,66,74,81,89,97,105,114,123,132,142,151,162,172,183,194,205,217,229,242,255 -#define MAX_1x7135 65 -#define MAX_Nx7135 120 -#define HALFSPEED_LEVEL 14 +#define PWM1_LEVELS 1,1,2,2,3,3,4,5,5,6,7,8,9,10,11,13,14,15,17,19,21,22,25,27,29,32,35,38,41,44,48,52,56,60,65,70,76,81,87,94,101,108,116,124,133,142,152,163,174,185,198,211,225,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5,6,7,9,10,12,13,15,17,18,20,22,24,26,29,31,34,36,39,42,45,48,52,55,59,63,67,71,76,80,85,90,96,101,107,113,120,126,133,140,148,156,164,172,181,191,200,210,221,232,243,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,6,10,13,16,19,23,27,30,34,39,43,47,52,57,62,67,72,78,84,90,96,103,109,116,123,131,138,146,155,163,172,181,191,201,211,221,232,243,255 +#define MAX_1x7135 55 +#define MAX_Nx7135 110 +#define HALFSPEED_LEVEL 16 #define QUARTERSPEED_LEVEL 5 -// start at ~1500 lm, not ~150 lm +// start at ~2000 lm after battery change, not ~150 lm (at Emisar's request) #define DEFAULT_LEVEL MAX_Nx7135 -// stop panicking at about 4.9A or ~1750 lm -#define THERM_FASTER_LEVEL MAX_Nx7135 +// higher floor than default, and stop at highest regulated level +#define RAMP_DISCRETE_FLOOR 20 +#define RAMP_DISCRETE_CEIL MAX_Nx7135 +#define RAMP_DISCRETE_STEPS 7 + +// only blink at max regulated level and ceiling +#define BLINK_AT_RAMP_MIDDLE +#define BLINK_AT_RAMP_MIDDLE_1 MAX_Nx7135 +#define BLINK_AT_RAMP_CEILING + +// stop panicking at about ~30% power or ~3600 lm +#define THERM_FASTER_LEVEL 120 // optional, makes initial turbo step-down faster so first peak isn't as hot #define THERM_HARD_TURBO_DROP -- cgit v1.2.3 From f4d0a69d866556fc1f66d723cf9f19163ed2bcec Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 26 Mar 2019 11:47:38 -0600 Subject: tweaked D18 ramp (03-18a version) --- spaghetti-monster/anduril/cfg-emisar-d18.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/cfg-emisar-d18.h b/spaghetti-monster/anduril/cfg-emisar-d18.h index bba846f..a9a5d4e 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d18.h +++ b/spaghetti-monster/anduril/cfg-emisar-d18.h @@ -20,8 +20,8 @@ // (designed to make 1x hit at level 55, and Nx hit at level 110) #define RAMP_LENGTH 150 #define PWM1_LEVELS 1,1,2,2,3,3,4,5,5,6,7,8,9,10,11,13,14,15,17,19,21,22,25,27,29,32,35,38,41,44,48,52,56,60,65,70,76,81,87,94,101,108,116,124,133,142,152,163,174,185,198,211,225,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 -#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5,6,7,9,10,12,13,15,17,18,20,22,24,26,29,31,34,36,39,42,45,48,52,55,59,63,67,71,76,80,85,90,96,101,107,113,120,126,133,140,148,156,164,172,181,191,200,210,221,232,243,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 -#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,6,10,13,16,19,23,27,30,34,39,43,47,52,57,62,67,72,78,84,90,96,103,109,116,123,131,138,146,155,163,172,181,191,201,211,221,232,243,255 +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,9,10,11,12,14,15,16,18,20,21,23,25,27,29,31,33,36,38,41,43,46,49,53,56,59,63,67,71,75,79,84,89,94,99,104,110,116,122,129,135,143,150,158,166,174,183,192,201,211,222,232,243,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,8,11,15,18,21,25,28,32,36,40,45,49,54,58,63,69,74,79,85,91,97,104,110,117,124,132,139,147,156,164,173,182,191,201,211,222,232,243,255 #define MAX_1x7135 55 #define MAX_Nx7135 110 #define HALFSPEED_LEVEL 16 -- cgit v1.2.3 From 81bfb809ed4fcec12ae96b07e826c78e14d019a0 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 26 Mar 2019 11:49:23 -0600 Subject: updated D18 config to 03-21 version --- spaghetti-monster/anduril/cfg-emisar-d18.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/cfg-emisar-d18.h b/spaghetti-monster/anduril/cfg-emisar-d18.h index a9a5d4e..fcea43a 100644 --- a/spaghetti-monster/anduril/cfg-emisar-d18.h +++ b/spaghetti-monster/anduril/cfg-emisar-d18.h @@ -16,22 +16,22 @@ #define USE_TENCLICK_THERMAL_CONFIG -// level_calc.py ninth 3 150 7135 1 2.0 130.2 7135 1 1 2203.62 FET 1 10 12000 -// (designed to make 1x hit at level 55, and Nx hit at level 110) +// level_calc.py seventh 3 150 7135 1 1.4 117.99 7135 6 1 1706.86 FET 3 10 13000 +// (designed to make 1x hit at level 50, and Nx hit at level 100) #define RAMP_LENGTH 150 -#define PWM1_LEVELS 1,1,2,2,3,3,4,5,5,6,7,8,9,10,11,13,14,15,17,19,21,22,25,27,29,32,35,38,41,44,48,52,56,60,65,70,76,81,87,94,101,108,116,124,133,142,152,163,174,185,198,211,225,239,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 -#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,9,10,11,12,14,15,16,18,20,21,23,25,27,29,31,33,36,38,41,43,46,49,53,56,59,63,67,71,75,79,84,89,94,99,104,110,116,122,129,135,143,150,158,166,174,183,192,201,211,222,232,243,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 -#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,8,11,15,18,21,25,28,32,36,40,45,49,54,58,63,69,74,79,85,91,97,104,110,117,124,132,139,147,156,164,173,182,191,201,211,222,232,243,255 -#define MAX_1x7135 55 -#define MAX_Nx7135 110 -#define HALFSPEED_LEVEL 16 -#define QUARTERSPEED_LEVEL 5 +#define PWM1_LEVELS 1,1,2,2,3,4,4,5,6,7,8,9,10,11,15,16,18,20,22,24,26,28,30,33,36,39,43,47,51,56,61,66,72,78,85,92,99,107,116,125,135,145,156,168,180,194,208,222,238,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,10,11,13,14,16,18,19,21,23,26,28,30,33,35,38,41,44,47,51,54,58,62,66,70,75,79,84,90,95,101,106,112,119,126,133,140,147,155,164,172,181,190,200,210,221,232,243,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,7,9,11,13,15,18,20,23,25,28,31,34,37,40,44,47,51,54,58,62,66,70,75,79,84,89,94,99,104,110,115,121,127,134,140,147,154,161,168,176,183,191,200,208,217,226,235,245,255 +#define MAX_1x7135 50 +#define MAX_Nx7135 100 +#define HALFSPEED_LEVEL 15 +#define QUARTERSPEED_LEVEL 6 // start at ~2000 lm after battery change, not ~150 lm (at Emisar's request) #define DEFAULT_LEVEL MAX_Nx7135 // higher floor than default, and stop at highest regulated level -#define RAMP_DISCRETE_FLOOR 20 +#define RAMP_DISCRETE_FLOOR 25 #define RAMP_DISCRETE_CEIL MAX_Nx7135 #define RAMP_DISCRETE_STEPS 7 @@ -40,7 +40,7 @@ #define BLINK_AT_RAMP_MIDDLE_1 MAX_Nx7135 #define BLINK_AT_RAMP_CEILING -// stop panicking at about ~30% power or ~3600 lm -#define THERM_FASTER_LEVEL 120 +// stop panicking at about ~40% power or ~5000 lm +#define THERM_FASTER_LEVEL 125 // optional, makes initial turbo step-down faster so first peak isn't as hot #define THERM_HARD_TURBO_DROP -- cgit v1.2.3 From 8991713b7209dd030ada252b19af5d536c5f07f7 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 29 Mar 2019 10:34:27 -0600 Subject: fixed bug: hold-from-off then release and hold failed in stepped ramp (was necessary to wait 1 second before it'd ramp the right way) (reported by maukka) --- spaghetti-monster/anduril/anduril.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'spaghetti-monster') diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index 93f8c16..88aafbb 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -624,9 +624,13 @@ uint8_t steady_state(Event event, uint16_t arg) { return MISCHIEF_MANAGED; } #ifdef USE_REVERSING - // make it ramp down instead, if already at max - if ((arg <= 1) && (actual_level >= mode_max)) { - ramp_direction = -1; + // fix ramp direction on first frame if necessary + if (!arg) { + // make it ramp down instead, if already at max + if (actual_level >= mode_max) { ramp_direction = -1; } + // make it ramp up if already at min + // (off->hold->stepped_min->release causes this state) + else if (actual_level <= mode_min) { ramp_direction = 1; } } memorized_level = nearest_level((int16_t)actual_level \ + (ramp_step_size * ramp_direction)); -- cgit v1.2.3