diff options
Diffstat (limited to 'spaghetti-monster')
| -rw-r--r-- | spaghetti-monster/anduril/cfg-emisar-d4sv2-tintramp-fet.h | 74 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/cfg-emisar-d4sv2-tintramp.h | 88 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-channels.c | 2 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-channels.h | 4 |
4 files changed, 6 insertions, 162 deletions
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4sv2-tintramp-fet.h b/spaghetti-monster/anduril/cfg-emisar-d4sv2-tintramp-fet.h deleted file mode 100644 index 437387c..0000000 --- a/spaghetti-monster/anduril/cfg-emisar-d4sv2-tintramp-fet.h +++ /dev/null @@ -1,74 +0,0 @@ -// Emisar D4S V2 tint-ramping (plus FET) config options for Anduril (based on Noctigon K9.3) -// Copyright (C) 2021-2023 Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#include "cfg-emisar-d4sv2-tintramp.h" -#undef MODEL_NUMBER -#define MODEL_NUMBER "0136" -// ATTINY: 1634 - -// enable the FET channel, even though it's ... kinda funky -#undef PWM_CHANNELS -#define PWM_CHANNELS 2 - -// main LEDs -// output: unknown, 2000 lm? -// FET: unknown, 3000 lm? -// 2nd LEDs -// output: unknown, 2000 lm? -#define RAMP_LENGTH 150 -///// copy non-FET ramp, but add FET to the top 10 levels from 141 to 150 -/* old -// level_calc.py 5.01 1 140 7135 1 0.2 2000 --pwm dyn:69:16383:511 -// plus a FET segment -// abstract ramp (power is split between both sets of LEDs) -// level_calc.py 2 1 10 7135 5 50.0 3000 --pwm 255 -// append: ,500,482,456,420,374,318,252,178,94,0 -*/ -/* also old -// level_calc.py 3 1 11 7135 511 2000 5000 --pwm 1022 -// append: 549,589,633,679,728,780,836,894,957,1022 -//#undef PWM1_LEVELS -//#define PWM1_LEVELS 1,1,1,2,2,3,3,4,5,5,6,7,8,9,10,12,13,14,16,18,19,21,23,25,27,30,32,35,37,40,43,45,48,51,54,58,61,64,67,70,74,77,80,83,86,89,92,95,97,99,101,103,105,106,106,107,106,106,104,102,100,96,92,87,81,73,65,56,45,33,35,37,39,41,43,45,47,49,52,54,57,59,62,65,68,71,74,78,81,85,89,92,96,100,105,109,114,118,123,128,133,139,144,150,156,162,168,175,181,188,195,202,210,217,225,233,242,250,259,268,278,287,297,307,318,328,339,351,362,374,386,399,412,425,438,452,466,481,496,511,549,589,633,679,728,780,836,894,957,1022 -// append: ,511,511,511,511,511,511,511,511,511,511 -//#undef PWM_TOPS -//#define PWM_TOPS 16383,13469,10296,14694,10845,14620,11496,13507,14400,11954,12507,12676,12605,12376,12036,12805,12240,11650,11882,11933,11243,11155,10988,10763,10497,10569,10223,10164,9781,9646,9475,9071,8870,8652,8422,8330,8077,7823,7569,7318,7169,6919,6676,6439,6209,5986,5770,5561,5305,5063,4834,4618,4413,4180,3925,3723,3468,3264,3016,2787,2576,2333,2111,1885,1658,1412,1189,968,734,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511 -*/ - -// prepend: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,14,27,45,68,96,129,166,208,255 -#undef DEFAULT_LEVEL -#define DEFAULT_LEVEL 70 -#undef MAX_1x7135 -#define MAX_1x7135 130 - -#undef RAMP_SMOOTH_FLOOR -#define RAMP_SMOOTH_FLOOR 10 // level 1 is unreliable (?) -#undef RAMP_SMOOTH_CEIL -#define RAMP_SMOOTH_CEIL 130 -// 10, 30, 50, [70], 90, 110, [130] -#undef RAMP_DISCRETE_FLOOR -#define RAMP_DISCRETE_FLOOR 10 -#undef RAMP_DISCRETE_CEIL -#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL -#undef RAMP_DISCRETE_STEPS -#define RAMP_DISCRETE_STEPS 7 - -// safe limit highest regulated power (no FET or turbo) -#undef SIMPLE_UI_FLOOR -#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR -#undef SIMPLE_UI_CEIL -#define SIMPLE_UI_CEIL RAMP_DISCRETE_CEIL -#undef SIMPLE_UI_STEPS -#define SIMPLE_UI_STEPS 5 - -// stop panicking at ~2000 lm -#undef THERM_FASTER_LEVEL -#define THERM_FASTER_LEVEL 130 -#undef MIN_THERM_STEPDOWN -#define MIN_THERM_STEPDOWN 65 // should be above highest dyn_pwm level - -// speed up party strobe; the FET is really fast -#undef PARTY_STROBE_ONTIME - diff --git a/spaghetti-monster/anduril/cfg-emisar-d4sv2-tintramp.h b/spaghetti-monster/anduril/cfg-emisar-d4sv2-tintramp.h deleted file mode 100644 index c9a0b4f..0000000 --- a/spaghetti-monster/anduril/cfg-emisar-d4sv2-tintramp.h +++ /dev/null @@ -1,88 +0,0 @@ -// Emisar D4S V2 tint-ramping config options for Anduril (based on Noctigon K9.3) -// Copyright (C) 2021-2023 Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later -#pragma once - -#define MODEL_NUMBER "0135" -#include "hwdef-Emisar_D4Sv2-tintramp.h" -#include "hank-cfg.h" -// ATTINY: 1634 - -// this light has three aux LED channels: R, G, B -#define USE_AUX_RGB_LEDS -// the aux LEDs are front-facing, so turn them off while main LEDs are on -// it also has an independent LED in the button -#define USE_BUTTON_LED -// TODO: the whole "indicator LED" thing needs to be refactored into -// "aux LED(s)" and "button LED(s)" since they work a bit differently -// enabling this option breaks the button LED on D4v2.5 -#ifdef USE_INDICATOR_LED_WHILE_RAMPING -#undef USE_INDICATOR_LED_WHILE_RAMPING -#endif - -// has two channels of independent LEDs -#define USE_TINT_RAMPING -// how much to increase total brightness at middle tint -// (0 = 100% brightness, 64 = 200% brightness) -#define TINT_RAMPING_CORRECTION 0 // none, linear regulator doesn't need it - -// main LEDs -// output: unknown, 2000 lm? -// FET: absent / unused? -// 2nd LEDs -// output: unknown, 2000 lm? -#define RAMP_LENGTH 150 -// abstract ramp (power is split between both sets of LEDs) -// 1-130: 0 to 100% power -// level_calc.py 5.01 1 130 7135 2 0.2 2000 --pwm dyn:64:16383:511 -// 131 to 150: 101% to 200% power -// level_calc.py 6.44 1 150 7135 1 0.2 2000 --pwm dyn:74:16383:1022 -#define PWM1_LEVELS 2,2,2,3,3,4,4,5,6,7,8,9,10,11,13,14,16,17,19,21,23,25,28,30,33,35,38,41,44,47,50,54,57,60,64,67,71,74,78,81,84,88,91,94,97,99,101,103,105,106,107,107,107,106,105,102,99,95,90,84,77,68,58,47,34,36,38,40,42,44,47,49,52,54,57,60,63,66,69,73,76,80,83,87,91,96,100,104,109,114,119,124,130,135,141,147,153,160,166,173,180,187,195,203,211,219,228,236,245,255,264,274,285,295,306,317,329,340,353,365,378,391,405,419,433,448,463,479,495,511,530,550,570,591,612,634,657,680,705,730,755,782,809,837,865,895,925,957,989,1022 -#define PWM_TOPS 16383,13234,9781,13826,9593,13434,9973,12021,12900,13193,13150,12899,12508,12023,12666,11982,12181,11422,11393,11247,11018,10731,10826,10434,10365,9927,9767,9565,9332,9076,8806,8693,8395,8096,7928,7626,7439,7143,6948,6665,6393,6203,5946,5700,5465,5187,4926,4681,4451,4195,3957,3700,3463,3213,2983,2718,2476,2231,1986,1742,1501,1245,997,756,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511 -#define DEFAULT_LEVEL 70 -#define MAX_1x7135 150 -#define HALFSPEED_LEVEL 10 -#define QUARTERSPEED_LEVEL 2 - -#define USE_MANUAL_MEMORY_TIMER_FOR_TINT -//#define DEFAULT_MANUAL_MEMORY DEFAULT_LEVEL -//#define DEFAULT_MANUAL_MEMORY_TIMER 10 - -#define RAMP_SMOOTH_FLOOR 10 // level 1 is unreliable (?) -#define RAMP_SMOOTH_CEIL 130 -// 10, 30, 50, [70], 90, 110, [130] -#define RAMP_DISCRETE_FLOOR 10 -#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL -#define RAMP_DISCRETE_STEPS 7 - -// safe limit highest regulated power (no FET or turbo) -#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR -#define SIMPLE_UI_CEIL RAMP_DISCRETE_CEIL -#define SIMPLE_UI_STEPS 5 - -// stop panicking at ~1500 lm -#define THERM_FASTER_LEVEL 130 -#define MIN_THERM_STEPDOWN 65 // should be above highest dyn_pwm level - -// use the brightest setting for strobe -#define STROBE_BRIGHTNESS MAX_LEVEL -// slow down party strobe; this driver can't pulse for 1ms or less -#define PARTY_STROBE_ONTIME 2 - -// the default of 26 looks a bit flat, so increase it -#define CANDLE_AMPLITUDE 33 - -// the power regulator is a bit slow, so push it harder for a quick response from off -#define DEFAULT_JUMP_START_LEVEL 21 -#define BLINK_BRIGHTNESS DEFAULT_LEVEL -#define BLINK_ONCE_TIME 12 // longer blink, since main LEDs are slow - -#define THERM_CAL_OFFSET 5 - -#ifdef BLINK_AT_RAMP_MIDDLE -#undef BLINK_AT_RAMP_MIDDLE -#endif - -// for consistency with KR4 (not otherwise necessary though) -#define USE_SOFT_FACTORY_RESET - diff --git a/spaghetti-monster/fsm-channels.c b/spaghetti-monster/fsm-channels.c index 69add93..62b608c 100644 --- a/spaghetti-monster/fsm-channels.c +++ b/spaghetti-monster/fsm-channels.c @@ -7,6 +7,7 @@ #include "fsm-ramping.h" +#if NUM_CHANNEL_MODES > 1 void set_channel_mode(uint8_t mode) { uint8_t cur_level = actual_level; // turn off old LEDs before changing channel @@ -18,6 +19,7 @@ void set_channel_mode(uint8_t mode) { // update the LEDs set_level(cur_level); } +#endif // if NUM_CHANNEL_MODES > 1 #ifdef USE_CALC_2CH_BLEND diff --git a/spaghetti-monster/fsm-channels.h b/spaghetti-monster/fsm-channels.h index 55fc826..113a85c 100644 --- a/spaghetti-monster/fsm-channels.h +++ b/spaghetti-monster/fsm-channels.h @@ -42,6 +42,8 @@ Channel channels[]; // values are defined in the hwdef-*.c #define USE_CHANNEL_MODES // current multi-channel mode uint8_t channel_mode = DEFAULT_CHANNEL_MODE; +#else + #define channel_mode 0 #endif #ifdef USE_CUSTOM_CHANNEL_3H_MODES @@ -79,7 +81,9 @@ StatePtr channel_3H_modes[NUM_CHANNEL_MODES]; #define channel_has_args(n) (channels[n].has_args) #endif +#if NUM_CHANNEL_MODES > 1 void set_channel_mode(uint8_t mode); +#endif #ifdef USE_CALC_2CH_BLEND void calc_2ch_blend( |
