From 8d022eba3b741bd2a1253df09c01d75e340b492a Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 3 Nov 2023 06:39:50 -0600 Subject: renamed cfg.h -> anduril.h so each UI can have its own cfg (part 1) (still need to update file contents afterward, but doing it in a separate commit so git can detect renames easier) --- hw/sofirn/blf-lt1-t1616/anduril.h | 110 +++++++++++++++++++++++++++++++++ hw/sofirn/blf-lt1-t1616/cfg.h | 110 --------------------------------- hw/sofirn/blf-lt1/anduril.h | 105 ++++++++++++++++++++++++++++++++ hw/sofirn/blf-lt1/cfg.h | 105 -------------------------------- hw/sofirn/blf-q8-t1616/anduril.h | 82 +++++++++++++++++++++++++ hw/sofirn/blf-q8-t1616/cfg.h | 82 ------------------------- hw/sofirn/blf-q8/anduril.h | 71 ++++++++++++++++++++++ hw/sofirn/blf-q8/cfg.h | 71 ---------------------- hw/sofirn/lt1s-pro/anduril.h | 125 ++++++++++++++++++++++++++++++++++++++ hw/sofirn/lt1s-pro/cfg.h | 125 -------------------------------------- hw/sofirn/sc21-pro/anduril.h | 14 +++++ hw/sofirn/sc21-pro/cfg.h | 14 ----- hw/sofirn/sp10-pro/anduril.h | 81 ++++++++++++++++++++++++ hw/sofirn/sp10-pro/cfg.h | 81 ------------------------ hw/sofirn/sp36-t1616/anduril.h | 37 +++++++++++ hw/sofirn/sp36-t1616/cfg.h | 37 ----------- hw/sofirn/sp36/anduril.h | 36 +++++++++++ hw/sofirn/sp36/cfg.h | 36 ----------- 18 files changed, 661 insertions(+), 661 deletions(-) create mode 100644 hw/sofirn/blf-lt1-t1616/anduril.h delete mode 100644 hw/sofirn/blf-lt1-t1616/cfg.h create mode 100644 hw/sofirn/blf-lt1/anduril.h delete mode 100644 hw/sofirn/blf-lt1/cfg.h create mode 100644 hw/sofirn/blf-q8-t1616/anduril.h delete mode 100644 hw/sofirn/blf-q8-t1616/cfg.h create mode 100644 hw/sofirn/blf-q8/anduril.h delete mode 100644 hw/sofirn/blf-q8/cfg.h create mode 100644 hw/sofirn/lt1s-pro/anduril.h delete mode 100644 hw/sofirn/lt1s-pro/cfg.h create mode 100644 hw/sofirn/sc21-pro/anduril.h delete mode 100644 hw/sofirn/sc21-pro/cfg.h create mode 100644 hw/sofirn/sp10-pro/anduril.h delete mode 100644 hw/sofirn/sp10-pro/cfg.h create mode 100644 hw/sofirn/sp36-t1616/anduril.h delete mode 100644 hw/sofirn/sp36-t1616/cfg.h create mode 100644 hw/sofirn/sp36/anduril.h delete mode 100644 hw/sofirn/sp36/cfg.h (limited to 'hw/sofirn') diff --git a/hw/sofirn/blf-lt1-t1616/anduril.h b/hw/sofirn/blf-lt1-t1616/anduril.h new file mode 100644 index 0000000..eea5ef5 --- /dev/null +++ b/hw/sofirn/blf-lt1-t1616/anduril.h @@ -0,0 +1,110 @@ +// BLF Lantern config options for Anduril using the Attiny1616 +// Copyright (C) 2021-2023 (original author TBD), Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +#define MODEL_NUMBER "0622" +#include "sofirn/blf-lt1-t1616/hwdef.h" +// ATTINY: 1616 + +// the button lights up +#define USE_INDICATOR_LED +// the button is visible while main LEDs are on +#define USE_INDICATOR_LED_WHILE_RAMPING +// off mode: low (1) +// lockout: blinking (3) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) + +// channel modes... +// CM_CH1, CM_CH2, CM_BOTH, CM_BLEND, CM_AUTO +#define DEFAULT_CHANNEL_MODE CM_AUTO +#define DEFAULT_BLINK_CHANNEL CM_BOTH + +#define CONFIG_WAITING_CHANNEL CM_BOTH +#define CONFIG_BLINK_CHANNEL CM_BOTH + +// blink numbers on the main LEDs by default (but allow user to change it) +#define DEFAULT_BLINK_CHANNEL CM_BOTH + +// how much to increase total brightness at middle tint +// (0 = 100% brightness, 64 = 200% brightness) +//#define TINT_RAMPING_CORRECTION 26 // prototype, 140% +#define TINT_RAMPING_CORRECTION 10 // production model, 115% + +#define RAMP_SIZE 150 +// delta-sigma modulated PWM (0b0HHHHHHHHLLLLLLL = 0, 8xHigh, 7xLow bits) +// (max is (255 << 7), because it's 8-bit PWM plus 7 bits of DSM) +// level_calc.py 3.333 1 150 7135 32 0.2 600 --pwm 32640 +#define PWM1_LEVELS 4,35,38,41,45,50,55,61,67,74,82,91,100,110,121,133,146,160,175,192,209,227,247,268,291,314,340,366,395,424,456,489,524,560,599,639,681,726,772,820,871,924,979,1036,1096,1158,1222,1289,1359,1431,1506,1584,1664,1747,1834,1923,2015,2111,2209,2311,2416,2524,2636,2751,2870,2992,3118,3247,3380,3518,3659,3803,3952,4105,4262,4423,4589,4759,4933,5111,5294,5482,5674,5871,6073,6279,6491,6707,6928,7155,7386,7623,7865,8113,8365,8624,8888,9157,9432,9713,10000,10292,10591,10895,11206,11523,11846,12175,12511,12853,13202,13557,13919,14287,14663,15045,15434,15830,16233,16644,17061,17486,17919,18358,18805,19260,19723,20193,20671,21156,21650,22152,22662,23180,23706,24241,24784,25335,25895,26464,27041,27627,28222,28826,29439,30060,30691,31332,31981,32640 + +#define DEFAULT_LEVEL 75 +#define MAX_1x7135 75 +#define HALFSPEED_LEVEL 0 // always use tint ramping correction +#define QUARTERSPEED_LEVEL 2 // quarter speed at level 1, full speed at 2+ +//#undef USE_DYNAMIC_UNDERCLOCKING // makes huge bumps in the ramp + +#define USE_SET_LEVEL_GRADUALLY + + +// override default ramp style +#undef RAMP_STYLE +#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped +// set floor and ceiling as far apart as possible +// because this lantern isn't overpowered +#define RAMP_SMOOTH_FLOOR 1 +#define RAMP_SMOOTH_CEIL 150 +#define RAMP_DISCRETE_FLOOR 1 +#define RAMP_DISCRETE_CEIL 150 +#define RAMP_DISCRETE_STEPS 7 + +// LT1 can handle heat well, so don't limit simple mode +#define SIMPLE_UI_FLOOR 10 +#define SIMPLE_UI_CEIL 150 +#define SIMPLE_UI_STEPS 5 + +// Allow 3C (or 6C) in Simple UI (toggle smooth or stepped ramping) +#define USE_SIMPLE_UI_RAMPING_TOGGLE + +// allow Aux Config and Strobe Modes in Simple UI +#define USE_EXTENDED_SIMPLE_UI + +#define USE_SOS_MODE +#define USE_SOS_MODE_IN_BLINKY_GROUP + +// the default of 26 looks a bit flat, so increase it +#define CANDLE_AMPLITUDE 40 + +#define USE_POLICE_COLOR_STROBE_MODE +#define POLICE_COLOR_STROBE_CH1 CM_CH1 +#define POLICE_COLOR_STROBE_CH2 CM_CH2 +// aux red + aux blue are the correct colors, but are dim +//#define POLICE_COLOR_STROBE_CH1 CM_AUXRED +//#define POLICE_COLOR_STROBE_CH2 CM_AUXBLU + +#undef TACTICAL_LEVELS +#define TACTICAL_LEVELS 120,30,(RAMP_SIZE+3) // high, low, police strobe + +// party strobe, tac strobe, police, lightning, candle, bike +#define DEFAULT_STROBE_CHANNELS CM_BOTH,CM_BOTH,CM_BOTH,CM_AUTO,CM_AUTO,CM_AUTO + +// the sensor (attiny1616) is nowhere near the emitters +// so thermal regulation can't work +#ifdef USE_THERMAL_REGULATION +#undef USE_THERMAL_REGULATION +#endif + +// don't blink while ramping +#ifdef BLINK_AT_RAMP_FLOOR +#undef BLINK_AT_RAMP_FLOOR +#endif +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE +#endif +// except the top... blink at the top +#ifndef BLINK_AT_RAMP_CEIL +#define BLINK_AT_RAMP_CEIL +#endif + +// for consistency with other models +#define USE_SOFT_FACTORY_RESET + diff --git a/hw/sofirn/blf-lt1-t1616/cfg.h b/hw/sofirn/blf-lt1-t1616/cfg.h deleted file mode 100644 index eea5ef5..0000000 --- a/hw/sofirn/blf-lt1-t1616/cfg.h +++ /dev/null @@ -1,110 +0,0 @@ -// BLF Lantern config options for Anduril using the Attiny1616 -// Copyright (C) 2021-2023 (original author TBD), Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#define MODEL_NUMBER "0622" -#include "sofirn/blf-lt1-t1616/hwdef.h" -// ATTINY: 1616 - -// the button lights up -#define USE_INDICATOR_LED -// the button is visible while main LEDs are on -#define USE_INDICATOR_LED_WHILE_RAMPING -// off mode: low (1) -// lockout: blinking (3) -#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) - -// channel modes... -// CM_CH1, CM_CH2, CM_BOTH, CM_BLEND, CM_AUTO -#define DEFAULT_CHANNEL_MODE CM_AUTO -#define DEFAULT_BLINK_CHANNEL CM_BOTH - -#define CONFIG_WAITING_CHANNEL CM_BOTH -#define CONFIG_BLINK_CHANNEL CM_BOTH - -// blink numbers on the main LEDs by default (but allow user to change it) -#define DEFAULT_BLINK_CHANNEL CM_BOTH - -// how much to increase total brightness at middle tint -// (0 = 100% brightness, 64 = 200% brightness) -//#define TINT_RAMPING_CORRECTION 26 // prototype, 140% -#define TINT_RAMPING_CORRECTION 10 // production model, 115% - -#define RAMP_SIZE 150 -// delta-sigma modulated PWM (0b0HHHHHHHHLLLLLLL = 0, 8xHigh, 7xLow bits) -// (max is (255 << 7), because it's 8-bit PWM plus 7 bits of DSM) -// level_calc.py 3.333 1 150 7135 32 0.2 600 --pwm 32640 -#define PWM1_LEVELS 4,35,38,41,45,50,55,61,67,74,82,91,100,110,121,133,146,160,175,192,209,227,247,268,291,314,340,366,395,424,456,489,524,560,599,639,681,726,772,820,871,924,979,1036,1096,1158,1222,1289,1359,1431,1506,1584,1664,1747,1834,1923,2015,2111,2209,2311,2416,2524,2636,2751,2870,2992,3118,3247,3380,3518,3659,3803,3952,4105,4262,4423,4589,4759,4933,5111,5294,5482,5674,5871,6073,6279,6491,6707,6928,7155,7386,7623,7865,8113,8365,8624,8888,9157,9432,9713,10000,10292,10591,10895,11206,11523,11846,12175,12511,12853,13202,13557,13919,14287,14663,15045,15434,15830,16233,16644,17061,17486,17919,18358,18805,19260,19723,20193,20671,21156,21650,22152,22662,23180,23706,24241,24784,25335,25895,26464,27041,27627,28222,28826,29439,30060,30691,31332,31981,32640 - -#define DEFAULT_LEVEL 75 -#define MAX_1x7135 75 -#define HALFSPEED_LEVEL 0 // always use tint ramping correction -#define QUARTERSPEED_LEVEL 2 // quarter speed at level 1, full speed at 2+ -//#undef USE_DYNAMIC_UNDERCLOCKING // makes huge bumps in the ramp - -#define USE_SET_LEVEL_GRADUALLY - - -// override default ramp style -#undef RAMP_STYLE -#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped -// set floor and ceiling as far apart as possible -// because this lantern isn't overpowered -#define RAMP_SMOOTH_FLOOR 1 -#define RAMP_SMOOTH_CEIL 150 -#define RAMP_DISCRETE_FLOOR 1 -#define RAMP_DISCRETE_CEIL 150 -#define RAMP_DISCRETE_STEPS 7 - -// LT1 can handle heat well, so don't limit simple mode -#define SIMPLE_UI_FLOOR 10 -#define SIMPLE_UI_CEIL 150 -#define SIMPLE_UI_STEPS 5 - -// Allow 3C (or 6C) in Simple UI (toggle smooth or stepped ramping) -#define USE_SIMPLE_UI_RAMPING_TOGGLE - -// allow Aux Config and Strobe Modes in Simple UI -#define USE_EXTENDED_SIMPLE_UI - -#define USE_SOS_MODE -#define USE_SOS_MODE_IN_BLINKY_GROUP - -// the default of 26 looks a bit flat, so increase it -#define CANDLE_AMPLITUDE 40 - -#define USE_POLICE_COLOR_STROBE_MODE -#define POLICE_COLOR_STROBE_CH1 CM_CH1 -#define POLICE_COLOR_STROBE_CH2 CM_CH2 -// aux red + aux blue are the correct colors, but are dim -//#define POLICE_COLOR_STROBE_CH1 CM_AUXRED -//#define POLICE_COLOR_STROBE_CH2 CM_AUXBLU - -#undef TACTICAL_LEVELS -#define TACTICAL_LEVELS 120,30,(RAMP_SIZE+3) // high, low, police strobe - -// party strobe, tac strobe, police, lightning, candle, bike -#define DEFAULT_STROBE_CHANNELS CM_BOTH,CM_BOTH,CM_BOTH,CM_AUTO,CM_AUTO,CM_AUTO - -// the sensor (attiny1616) is nowhere near the emitters -// so thermal regulation can't work -#ifdef USE_THERMAL_REGULATION -#undef USE_THERMAL_REGULATION -#endif - -// don't blink while ramping -#ifdef BLINK_AT_RAMP_FLOOR -#undef BLINK_AT_RAMP_FLOOR -#endif -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif -// except the top... blink at the top -#ifndef BLINK_AT_RAMP_CEIL -#define BLINK_AT_RAMP_CEIL -#endif - -// for consistency with other models -#define USE_SOFT_FACTORY_RESET - diff --git a/hw/sofirn/blf-lt1/anduril.h b/hw/sofirn/blf-lt1/anduril.h new file mode 100644 index 0000000..e60c9f7 --- /dev/null +++ b/hw/sofirn/blf-lt1/anduril.h @@ -0,0 +1,105 @@ +// BLF Lantern config options for Anduril +// Copyright (C) 2018-2023 Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +#define MODEL_NUMBER "0621" +#include "sofirn/blf-lt1/hwdef.h" +// ATTINY: 85 + +// the button lights up +#define USE_INDICATOR_LED +// the button is visible while main LEDs are on +#define USE_INDICATOR_LED_WHILE_RAMPING +// off mode: low (1) +// lockout: blinking (3) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) + +// channel modes... +// CM_CH1, CM_CH2, CM_BOTH, CM_BLEND, CM_AUTO +#define DEFAULT_CHANNEL_MODE CM_AUTO +//#define DEFAULT_BLINK_CHANNEL CM_BOTH // takes too much space + +// how much to increase total brightness at middle tint +// (0 = 100% brightness, 64 = 200% brightness) +//#define TINT_RAMPING_CORRECTION 26 // prototype, 140% +//#define TINT_RAMPING_CORRECTION 10 // production model, 115% +#define TINT_RAMPING_CORRECTION 0 // none + +#define RAMP_SIZE 150 +// delta-sigma modulated PWM (0b0HHHHHHHHLLLLLLL = 0, 8xHigh, 7xLow bits) +// (max is (255 << 7), because it's 8-bit PWM plus 7 bits of DSM) +// level_calc.py 3.333 1 150 7135 32 0.2 600 --pwm 32640 +#define PWM1_LEVELS 32,35,38,41,45,50,55,61,67,74,82,91,100,110,121,133,146,160,175,192,209,227,247,268,291,314,340,366,395,424,456,489,524,560,599,639,681,726,772,820,871,924,979,1036,1096,1158,1222,1289,1359,1431,1506,1584,1664,1747,1834,1923,2015,2111,2209,2311,2416,2524,2636,2751,2870,2992,3118,3247,3380,3518,3659,3803,3952,4105,4262,4423,4589,4759,4933,5111,5294,5482,5674,5871,6073,6279,6491,6707,6928,7155,7386,7623,7865,8113,8365,8624,8888,9157,9432,9713,10000,10292,10591,10895,11206,11523,11846,12175,12511,12853,13202,13557,13919,14287,14663,15045,15434,15830,16233,16644,17061,17486,17919,18358,18805,19260,19723,20193,20671,21156,21650,22152,22662,23180,23706,24241,24784,25335,25895,26464,27041,27627,28222,28826,29439,30060,30691,31332,31981,32640 + +#define DEFAULT_LEVEL 75 +#define MAX_1x7135 75 +#define HALFSPEED_LEVEL 44 +#define QUARTERSPEED_LEVEL 34 +#undef USE_DYNAMIC_UNDERCLOCKING // makes huge bumps in the ramp + +#define USE_SMOOTH_STEPS +//#define USE_SET_LEVEL_GRADUALLY + +// the default of 26 looks a bit flat, so increase it +#define CANDLE_AMPLITUDE 40 + +// override default ramp style +#undef RAMP_STYLE +#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped +// set floor and ceiling as far apart as possible +// because this lantern isn't overpowered +#define RAMP_SMOOTH_FLOOR 1 +#define RAMP_SMOOTH_CEIL 150 +#define RAMP_DISCRETE_FLOOR 1 +#define RAMP_DISCRETE_CEIL 150 +#define RAMP_DISCRETE_STEPS 7 + +// LT1 can handle heat well, so don't limit simple mode +#define SIMPLE_UI_FLOOR 10 +#define SIMPLE_UI_CEIL 150 +#define SIMPLE_UI_STEPS 5 + +// Allow 3C in Simple UI for switching between smooth and stepped ramping +#define USE_SIMPLE_UI_RAMPING_TOGGLE +#define USE_EXTENDED_SIMPLE_UI + +// also at Sofirn's request, enable 2 click turbo (Anduril 1 style) +#define DEFAULT_2C_STYLE 1 + + +// the sensor (attiny85) is nowhere near the emitters +// so thermal regulation can't work +#ifdef USE_THERMAL_REGULATION +#undef USE_THERMAL_REGULATION +#endif + +// don't blink while ramping +#ifdef BLINK_AT_RAMP_FLOOR +#undef BLINK_AT_RAMP_FLOOR +#endif +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE +#endif +#ifdef BLINK_AT_RAMP_CEIL +#undef BLINK_AT_RAMP_CEIL +#endif + +// too big, turn off extra features +//#undef USE_STEPPED_TINT_RAMPING +#undef USE_MOMENTARY_MODE +#undef USE_TACTICAL_MODE +#undef USE_SOS_MODE +//#undef USE_SIMPLE_UI +//#undef USE_BEACON_MODE +//#undef USE_RAMP_SPEED_CONFIG +#undef USE_RAMP_AFTER_MOON_CONFIG +#undef USE_2C_STYLE_CONFIG +#undef USE_VOLTAGE_CORRECTION +//#undef USE_CHANNEL_PER_STROBE +// party strobe, tac strobe, lightning, candle, bike +#define DEFAULT_STROBE_CHANNELS CM_BOTH,CM_BOTH,CM_AUTO,CM_AUTO,CM_AUTO + +// for consistency with other models +#define USE_SOFT_FACTORY_RESET + diff --git a/hw/sofirn/blf-lt1/cfg.h b/hw/sofirn/blf-lt1/cfg.h deleted file mode 100644 index e60c9f7..0000000 --- a/hw/sofirn/blf-lt1/cfg.h +++ /dev/null @@ -1,105 +0,0 @@ -// BLF Lantern config options for Anduril -// Copyright (C) 2018-2023 Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#define MODEL_NUMBER "0621" -#include "sofirn/blf-lt1/hwdef.h" -// ATTINY: 85 - -// the button lights up -#define USE_INDICATOR_LED -// the button is visible while main LEDs are on -#define USE_INDICATOR_LED_WHILE_RAMPING -// off mode: low (1) -// lockout: blinking (3) -#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) - -// channel modes... -// CM_CH1, CM_CH2, CM_BOTH, CM_BLEND, CM_AUTO -#define DEFAULT_CHANNEL_MODE CM_AUTO -//#define DEFAULT_BLINK_CHANNEL CM_BOTH // takes too much space - -// how much to increase total brightness at middle tint -// (0 = 100% brightness, 64 = 200% brightness) -//#define TINT_RAMPING_CORRECTION 26 // prototype, 140% -//#define TINT_RAMPING_CORRECTION 10 // production model, 115% -#define TINT_RAMPING_CORRECTION 0 // none - -#define RAMP_SIZE 150 -// delta-sigma modulated PWM (0b0HHHHHHHHLLLLLLL = 0, 8xHigh, 7xLow bits) -// (max is (255 << 7), because it's 8-bit PWM plus 7 bits of DSM) -// level_calc.py 3.333 1 150 7135 32 0.2 600 --pwm 32640 -#define PWM1_LEVELS 32,35,38,41,45,50,55,61,67,74,82,91,100,110,121,133,146,160,175,192,209,227,247,268,291,314,340,366,395,424,456,489,524,560,599,639,681,726,772,820,871,924,979,1036,1096,1158,1222,1289,1359,1431,1506,1584,1664,1747,1834,1923,2015,2111,2209,2311,2416,2524,2636,2751,2870,2992,3118,3247,3380,3518,3659,3803,3952,4105,4262,4423,4589,4759,4933,5111,5294,5482,5674,5871,6073,6279,6491,6707,6928,7155,7386,7623,7865,8113,8365,8624,8888,9157,9432,9713,10000,10292,10591,10895,11206,11523,11846,12175,12511,12853,13202,13557,13919,14287,14663,15045,15434,15830,16233,16644,17061,17486,17919,18358,18805,19260,19723,20193,20671,21156,21650,22152,22662,23180,23706,24241,24784,25335,25895,26464,27041,27627,28222,28826,29439,30060,30691,31332,31981,32640 - -#define DEFAULT_LEVEL 75 -#define MAX_1x7135 75 -#define HALFSPEED_LEVEL 44 -#define QUARTERSPEED_LEVEL 34 -#undef USE_DYNAMIC_UNDERCLOCKING // makes huge bumps in the ramp - -#define USE_SMOOTH_STEPS -//#define USE_SET_LEVEL_GRADUALLY - -// the default of 26 looks a bit flat, so increase it -#define CANDLE_AMPLITUDE 40 - -// override default ramp style -#undef RAMP_STYLE -#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped -// set floor and ceiling as far apart as possible -// because this lantern isn't overpowered -#define RAMP_SMOOTH_FLOOR 1 -#define RAMP_SMOOTH_CEIL 150 -#define RAMP_DISCRETE_FLOOR 1 -#define RAMP_DISCRETE_CEIL 150 -#define RAMP_DISCRETE_STEPS 7 - -// LT1 can handle heat well, so don't limit simple mode -#define SIMPLE_UI_FLOOR 10 -#define SIMPLE_UI_CEIL 150 -#define SIMPLE_UI_STEPS 5 - -// Allow 3C in Simple UI for switching between smooth and stepped ramping -#define USE_SIMPLE_UI_RAMPING_TOGGLE -#define USE_EXTENDED_SIMPLE_UI - -// also at Sofirn's request, enable 2 click turbo (Anduril 1 style) -#define DEFAULT_2C_STYLE 1 - - -// the sensor (attiny85) is nowhere near the emitters -// so thermal regulation can't work -#ifdef USE_THERMAL_REGULATION -#undef USE_THERMAL_REGULATION -#endif - -// don't blink while ramping -#ifdef BLINK_AT_RAMP_FLOOR -#undef BLINK_AT_RAMP_FLOOR -#endif -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif -#ifdef BLINK_AT_RAMP_CEIL -#undef BLINK_AT_RAMP_CEIL -#endif - -// too big, turn off extra features -//#undef USE_STEPPED_TINT_RAMPING -#undef USE_MOMENTARY_MODE -#undef USE_TACTICAL_MODE -#undef USE_SOS_MODE -//#undef USE_SIMPLE_UI -//#undef USE_BEACON_MODE -//#undef USE_RAMP_SPEED_CONFIG -#undef USE_RAMP_AFTER_MOON_CONFIG -#undef USE_2C_STYLE_CONFIG -#undef USE_VOLTAGE_CORRECTION -//#undef USE_CHANNEL_PER_STROBE -// party strobe, tac strobe, lightning, candle, bike -#define DEFAULT_STROBE_CHANNELS CM_BOTH,CM_BOTH,CM_AUTO,CM_AUTO,CM_AUTO - -// for consistency with other models -#define USE_SOFT_FACTORY_RESET - diff --git a/hw/sofirn/blf-q8-t1616/anduril.h b/hw/sofirn/blf-q8-t1616/anduril.h new file mode 100644 index 0000000..dca3aa8 --- /dev/null +++ b/hw/sofirn/blf-q8-t1616/anduril.h @@ -0,0 +1,82 @@ +// BLF Q8 config options for Anduril using the Attiny1616 +// Copyright (C) 2021-2023 gchart, Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +#define MODEL_NUMBER "0613" +#include "sofirn/blf-q8-t1616/hwdef.h" +#include "wurkkos/cfg.h" // Sofirn lights are closely related to Wurkkos +// ATTINY: 1616 + +// the button lights up +#define USE_INDICATOR_LED +// the button is visible while main LEDs are on +#define USE_INDICATOR_LED_WHILE_RAMPING +// off mode: low (1) +// lockout: blinking (3) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) + +// copied from Wurkkos TS25 ramp +#define RAMP_SIZE 150 +// 7135 at 75/150 +// level_calc.py 5.7895 2 150 7135 1 0.1 130 FET 1 10 3000 --pwm dyn:74:4096:255:3 +// (with some manual tweaks) +#define PWM1_LEVELS 1,1,2,3,3,4,5,6,7,8,9,11,12,13,15,16,18,19,21,23,26,27,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,71,74,76,78,80,82,85,87,90,93,96,100,103,107,112,116,122,127,133,140,147,154,163,171,182,192,203,215,228,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,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 +// non-zero part of FET channel calculated with: +// level_calc.py 3 1 75 7135 1 200 3000 +// (FIXME? there's a visible bump when the FET kicks in, even with just 1/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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,6,7,8,10,11,13,14,16,17,19,21,22,24,26,28,30,32,34,37,39,41,44,46,48,51,54,56,59,62,65,68,71,74,77,81,84,87,91,94,98,102,106,110,114,118,122,126,130,135,139,144,148,153,158,163,168,173,178,184,189,195,200,206,212,218,224,230,236,242,248,255 +#define PWM_TOPS 4095,2701,3200,3586,2518,2778,2834,2795,2705,2587,2455,2582,2412,2247,2256,2091,2062,1907,1860,1802,1737,1605,1542,1477,1412,1347,1284,1222,1162,1105,1050,997,946,898,853,810,768,730,693,658,625,594,564,536,503,485,462,439,418,398,384,366,353,340,327,319,307,298,292,284,280,273,269,266,263,260,258,256,256,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 + +#define MAX_1x7135 75 +#define DEFAULT_LEVEL 50 +#define MIN_THERM_STEPDOWN 60 +#define HALFSPEED_LEVEL 20 +#define QUARTERSPEED_LEVEL 5 + +#define RAMP_SMOOTH_FLOOR 1 +#define RAMP_SMOOTH_CEIL 150 +// 20 38 56 [75] 93 111 130 +#define RAMP_DISCRETE_FLOOR 20 +#define RAMP_DISCRETE_CEIL 130 +#define RAMP_DISCRETE_STEPS 7 + +// at Sofirn's request, use max (150) for the Simple UI ceiling +#define SIMPLE_UI_FLOOR 1 +#define SIMPLE_UI_CEIL 150 +#define SIMPLE_UI_STEPS 5 + +// also at Sofirn's request, enable 2 click turbo (Anduril 1 style) +#define DEFAULT_2C_STYLE 1 + +// enable SOS in the blinkies group +#define USE_SOS_MODE +#define USE_SOS_MODE_IN_BLINKY_GROUP + +// Allow 3C in Simple UI for switching between smooth and stepped ramping +#define USE_SIMPLE_UI_RAMPING_TOGGLE + +// allow Aux Config and Strobe Modes in Simple UI +#define USE_EXTENDED_SIMPLE_UI + +// stop panicking at ~75% power or ~3000 lm, this light has high thermal mass +#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high + +// show each channel while it scroll by in the menu +#define USE_CONFIG_COLORS + +// blink numbers on the aux LEDs by default +#define DEFAULT_BLINK_CHANNEL CM_AUX + +// the default of 26 looks a bit rough, so increase it to make it smoother +#define CANDLE_AMPLITUDE 33 + +// don't blink during the ramp; the button LED brightness is sufficient +// to indicate which power channel(s) are being used +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE +#endif + +// enable factory reset on 13H without loosening tailcap (required) +#define USE_SOFT_FACTORY_RESET + diff --git a/hw/sofirn/blf-q8-t1616/cfg.h b/hw/sofirn/blf-q8-t1616/cfg.h deleted file mode 100644 index dca3aa8..0000000 --- a/hw/sofirn/blf-q8-t1616/cfg.h +++ /dev/null @@ -1,82 +0,0 @@ -// BLF Q8 config options for Anduril using the Attiny1616 -// Copyright (C) 2021-2023 gchart, Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#define MODEL_NUMBER "0613" -#include "sofirn/blf-q8-t1616/hwdef.h" -#include "wurkkos/cfg.h" // Sofirn lights are closely related to Wurkkos -// ATTINY: 1616 - -// the button lights up -#define USE_INDICATOR_LED -// the button is visible while main LEDs are on -#define USE_INDICATOR_LED_WHILE_RAMPING -// off mode: low (1) -// lockout: blinking (3) -#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) - -// copied from Wurkkos TS25 ramp -#define RAMP_SIZE 150 -// 7135 at 75/150 -// level_calc.py 5.7895 2 150 7135 1 0.1 130 FET 1 10 3000 --pwm dyn:74:4096:255:3 -// (with some manual tweaks) -#define PWM1_LEVELS 1,1,2,3,3,4,5,6,7,8,9,11,12,13,15,16,18,19,21,23,26,27,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,71,74,76,78,80,82,85,87,90,93,96,100,103,107,112,116,122,127,133,140,147,154,163,171,182,192,203,215,228,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,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 -// non-zero part of FET channel calculated with: -// level_calc.py 3 1 75 7135 1 200 3000 -// (FIXME? there's a visible bump when the FET kicks in, even with just 1/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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,6,7,8,10,11,13,14,16,17,19,21,22,24,26,28,30,32,34,37,39,41,44,46,48,51,54,56,59,62,65,68,71,74,77,81,84,87,91,94,98,102,106,110,114,118,122,126,130,135,139,144,148,153,158,163,168,173,178,184,189,195,200,206,212,218,224,230,236,242,248,255 -#define PWM_TOPS 4095,2701,3200,3586,2518,2778,2834,2795,2705,2587,2455,2582,2412,2247,2256,2091,2062,1907,1860,1802,1737,1605,1542,1477,1412,1347,1284,1222,1162,1105,1050,997,946,898,853,810,768,730,693,658,625,594,564,536,503,485,462,439,418,398,384,366,353,340,327,319,307,298,292,284,280,273,269,266,263,260,258,256,256,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 - -#define MAX_1x7135 75 -#define DEFAULT_LEVEL 50 -#define MIN_THERM_STEPDOWN 60 -#define HALFSPEED_LEVEL 20 -#define QUARTERSPEED_LEVEL 5 - -#define RAMP_SMOOTH_FLOOR 1 -#define RAMP_SMOOTH_CEIL 150 -// 20 38 56 [75] 93 111 130 -#define RAMP_DISCRETE_FLOOR 20 -#define RAMP_DISCRETE_CEIL 130 -#define RAMP_DISCRETE_STEPS 7 - -// at Sofirn's request, use max (150) for the Simple UI ceiling -#define SIMPLE_UI_FLOOR 1 -#define SIMPLE_UI_CEIL 150 -#define SIMPLE_UI_STEPS 5 - -// also at Sofirn's request, enable 2 click turbo (Anduril 1 style) -#define DEFAULT_2C_STYLE 1 - -// enable SOS in the blinkies group -#define USE_SOS_MODE -#define USE_SOS_MODE_IN_BLINKY_GROUP - -// Allow 3C in Simple UI for switching between smooth and stepped ramping -#define USE_SIMPLE_UI_RAMPING_TOGGLE - -// allow Aux Config and Strobe Modes in Simple UI -#define USE_EXTENDED_SIMPLE_UI - -// stop panicking at ~75% power or ~3000 lm, this light has high thermal mass -#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high - -// show each channel while it scroll by in the menu -#define USE_CONFIG_COLORS - -// blink numbers on the aux LEDs by default -#define DEFAULT_BLINK_CHANNEL CM_AUX - -// the default of 26 looks a bit rough, so increase it to make it smoother -#define CANDLE_AMPLITUDE 33 - -// don't blink during the ramp; the button LED brightness is sufficient -// to indicate which power channel(s) are being used -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif - -// enable factory reset on 13H without loosening tailcap (required) -#define USE_SOFT_FACTORY_RESET - diff --git a/hw/sofirn/blf-q8/anduril.h b/hw/sofirn/blf-q8/anduril.h new file mode 100644 index 0000000..622d885 --- /dev/null +++ b/hw/sofirn/blf-q8/anduril.h @@ -0,0 +1,71 @@ +// BLF Q8 config options for Anduril +// Copyright (C) 2018-2023 Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +#define MODEL_NUMBER "0611" +#include "sofirn/blf-q8/hwdef.h" + +#define RAMP_SIZE 150 + +// the button lights up +#define USE_INDICATOR_LED +// the button is visible while main LEDs are on +#define USE_INDICATOR_LED_WHILE_RAMPING +// off mode: high (2) +// lockout: blinking (3) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) + +// copied from Emisar D4 ramp +// ../../bin/level_calc.py 1 65 7135 1 0.8 150 +// ... mixed with this: +// ../../bin/level_calc.py 2 150 7135 4 0.33 150 FET 1 10 1500 +#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,0,1,3,4,5,7,8,9,11,12,14,15,17,19,20,22,24,25,27,29,31,33,35,37,39,41,43,45,48,50,52,55,57,59,62,64,67,70,72,75,78,81,84,87,90,93,96,99,102,105,109,112,115,119,122,126,129,133,137,141,144,148,152,156,160,165,169,173,177,182,186,191,195,200,205,209,214,219,224,229,234,239,244,250,255 + +#define MAX_1x7135 65 +#define DEFAULT_LEVEL 65 +#define HALFSPEED_LEVEL 14 +#define QUARTERSPEED_LEVEL 5 + +#define RAMP_SMOOTH_FLOOR 1 +#define RAMP_SMOOTH_CEIL 120 +// 10 28 46 [65] 83 101 120 +#define RAMP_DISCRETE_FLOOR 10 +#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL +#define RAMP_DISCRETE_STEPS 7 + +// at Sofirn's request, use max (150) for the Simple UI ceiling +#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR +#define SIMPLE_UI_CEIL 150 +#define SIMPLE_UI_STEPS 5 + +// also at Sofirn's request, enable 2 click turbo (Anduril 1 style) +#define DEFAULT_2C_STYLE 1 + +// enable SOS in the blinkies group +#define USE_SOS_MODE +#define USE_SOS_MODE_IN_BLINKY_GROUP + +// Allow 3C in Simple UI for switching between smooth and stepped ramping +#define USE_SIMPLE_UI_RAMPING_TOGGLE +#define USE_EXTENDED_SIMPLE_UI + +// stop panicking at ~75% power or ~3000 lm, this light has high thermal mass +#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high + +// don't blink mid-ramp +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE +#endif + +#define USE_SMOOTH_STEPS + +// too big, remove stuff to make room +#undef USE_SOS_MODE +//#undef USE_RAMP_AFTER_MOON_CONFIG +//#undef USE_RAMP_SPEED_CONFIG +//#undef USE_VOLTAGE_CORRECTION +//#undef USE_2C_STYLE_CONFIG +//#undef USE_TACTICAL_STROBE_MODE +#undef USE_TACTICAL_MODE diff --git a/hw/sofirn/blf-q8/cfg.h b/hw/sofirn/blf-q8/cfg.h deleted file mode 100644 index 622d885..0000000 --- a/hw/sofirn/blf-q8/cfg.h +++ /dev/null @@ -1,71 +0,0 @@ -// BLF Q8 config options for Anduril -// Copyright (C) 2018-2023 Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#define MODEL_NUMBER "0611" -#include "sofirn/blf-q8/hwdef.h" - -#define RAMP_SIZE 150 - -// the button lights up -#define USE_INDICATOR_LED -// the button is visible while main LEDs are on -#define USE_INDICATOR_LED_WHILE_RAMPING -// off mode: high (2) -// lockout: blinking (3) -#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2) - -// copied from Emisar D4 ramp -// ../../bin/level_calc.py 1 65 7135 1 0.8 150 -// ... mixed with this: -// ../../bin/level_calc.py 2 150 7135 4 0.33 150 FET 1 10 1500 -#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,0,1,3,4,5,7,8,9,11,12,14,15,17,19,20,22,24,25,27,29,31,33,35,37,39,41,43,45,48,50,52,55,57,59,62,64,67,70,72,75,78,81,84,87,90,93,96,99,102,105,109,112,115,119,122,126,129,133,137,141,144,148,152,156,160,165,169,173,177,182,186,191,195,200,205,209,214,219,224,229,234,239,244,250,255 - -#define MAX_1x7135 65 -#define DEFAULT_LEVEL 65 -#define HALFSPEED_LEVEL 14 -#define QUARTERSPEED_LEVEL 5 - -#define RAMP_SMOOTH_FLOOR 1 -#define RAMP_SMOOTH_CEIL 120 -// 10 28 46 [65] 83 101 120 -#define RAMP_DISCRETE_FLOOR 10 -#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL -#define RAMP_DISCRETE_STEPS 7 - -// at Sofirn's request, use max (150) for the Simple UI ceiling -#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR -#define SIMPLE_UI_CEIL 150 -#define SIMPLE_UI_STEPS 5 - -// also at Sofirn's request, enable 2 click turbo (Anduril 1 style) -#define DEFAULT_2C_STYLE 1 - -// enable SOS in the blinkies group -#define USE_SOS_MODE -#define USE_SOS_MODE_IN_BLINKY_GROUP - -// Allow 3C in Simple UI for switching between smooth and stepped ramping -#define USE_SIMPLE_UI_RAMPING_TOGGLE -#define USE_EXTENDED_SIMPLE_UI - -// stop panicking at ~75% power or ~3000 lm, this light has high thermal mass -#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high - -// don't blink mid-ramp -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif - -#define USE_SMOOTH_STEPS - -// too big, remove stuff to make room -#undef USE_SOS_MODE -//#undef USE_RAMP_AFTER_MOON_CONFIG -//#undef USE_RAMP_SPEED_CONFIG -//#undef USE_VOLTAGE_CORRECTION -//#undef USE_2C_STYLE_CONFIG -//#undef USE_TACTICAL_STROBE_MODE -#undef USE_TACTICAL_MODE diff --git a/hw/sofirn/lt1s-pro/anduril.h b/hw/sofirn/lt1s-pro/anduril.h new file mode 100644 index 0000000..c6a0f3e --- /dev/null +++ b/hw/sofirn/lt1s-pro/anduril.h @@ -0,0 +1,125 @@ +// Sofirn LT1S Pro config file for Anduril +// Copyright (C) 2022-2023 (FIXME) +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +#define MODEL_NUMBER "0623" +#include "sofirn/lt1s-pro/hwdef.h" +// ATTINY: 1616 + +// off mode: low (1) +// lockout: blinking (3) +// Standby power usage: +// - aux high: 6.9 mA (30 days) +// - aux low: 0.16 mA (3.5 years) +// - red moon: 2.17 mA (96 days) +// - white moon: 1.47 mA (141 days) +// Low mode isn't bright enough to be useful on this light, +// but at least it doesn't drain the battery 3X faster than moon mode. +// (it seriously would be more practical to just use moon instead) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) + +// channel modes... +// CM_WHITE, CM_AUTO2, CM_AUTO3, CM_RED, CM_WHITE_RED +#define DEFAULT_CHANNEL_MODE CM_AUTO3 + +#define FACTORY_RESET_WARN_CHANNEL CM_RED +#define FACTORY_RESET_SUCCESS_CHANNEL CM_WHITE + +#define CONFIG_WAITING_CHANNEL CM_RED +#define CONFIG_BLINK_CHANNEL CM_WHITE + +// blink numbers on the main LEDs by default (but allow user to change it) +#define DEFAULT_BLINK_CHANNEL CM_RED + +// how much to increase total brightness at middle tint +// (0 = 100% brightness, 64 = 200% brightness) +// seems unnecessary on this light +#define TINT_RAMPING_CORRECTION 0 + +#define RAMP_SIZE 150 +// use dynamic PWM instead of plain 8-bit +// (so we can get lower lows and a smoother ramp) +// (also, red LEDs use a QX7138 chip which has max PWM speed of 10 kHz, +// and it behaves erratically at full speed, +// so PWM here is 576 clock cycles long to keep the speed low enough) +// +// This first ramp seems a bit too low: 0.2 / 1.9 / 10 / 37 / 109 / 272 / 600 lm +// level_calc.py 5.99 1 150 7135 1 0.2 600 --pwm dyn:77:16383:575:3 +//#define PWM_LEVELS 1,1,2,2,3,4,4,5,6,6,7,8,9,9,10,11,11,12,13,13,14,15,15,16,16,17,18,18,19,19,19,20,20,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,24,24,24,25,26,26,27,28,29,30,32,33,34,36,38,40,42,44,46,48,50,52,55,57,59,62,65,68,70,73,77,80,83,86,90,94,97,101,105,110,114,118,123,128,133,138,143,148,154,160,166,172,178,185,191,198,205,213,220,228,236,244,252,261,270,279,289,298,308,319,329,340,351,363,374,386,399,411,424,438,452,466,480,495,510,526,542,558,575 +//#define PWM_TOPS 16383,10869,13246,8043,11458,12772,10093,11043,11450,9664,9991,10091,10048,8868,8838,8730,7814,7724,7589,6864,6748,6604,6024,5899,5398,5287,5159,4754,4638,4287,3963,3876,3594,3511,3265,3038,2829,2770,2586,2417,2260,2115,1981,1857,1742,1636,1537,1445,1360,1281,1207,1138,1073,1013,957,904,855,848,803,760,720,714,677,643,637,630,599,592,585,577,569,579,570,560,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575 +// +// This ramp is a bit higher: 0.2 / 3 / 19 / 61 / 152 / 320 / 600 lm +// level_calc.py 4.001 1 150 7135 1 0.2 600 --pwm dyn:78:16383:575:3.333 +#define PWM1_LEVELS 1,1,2,4,5,6,7,8,9,10,12,13,14,15,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,33,34,34,35,35,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,37,37,38,38,39,40,40,41,43,44,45,47,48,50,52,54,56,59,62,64,67,69,72,75,78,81,84,87,90,94,97,101,104,108,112,116,120,124,128,133,137,142,147,151,156,161,167,172,177,183,189,194,200,206,213,219,226,232,239,246,253,260,268,275,283,291,299,307,316,324,333,342,351,361,370,380,390,400,410,420,431,442,453,464,476,487,499,511,523,536,549,562,575 +#define PWM_TOPS 16383,8174,7823,14429,13603,12806,12046,11328,10652,10017,10402,9742,9134,8575,8615,8089,7605,7536,7093,6684,6307,5959,5636,5337,5060,4802,4562,4337,4127,3929,3633,3468,3216,3077,2862,2744,2559,2390,2234,2091,1960,1838,1727,1623,1528,1439,1357,1280,1209,1143,1081,1024,970,919,872,828,787,770,732,716,682,668,654,624,611,613,600,587,587,574,573,571,569,566,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575 +// TODO? 200% power at top of ramp on white blend mode +// 2nd table handles "200% power" turbo +//#define PWM2_LEVELS ... +// tops for PWM2 +//#define PWM3_LEVELS ... +#define MAX_1x7135 75 +#define MIN_THERM_STEPDOWN 75 // should be above highest dyn_pwm level +#define HALFSPEED_LEVEL 12 +#define QUARTERSPEED_LEVEL 5 + +// the default of 26 looks a bit flat, so increase it +#define CANDLE_AMPLITUDE 40 + +// override default ramp style +#undef RAMP_STYLE +#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped +// set floor and ceiling as far apart as possible +// because this lantern isn't overpowered +#define RAMP_SMOOTH_FLOOR 1 +#define RAMP_SMOOTH_CEIL 150 +//#define RAMP_DISCRETE_FLOOR 17 // 17 50 83 116 150 +#define RAMP_DISCRETE_FLOOR 1 // 1 25 50 75 100 125 150 +#define RAMP_DISCRETE_CEIL 150 +#define RAMP_DISCRETE_STEPS 7 + +// LT1S can handle heat well, so don't limit simple mode +//#define SIMPLE_UI_FLOOR 10 // 10 45 80 115 150 +#define SIMPLE_UI_FLOOR 1 +#define SIMPLE_UI_CEIL 150 +#define SIMPLE_UI_STEPS 7 + +// Allow 3C (or 6C) in Simple UI (toggle smooth or stepped ramping) +#define USE_SIMPLE_UI_RAMPING_TOGGLE + +// allow Aux Config and Strobe Modes in Simple UI +#define USE_EXTENDED_SIMPLE_UI + +// turn on at med-low brightness by default (level 50/150, or ramp step 3/7) +// (also sets lockout mode 2H to a useful level) +#define DEFAULT_MANUAL_MEMORY 50 +// reset to default after being off for 10 minutes +#define DEFAULT_MANUAL_MEMORY_TIMER 10 + +// enable 2 click turbo (Anduril 1 style) +#define DEFAULT_2C_STYLE 1 + +#define USE_SOS_MODE +#define USE_SOS_MODE_IN_BLINKY_GROUP + +#define USE_POLICE_COLOR_STROBE_MODE +#define POLICE_COLOR_STROBE_CH1 CM_RED +#define POLICE_COLOR_STROBE_CH2 CM_WHITE + +#undef TACTICAL_LEVELS +#define TACTICAL_LEVELS 120,30,(RAMP_SIZE+3) // high, low, police strobe + +// don't blink while ramping +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE +#endif +#ifdef BLINK_AT_RAMP_FLOOR +#undef BLINK_AT_RAMP_FLOOR +#endif +#ifdef BLINK_AT_RAMP_CEIL +#undef BLINK_AT_RAMP_CEIL +#endif +// without this, it's really hard to tell when ramping up stops +#define BLINK_AT_RAMP_CEIL + +#define USE_SOFT_FACTORY_RESET diff --git a/hw/sofirn/lt1s-pro/cfg.h b/hw/sofirn/lt1s-pro/cfg.h deleted file mode 100644 index c6a0f3e..0000000 --- a/hw/sofirn/lt1s-pro/cfg.h +++ /dev/null @@ -1,125 +0,0 @@ -// Sofirn LT1S Pro config file for Anduril -// Copyright (C) 2022-2023 (FIXME) -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#define MODEL_NUMBER "0623" -#include "sofirn/lt1s-pro/hwdef.h" -// ATTINY: 1616 - -// off mode: low (1) -// lockout: blinking (3) -// Standby power usage: -// - aux high: 6.9 mA (30 days) -// - aux low: 0.16 mA (3.5 years) -// - red moon: 2.17 mA (96 days) -// - white moon: 1.47 mA (141 days) -// Low mode isn't bright enough to be useful on this light, -// but at least it doesn't drain the battery 3X faster than moon mode. -// (it seriously would be more practical to just use moon instead) -#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) - -// channel modes... -// CM_WHITE, CM_AUTO2, CM_AUTO3, CM_RED, CM_WHITE_RED -#define DEFAULT_CHANNEL_MODE CM_AUTO3 - -#define FACTORY_RESET_WARN_CHANNEL CM_RED -#define FACTORY_RESET_SUCCESS_CHANNEL CM_WHITE - -#define CONFIG_WAITING_CHANNEL CM_RED -#define CONFIG_BLINK_CHANNEL CM_WHITE - -// blink numbers on the main LEDs by default (but allow user to change it) -#define DEFAULT_BLINK_CHANNEL CM_RED - -// how much to increase total brightness at middle tint -// (0 = 100% brightness, 64 = 200% brightness) -// seems unnecessary on this light -#define TINT_RAMPING_CORRECTION 0 - -#define RAMP_SIZE 150 -// use dynamic PWM instead of plain 8-bit -// (so we can get lower lows and a smoother ramp) -// (also, red LEDs use a QX7138 chip which has max PWM speed of 10 kHz, -// and it behaves erratically at full speed, -// so PWM here is 576 clock cycles long to keep the speed low enough) -// -// This first ramp seems a bit too low: 0.2 / 1.9 / 10 / 37 / 109 / 272 / 600 lm -// level_calc.py 5.99 1 150 7135 1 0.2 600 --pwm dyn:77:16383:575:3 -//#define PWM_LEVELS 1,1,2,2,3,4,4,5,6,6,7,8,9,9,10,11,11,12,13,13,14,15,15,16,16,17,18,18,19,19,19,20,20,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,24,24,24,25,26,26,27,28,29,30,32,33,34,36,38,40,42,44,46,48,50,52,55,57,59,62,65,68,70,73,77,80,83,86,90,94,97,101,105,110,114,118,123,128,133,138,143,148,154,160,166,172,178,185,191,198,205,213,220,228,236,244,252,261,270,279,289,298,308,319,329,340,351,363,374,386,399,411,424,438,452,466,480,495,510,526,542,558,575 -//#define PWM_TOPS 16383,10869,13246,8043,11458,12772,10093,11043,11450,9664,9991,10091,10048,8868,8838,8730,7814,7724,7589,6864,6748,6604,6024,5899,5398,5287,5159,4754,4638,4287,3963,3876,3594,3511,3265,3038,2829,2770,2586,2417,2260,2115,1981,1857,1742,1636,1537,1445,1360,1281,1207,1138,1073,1013,957,904,855,848,803,760,720,714,677,643,637,630,599,592,585,577,569,579,570,560,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575 -// -// This ramp is a bit higher: 0.2 / 3 / 19 / 61 / 152 / 320 / 600 lm -// level_calc.py 4.001 1 150 7135 1 0.2 600 --pwm dyn:78:16383:575:3.333 -#define PWM1_LEVELS 1,1,2,4,5,6,7,8,9,10,12,13,14,15,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,33,34,34,35,35,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,37,37,38,38,39,40,40,41,43,44,45,47,48,50,52,54,56,59,62,64,67,69,72,75,78,81,84,87,90,94,97,101,104,108,112,116,120,124,128,133,137,142,147,151,156,161,167,172,177,183,189,194,200,206,213,219,226,232,239,246,253,260,268,275,283,291,299,307,316,324,333,342,351,361,370,380,390,400,410,420,431,442,453,464,476,487,499,511,523,536,549,562,575 -#define PWM_TOPS 16383,8174,7823,14429,13603,12806,12046,11328,10652,10017,10402,9742,9134,8575,8615,8089,7605,7536,7093,6684,6307,5959,5636,5337,5060,4802,4562,4337,4127,3929,3633,3468,3216,3077,2862,2744,2559,2390,2234,2091,1960,1838,1727,1623,1528,1439,1357,1280,1209,1143,1081,1024,970,919,872,828,787,770,732,716,682,668,654,624,611,613,600,587,587,574,573,571,569,566,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575,575 -// TODO? 200% power at top of ramp on white blend mode -// 2nd table handles "200% power" turbo -//#define PWM2_LEVELS ... -// tops for PWM2 -//#define PWM3_LEVELS ... -#define MAX_1x7135 75 -#define MIN_THERM_STEPDOWN 75 // should be above highest dyn_pwm level -#define HALFSPEED_LEVEL 12 -#define QUARTERSPEED_LEVEL 5 - -// the default of 26 looks a bit flat, so increase it -#define CANDLE_AMPLITUDE 40 - -// override default ramp style -#undef RAMP_STYLE -#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped -// set floor and ceiling as far apart as possible -// because this lantern isn't overpowered -#define RAMP_SMOOTH_FLOOR 1 -#define RAMP_SMOOTH_CEIL 150 -//#define RAMP_DISCRETE_FLOOR 17 // 17 50 83 116 150 -#define RAMP_DISCRETE_FLOOR 1 // 1 25 50 75 100 125 150 -#define RAMP_DISCRETE_CEIL 150 -#define RAMP_DISCRETE_STEPS 7 - -// LT1S can handle heat well, so don't limit simple mode -//#define SIMPLE_UI_FLOOR 10 // 10 45 80 115 150 -#define SIMPLE_UI_FLOOR 1 -#define SIMPLE_UI_CEIL 150 -#define SIMPLE_UI_STEPS 7 - -// Allow 3C (or 6C) in Simple UI (toggle smooth or stepped ramping) -#define USE_SIMPLE_UI_RAMPING_TOGGLE - -// allow Aux Config and Strobe Modes in Simple UI -#define USE_EXTENDED_SIMPLE_UI - -// turn on at med-low brightness by default (level 50/150, or ramp step 3/7) -// (also sets lockout mode 2H to a useful level) -#define DEFAULT_MANUAL_MEMORY 50 -// reset to default after being off for 10 minutes -#define DEFAULT_MANUAL_MEMORY_TIMER 10 - -// enable 2 click turbo (Anduril 1 style) -#define DEFAULT_2C_STYLE 1 - -#define USE_SOS_MODE -#define USE_SOS_MODE_IN_BLINKY_GROUP - -#define USE_POLICE_COLOR_STROBE_MODE -#define POLICE_COLOR_STROBE_CH1 CM_RED -#define POLICE_COLOR_STROBE_CH2 CM_WHITE - -#undef TACTICAL_LEVELS -#define TACTICAL_LEVELS 120,30,(RAMP_SIZE+3) // high, low, police strobe - -// don't blink while ramping -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif -#ifdef BLINK_AT_RAMP_FLOOR -#undef BLINK_AT_RAMP_FLOOR -#endif -#ifdef BLINK_AT_RAMP_CEIL -#undef BLINK_AT_RAMP_CEIL -#endif -// without this, it's really hard to tell when ramping up stops -#define BLINK_AT_RAMP_CEIL - -#define USE_SOFT_FACTORY_RESET diff --git a/hw/sofirn/sc21-pro/anduril.h b/hw/sofirn/sc21-pro/anduril.h new file mode 100644 index 0000000..febd1dd --- /dev/null +++ b/hw/sofirn/sc21-pro/anduril.h @@ -0,0 +1,14 @@ +// Sofirn SC21 Pro - same setup as a Wurkkos TS10, but with the aux indicator on while ramping +// Copyright (C) 2022-2023 (FIXME) +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +#include "wurkkos/ts10/cfg.h" +#undef MODEL_NUMBER +#define MODEL_NUMBER "0632" +// ATTINY: 1616 + +// turn on the aux LED while main LED is on +#ifndef USE_INDICATOR_LED_WHILE_RAMPING +#define USE_INDICATOR_LED_WHILE_RAMPING +#endif diff --git a/hw/sofirn/sc21-pro/cfg.h b/hw/sofirn/sc21-pro/cfg.h deleted file mode 100644 index febd1dd..0000000 --- a/hw/sofirn/sc21-pro/cfg.h +++ /dev/null @@ -1,14 +0,0 @@ -// Sofirn SC21 Pro - same setup as a Wurkkos TS10, but with the aux indicator on while ramping -// Copyright (C) 2022-2023 (FIXME) -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#include "wurkkos/ts10/cfg.h" -#undef MODEL_NUMBER -#define MODEL_NUMBER "0632" -// ATTINY: 1616 - -// turn on the aux LED while main LED is on -#ifndef USE_INDICATOR_LED_WHILE_RAMPING -#define USE_INDICATOR_LED_WHILE_RAMPING -#endif diff --git a/hw/sofirn/sp10-pro/anduril.h b/hw/sofirn/sp10-pro/anduril.h new file mode 100644 index 0000000..e265918 --- /dev/null +++ b/hw/sofirn/sp10-pro/anduril.h @@ -0,0 +1,81 @@ +// Sofirn SP10 Pro config options for Anduril +// Copyright (C) 2022-2023 (original author TBD), Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +#define MODEL_NUMBER "0631" +#include "sofirn/sp10-pro/hwdef.h" +// ATTINY: 1616 + +// 1....15: level_calc.py 3.01 1 15 7135 1 0.1 2 --pwm dyn:15:64:64 +// 16..150: level_calc.py 5.01 1 135 7135 1 2 800 --pwm dyn:49:3072:255:3.0 +#define RAMP_SIZE 150 +#define _PWM1_LEVELS_ 1, 2, 4, 6, 9,12,15,19,23,28,34,41,48,55,64 +#define _PWM1_TOPS_ 64,64,64,64,64,64,64,64,64,64,64,64,64,64,64 +#define _PWM2_LEVELS_ 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 41, 42, 44, 46, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 70, 72, 74, 77, 79, 82, 85, 88, 90, 93, 96, 99,103,106,109,113,116,120,123,127,131,135,139,143,147,151,156,160,165,170,175,180,185,190,195,201,206,212,218,223,230,236,242,248,255 +#define _PWM2_TOPS_ 3072,1960,2372,1476,2097,1572,1920,1570,1777,1524,1646,1454,1286,1369,1234,1115,1011,918,837,894,823,759,702,650,603,560,522,487,455,425,398,374,351,330,310,292,275,259,280,265,251,266,253,240,252,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 +#define PWM1_LEVELS _PWM1_LEVELS_,_PWM2_TOPS_ +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,_PWM2_LEVELS_ +#define PWM_TOPS _PWM1_TOPS_,_PWM2_TOPS_ + +#define MAX_1x7135 15 +#define HALFSPEED_LEVEL 15 +#define QUARTERSPEED_LEVEL 15 +#define DEFAULT_LEVEL 50 + +#define RAMP_SMOOTH_FLOOR 1 +#define RAMP_SMOOTH_CEIL 150 +// 1 25 50 [75] 100 125 150 +#define RAMP_DISCRETE_FLOOR 1 +#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL +#define RAMP_DISCRETE_STEPS 7 + +// at Sofirn's request, use max (150) for the Simple UI ceiling +// 15 48 [82] 116 150 +#define SIMPLE_UI_FLOOR MAX_1x7135 +#define SIMPLE_UI_CEIL 150 +#define SIMPLE_UI_STEPS 5 + +// turn on at ~6 lm by default (level 50/150, or ramp step 2/5 or 3/7) +// (also sets lockout mode 2H to a useful level) +#define DEFAULT_MANUAL_MEMORY 50 +// reset to default after being off for 10 minutes +#define DEFAULT_MANUAL_MEMORY_TIMER 10 + +// enable SOS in the blinkies group +#define USE_SOS_MODE +#define USE_SOS_MODE_IN_BLINKY_GROUP + +// Allow 3C in Simple UI for switching between smooth and stepped ramping +#define USE_SIMPLE_UI_RAMPING_TOGGLE + +// and finally, set the default ramp style to Stepped +#undef RAMP_STYLE +#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped + +// stop panicking at ~30% power +#define THERM_FASTER_LEVEL 105 +#define MIN_THERM_STEPDOWN 65 // must be > end of dynamic PWM range + +// slow down party strobe; this driver can't pulse for too short a time +//#define PARTY_STROBE_ONTIME 8 +#define STROBE_OFF_LEVEL 1 // keep the regulator chip on between pulses + +// the default of 26 looks a bit flat, so increase it +#define CANDLE_AMPLITUDE 50 + +// enable 2 click turbo (replaces USE_2C_MAX_TURBO) +#define DEFAULT_2C_STYLE 1 + +// don't blink during the ramp or at the ceiling +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE +#endif +#ifdef BLINK_AT_RAMP_CEIL +#undef BLINK_AT_RAMP_CEIL +#endif + + +// enable factory reset on 13H without loosening tailcap +#define USE_SOFT_FACTORY_RESET + diff --git a/hw/sofirn/sp10-pro/cfg.h b/hw/sofirn/sp10-pro/cfg.h deleted file mode 100644 index e265918..0000000 --- a/hw/sofirn/sp10-pro/cfg.h +++ /dev/null @@ -1,81 +0,0 @@ -// Sofirn SP10 Pro config options for Anduril -// Copyright (C) 2022-2023 (original author TBD), Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#define MODEL_NUMBER "0631" -#include "sofirn/sp10-pro/hwdef.h" -// ATTINY: 1616 - -// 1....15: level_calc.py 3.01 1 15 7135 1 0.1 2 --pwm dyn:15:64:64 -// 16..150: level_calc.py 5.01 1 135 7135 1 2 800 --pwm dyn:49:3072:255:3.0 -#define RAMP_SIZE 150 -#define _PWM1_LEVELS_ 1, 2, 4, 6, 9,12,15,19,23,28,34,41,48,55,64 -#define _PWM1_TOPS_ 64,64,64,64,64,64,64,64,64,64,64,64,64,64,64 -#define _PWM2_LEVELS_ 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 41, 42, 44, 46, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 70, 72, 74, 77, 79, 82, 85, 88, 90, 93, 96, 99,103,106,109,113,116,120,123,127,131,135,139,143,147,151,156,160,165,170,175,180,185,190,195,201,206,212,218,223,230,236,242,248,255 -#define _PWM2_TOPS_ 3072,1960,2372,1476,2097,1572,1920,1570,1777,1524,1646,1454,1286,1369,1234,1115,1011,918,837,894,823,759,702,650,603,560,522,487,455,425,398,374,351,330,310,292,275,259,280,265,251,266,253,240,252,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 -#define PWM1_LEVELS _PWM1_LEVELS_,_PWM2_TOPS_ -#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,_PWM2_LEVELS_ -#define PWM_TOPS _PWM1_TOPS_,_PWM2_TOPS_ - -#define MAX_1x7135 15 -#define HALFSPEED_LEVEL 15 -#define QUARTERSPEED_LEVEL 15 -#define DEFAULT_LEVEL 50 - -#define RAMP_SMOOTH_FLOOR 1 -#define RAMP_SMOOTH_CEIL 150 -// 1 25 50 [75] 100 125 150 -#define RAMP_DISCRETE_FLOOR 1 -#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL -#define RAMP_DISCRETE_STEPS 7 - -// at Sofirn's request, use max (150) for the Simple UI ceiling -// 15 48 [82] 116 150 -#define SIMPLE_UI_FLOOR MAX_1x7135 -#define SIMPLE_UI_CEIL 150 -#define SIMPLE_UI_STEPS 5 - -// turn on at ~6 lm by default (level 50/150, or ramp step 2/5 or 3/7) -// (also sets lockout mode 2H to a useful level) -#define DEFAULT_MANUAL_MEMORY 50 -// reset to default after being off for 10 minutes -#define DEFAULT_MANUAL_MEMORY_TIMER 10 - -// enable SOS in the blinkies group -#define USE_SOS_MODE -#define USE_SOS_MODE_IN_BLINKY_GROUP - -// Allow 3C in Simple UI for switching between smooth and stepped ramping -#define USE_SIMPLE_UI_RAMPING_TOGGLE - -// and finally, set the default ramp style to Stepped -#undef RAMP_STYLE -#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped - -// stop panicking at ~30% power -#define THERM_FASTER_LEVEL 105 -#define MIN_THERM_STEPDOWN 65 // must be > end of dynamic PWM range - -// slow down party strobe; this driver can't pulse for too short a time -//#define PARTY_STROBE_ONTIME 8 -#define STROBE_OFF_LEVEL 1 // keep the regulator chip on between pulses - -// the default of 26 looks a bit flat, so increase it -#define CANDLE_AMPLITUDE 50 - -// enable 2 click turbo (replaces USE_2C_MAX_TURBO) -#define DEFAULT_2C_STYLE 1 - -// don't blink during the ramp or at the ceiling -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif -#ifdef BLINK_AT_RAMP_CEIL -#undef BLINK_AT_RAMP_CEIL -#endif - - -// enable factory reset on 13H without loosening tailcap -#define USE_SOFT_FACTORY_RESET - diff --git a/hw/sofirn/sp36-t1616/anduril.h b/hw/sofirn/sp36-t1616/anduril.h new file mode 100644 index 0000000..d3e5459 --- /dev/null +++ b/hw/sofirn/sp36-t1616/anduril.h @@ -0,0 +1,37 @@ +// Sofirn SP36 (small Q8) config options for Anduril using the Attiny1616 +// Copyright (C) 2021-2023 (FIXME) +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +// same as the BLF Q8, mostly +#include "sofirn/blf-q8-t1616/cfg.h" +#undef MODEL_NUMBER +#define MODEL_NUMBER "0614" +// ATTINY: 1616 + +// voltage readings were a little high with the Q8 value +#undef VOLTAGE_FUDGE_FACTOR +#define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V, not 0.35V + +// the high button LED mode on this light uses too much power +// off mode: low (1) +// lockout: blinking (3) +#ifdef INDICATOR_LED_DEFAULT_MODE +#undef INDICATOR_LED_DEFAULT_MODE +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) +#endif + +// don't blink during the ramp; the button LED brightness is sufficient +// to indicate which power channel(s) are being used +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE +#endif +#ifdef BLINK_AT_RAMP_CEIL +#undef BLINK_AT_RAMP_CEIL +#endif + +// stop panicking at ~60% power or ~3000 lm +#ifdef THERM_FASTER_LEVEL +#undef THERM_FASTER_LEVEL +#endif +#define THERM_FASTER_LEVEL 130 diff --git a/hw/sofirn/sp36-t1616/cfg.h b/hw/sofirn/sp36-t1616/cfg.h deleted file mode 100644 index d3e5459..0000000 --- a/hw/sofirn/sp36-t1616/cfg.h +++ /dev/null @@ -1,37 +0,0 @@ -// Sofirn SP36 (small Q8) config options for Anduril using the Attiny1616 -// Copyright (C) 2021-2023 (FIXME) -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -// same as the BLF Q8, mostly -#include "sofirn/blf-q8-t1616/cfg.h" -#undef MODEL_NUMBER -#define MODEL_NUMBER "0614" -// ATTINY: 1616 - -// voltage readings were a little high with the Q8 value -#undef VOLTAGE_FUDGE_FACTOR -#define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V, not 0.35V - -// the high button LED mode on this light uses too much power -// off mode: low (1) -// lockout: blinking (3) -#ifdef INDICATOR_LED_DEFAULT_MODE -#undef INDICATOR_LED_DEFAULT_MODE -#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) -#endif - -// don't blink during the ramp; the button LED brightness is sufficient -// to indicate which power channel(s) are being used -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif -#ifdef BLINK_AT_RAMP_CEIL -#undef BLINK_AT_RAMP_CEIL -#endif - -// stop panicking at ~60% power or ~3000 lm -#ifdef THERM_FASTER_LEVEL -#undef THERM_FASTER_LEVEL -#endif -#define THERM_FASTER_LEVEL 130 diff --git a/hw/sofirn/sp36/anduril.h b/hw/sofirn/sp36/anduril.h new file mode 100644 index 0000000..7b65ad9 --- /dev/null +++ b/hw/sofirn/sp36/anduril.h @@ -0,0 +1,36 @@ +// Sofirn SP36 (small Q8) config options for Anduril +// Copyright (C) 2018-2023 Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +// same as the BLF Q8, mostly +#include "sofirn/blf-q8/cfg.h" +#undef MODEL_NUMBER +#define MODEL_NUMBER "0612" + +// voltage readings were a little high with the Q8 value +#undef VOLTAGE_FUDGE_FACTOR +#define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V, not 0.35V + +// the high button LED mode on this light uses too much power +// off mode: low (1) +// lockout: blinking (3) +#ifdef INDICATOR_LED_DEFAULT_MODE +#undef INDICATOR_LED_DEFAULT_MODE +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) +#endif + +// don't blink during the ramp; the button LED brightness is sufficient +// to indicate which power channel(s) are being used +#ifdef BLINK_AT_RAMP_MIDDLE +#undef BLINK_AT_RAMP_MIDDLE +#endif +#ifdef BLINK_AT_RAMP_CEIL +#undef BLINK_AT_RAMP_CEIL +#endif + +// stop panicking at ~60% power or ~3000 lm +#ifdef THERM_FASTER_LEVEL +#undef THERM_FASTER_LEVEL +#endif +#define THERM_FASTER_LEVEL 130 diff --git a/hw/sofirn/sp36/cfg.h b/hw/sofirn/sp36/cfg.h deleted file mode 100644 index 7b65ad9..0000000 --- a/hw/sofirn/sp36/cfg.h +++ /dev/null @@ -1,36 +0,0 @@ -// Sofirn SP36 (small Q8) config options for Anduril -// Copyright (C) 2018-2023 Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -// same as the BLF Q8, mostly -#include "sofirn/blf-q8/cfg.h" -#undef MODEL_NUMBER -#define MODEL_NUMBER "0612" - -// voltage readings were a little high with the Q8 value -#undef VOLTAGE_FUDGE_FACTOR -#define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V, not 0.35V - -// the high button LED mode on this light uses too much power -// off mode: low (1) -// lockout: blinking (3) -#ifdef INDICATOR_LED_DEFAULT_MODE -#undef INDICATOR_LED_DEFAULT_MODE -#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) -#endif - -// don't blink during the ramp; the button LED brightness is sufficient -// to indicate which power channel(s) are being used -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif -#ifdef BLINK_AT_RAMP_CEIL -#undef BLINK_AT_RAMP_CEIL -#endif - -// stop panicking at ~60% power or ~3000 lm -#ifdef THERM_FASTER_LEVEL -#undef THERM_FASTER_LEVEL -#endif -#define THERM_FASTER_LEVEL 130 -- cgit v1.2.3