aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hwdef-FF_ROT66.h20
-rw-r--r--spaghetti-monster/anduril/anduril.c35
-rwxr-xr-xspaghetti-monster/anduril/build-all.sh1
-rw-r--r--spaghetti-monster/anduril/cfg-ff-rot66.h50
-rw-r--r--tk-attiny.h3
5 files changed, 97 insertions, 12 deletions
diff --git a/hwdef-FF_ROT66.h b/hwdef-FF_ROT66.h
new file mode 100644
index 0000000..49947ab
--- /dev/null
+++ b/hwdef-FF_ROT66.h
@@ -0,0 +1,20 @@
+/* Fireflies ROT66 driver layout
+ */
+// same as a FW3A, basically
+#include "hwdef-FW3A.h"
+
+// ... except the ROT66 has a lighted button
+#ifndef AUXLED_PIN
+#define AUXLED_PIN PB2 // pin 7
+#endif
+
+// ... and no optic nerve
+#ifdef VISION_PIN
+#undef VISION_PIN
+#endif
+
+// average drop across diode on this hardware
+#ifdef VOLTAGE_FUDGE_FACTOR
+#undef VOLTAGE_FUDGE_FACTOR
+#endif
+#define VOLTAGE_FUDGE_FACTOR 7 // add 0.35V
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 38779ca..c8517af 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -20,13 +20,16 @@
/********* User-configurable options *********/
// Physical driver type (uncomment one of the following or define it at the gcc command line)
+//#define FSM_BLF_GT_DRIVER
+//#define FSM_BLF_GT_MINI_DRIVER
+//#define FSM_BLF_Q8_DRIVER
+//#define FSM_EMISAR_D1_DRIVER
+//#define FSM_EMISAR_D1S_DRIVER
//#define FSM_EMISAR_D4_DRIVER
//#define FSM_EMISAR_D4S_DRIVER
//#define FSM_EMISAR_D4S_219c_DRIVER
-//#define FSM_BLF_Q8_DRIVER
+//#define FSM_FF_ROT66_DRIVER
//#define FSM_FW3A_DRIVER
-//#define FSM_BLF_GT_DRIVER
-//#define FSM_BLF_GT_MINI_DRIVER
#define USE_LVP // FIXME: won't build when this option is turned off
@@ -90,6 +93,9 @@
#elif defined(FSM_EMISAR_D4S_DRIVER)
#include "cfg-emisar-d4s.h"
+#elif defined(FSM_FF_ROT66_DRIVER)
+#include "cfg-ff-rot66.h"
+
#elif defined(FSM_FW3A_DRIVER)
#include "cfg-fw3a.h"
@@ -275,15 +281,19 @@ volatile uint8_t ramp_discrete_steps = RAMP_DISCRETE_STEPS;
uint8_t ramp_discrete_step_size; // don't set this
#ifdef USE_INDICATOR_LED
-// bits 2-3 control lockout mode
-// bits 0-1 control "off" mode
-// modes are: 0=off, 1=low, 2=high, 3=blinking (if TICK_DURING_STANDBY enabled)
-#ifdef USE_INDICATOR_LED_WHILE_RAMPING
-//uint8_t indicator_led_mode = (1<<2) + 2;
-uint8_t indicator_led_mode = (2<<2) + 1;
-#else
-uint8_t indicator_led_mode = (3<<2) + 1;
-#endif
+ // bits 2-3 control lockout mode
+ // bits 0-1 control "off" mode
+ // modes are: 0=off, 1=low, 2=high, 3=blinking (if TICK_DURING_STANDBY enabled)
+ #ifdef INDICATOR_LED_DEFAULT_MODE
+ uint8_t indicator_led_mode = INDICATOR_LED_DEFAULT_MODE;
+ #else
+ #ifdef USE_INDICATOR_LED_WHILE_RAMPING
+ //uint8_t indicator_led_mode = (1<<2) + 2;
+ uint8_t indicator_led_mode = (2<<2) + 1;
+ #else
+ uint8_t indicator_led_mode = (3<<2) + 1;
+ #endif
+ #endif
#endif
// calculate the nearest ramp level which would be valid at the moment
@@ -732,6 +742,7 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
#else
set_level(THERM_FASTER_LEVEL);
#endif
+ target_level = THERM_FASTER_LEVEL;
} else
#endif
if (actual_level > MIN_THERM_STEPDOWN) {
diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh
index 9f31678..794b285 100755
--- a/spaghetti-monster/anduril/build-all.sh
+++ b/spaghetti-monster/anduril/build-all.sh
@@ -11,6 +11,7 @@ for TARGET in \
EMISAR_D4 \
EMISAR_D4S \
EMISAR_D4S_219c \
+ FF_ROT66 \
FW3A \
; do
echo "===== $TARGET ====="
diff --git a/spaghetti-monster/anduril/cfg-ff-rot66.h b/spaghetti-monster/anduril/cfg-ff-rot66.h
new file mode 100644
index 0000000..6cae4fd
--- /dev/null
+++ b/spaghetti-monster/anduril/cfg-ff-rot66.h
@@ -0,0 +1,50 @@
+// Fireflies ROT66 config options for Anduril
+
+// the button lights up
+#define USE_INDICATOR_LED
+// the button is visible while main LEDs are on
+#define USE_INDICATOR_LED_WHILE_RAMPING
+// enable blinking indicator LED while off?
+//#define TICK_DURING_STANDBY
+
+// If TICK_DURING_STANDBY is enabled...
+// off mode: high (2)
+// lockout: blinking (3)
+//#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
+
+// ... or if TICK_DURING_STANDBY is turned off:
+// off mode: high (2)
+// lockout: off (0)
+#define INDICATOR_LED_DEFAULT_MODE ((0<<2) + 2)
+
+
+#ifdef RAMP_LENGTH
+#undef RAMP_LENGTH
+#endif
+
+// driver is a FET+N+1,
+// where N=6 for the 219b version,
+// or N=13 for the XP-L HI version
+// calculated to get transition points at level 65 and 115, using a "ninth"-shaped ramp
+#define RAMP_LENGTH 150
+// first 65 steps copied from FW3A
+#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
+// remaining steps from this command:
+// level_calc.py 3 150 7135 1 1.4 110.1 7135 14 1 1058.5 FET 1 10 4500
+#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,15,17,18,20,21,23,25,27,29,31,33,36,38,41,43,46,49,52,55,58,62,65,69,73,77,81,86,90,95,100,105,111,116,122,128,135,141,148,155,163,170,178,187,195,204,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,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,4,8,12,16,21,25,30,35,40,45,50,56,62,68,74,81,87,94,101,109,116,124,133,141,150,159,168,178,188,198,209,220,231,243,255
+#define MAX_1x7135 65
+#define MAX_Nx7135 115
+#define HALFSPEED_LEVEL 14
+#define QUARTERSPEED_LEVEL 8
+
+// regulate down faster when the FET is active, slower otherwise
+#define THERM_FASTER_LEVEL 130 // throttle back faster when high
+
+// play it safe, don't try to regulate above the recommended safe level
+#define THERM_HARD_TURBO_DROP
+
+// don't do this
+#undef BLINK_AT_CHANNEL_BOUNDARIES
+#undef BLINK_AT_RAMP_CEILING
+
diff --git a/tk-attiny.h b/tk-attiny.h
index f208e9b..d121709 100644
--- a/tk-attiny.h
+++ b/tk-attiny.h
@@ -96,6 +96,9 @@
#elif defined(FSM_EMISAR_D1S_DRIVER)
#include "hwdef-Emisar_D1S.h"
+#elif defined(FSM_FF_ROT66_DRIVER)
+#include "hwdef-FF_ROT66.h"
+
#elif defined(FSM_FW3A_DRIVER)
#include "hwdef-FW3A.h"