aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-10-26 08:29:44 -0600
committerSelene ToyKeeper2023-10-26 08:29:44 -0600
commitfd7aa0297954c511d3f0ec2353a8fcc3c68a3b5a (patch)
treee3d99e926bf6ad7d71fa37b78fdf4bbb08dc6329 /spaghetti-monster
parentconverted blf-gt-mini to new API (diff)
downloadanduril-fd7aa0297954c511d3f0ec2353a8fcc3c68a3b5a.tar.gz
anduril-fd7aa0297954c511d3f0ec2353a8fcc3c68a3b5a.tar.bz2
anduril-fd7aa0297954c511d3f0ec2353a8fcc3c68a3b5a.zip
converted Sofirn LT1-t1616 to new API, using SiteRelEnby's branch for reference
(needs further updates though, to improve ramping, since this version is basically a straight conversion of the old t85 code with 8-bit ramps)
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/anduril/cfg-blf-lantern-t1616.h57
-rw-r--r--spaghetti-monster/anduril/cfg-blf-lantern.h9
-rw-r--r--spaghetti-monster/fsm-ramping.h4
3 files changed, 39 insertions, 31 deletions
diff --git a/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h b/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h
index 18caa5b..85784bb 100644
--- a/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h
+++ b/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h
@@ -1,35 +1,32 @@
// BLF Lantern config options for Anduril using the Attiny1616
-// Copyright (C) 2021-2023 (FIXME)
+// Copyright (C) 2021-2023 (original author TBD), Selene ToyKeeper
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#define MODEL_NUMBER "0622"
-#include "hwdef-BLF_LT1-t1616.h"
+#include "hwdef-blf-lt1-t1616.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: high (2)
+// off mode: low (1)
// lockout: blinking (3)
-#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
+#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
-// the lantern has two PWM channels, but they drive different sets of emitters
-// (one channel for warm emitters, one channel for cold)
-// so enable a special ramping mode which changes tint instead of brightness
-#define USE_TINT_RAMPING
// 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%
-#ifdef RAMP_LENGTH
-#undef RAMP_LENGTH
-#endif
-
+#define RAMP_SIZE 150
// level_calc.py 1 150 7135 1 30 800
-#define RAMP_LENGTH 150
#define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,11,11,12,13,13,14,15,15,16,17,18,18,19,20,21,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,48,49,50,51,53,54,56,57,58,60,61,63,64,66,67,69,70,72,74,75,77,79,80,82,84,85,87,89,91,93,95,97,98,100,102,104,106,108,111,113,115,117,119,121,124,126,128,130,133,135,137,140,142,145,147,150,152,155,157,160,163,165,168,171,173,176,179,182,185,188,190,193,196,199,202,205,209,212,215,218,221,224,228,231,234,238,241,245,248,251,255
#define MAX_1x7135 65
#define HALFSPEED_LEVEL 14
@@ -40,40 +37,48 @@
// override default ramp style
#undef RAMP_STYLE
-#define RAMP_STYLE 1 // 0 = smooth, 1 = stepped
+#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 10
-#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
-#define RAMP_DISCRETE_STEPS 5
+#define RAMP_SMOOTH_FLOOR 1
+#define RAMP_SMOOTH_CEIL 150
+#define RAMP_DISCRETE_FLOOR 10
+#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 RAMP_DISCRETE_FLOOR
-#define SIMPLE_UI_CEIL RAMP_DISCRETE_CEIL
-#define SIMPLE_UI_STEPS RAMP_DISCRETE_STEPS
+#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
#define USE_SOS_MODE
#define USE_SOS_MODE_IN_BLINKY_GROUP
-// the sensor (attiny85) is nowhere near the emitters
+// 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_MIDDLE
-#undef BLINK_AT_RAMP_MIDDLE
-#endif
#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
+
+#define USE_CHANNEL_MODE_ARGS
+#define USE_SET_LEVEL_GRADUALLY
+
+// for consistency with other models
+#define USE_SOFT_FACTORY_RESET
+
diff --git a/spaghetti-monster/anduril/cfg-blf-lantern.h b/spaghetti-monster/anduril/cfg-blf-lantern.h
index b4c47db..53c3203 100644
--- a/spaghetti-monster/anduril/cfg-blf-lantern.h
+++ b/spaghetti-monster/anduril/cfg-blf-lantern.h
@@ -18,6 +18,7 @@
// 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)
@@ -54,15 +55,15 @@
#define RAMP_DISCRETE_CEIL 150
#define RAMP_DISCRETE_STEPS 7
-// Allow 3C in Simple UI for switching between smooth and stepped ramping
-#define USE_SIMPLE_UI_RAMPING_TOGGLE
-#define USE_EXTENDED_SIMPLE_UI
-
// 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
diff --git a/spaghetti-monster/fsm-ramping.h b/spaghetti-monster/fsm-ramping.h
index bfcc5fb..c4b7d48 100644
--- a/spaghetti-monster/fsm-ramping.h
+++ b/spaghetti-monster/fsm-ramping.h
@@ -69,7 +69,9 @@ void gradual_tick();
#define STACKED_PWM_DATATYPE uint8_t
#define PWM_DATATYPE uint8_t
#define PWM_DATATYPE2 uint16_t
- #define PWM_TOP 255
+ #ifndef PWM_TOP
+ #define PWM_TOP 255
+ #endif
#define STACKED_PWM_TOP 255
#ifndef PWM_GET
#define PWM_GET(x,y) pgm_read_byte(x+y)