aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spaghetti-monster/anduril/anduril.c2
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d1.h5
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d1s.h5
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d1v2.h17
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4.h4
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4s.h5
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h34
-rw-r--r--spaghetti-monster/fsm-events.c8
8 files changed, 56 insertions, 24 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index e87a30c..8a9584e 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -493,7 +493,7 @@ volatile strobe_mode_te strobe_type = 0;
#if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE)
// party / tactical strobe timing
-volatile uint8_t strobe_delays[] = { 40, 67 }; // party strobe, tactical strobe
+volatile uint8_t strobe_delays[] = { 41, 67 }; // party strobe 24 Hz, tactical strobe 10 Hz
#endif
// bike mode config options
diff --git a/spaghetti-monster/anduril/cfg-emisar-d1.h b/spaghetti-monster/anduril/cfg-emisar-d1.h
index 35e91db..9276ba3 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d1.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d1.h
@@ -8,8 +8,3 @@
#undef THERM_FASTER_LEVEL
#endif
#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high
-
-// no need to be extra-careful on this light
-#ifdef THERM_HARD_TURBO_DROP
-#undef THERM_HARD_TURBO_DROP
-#endif
diff --git a/spaghetti-monster/anduril/cfg-emisar-d1s.h b/spaghetti-monster/anduril/cfg-emisar-d1s.h
index 56200a2..c01c37d 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d1s.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d1s.h
@@ -8,8 +8,3 @@
#undef THERM_FASTER_LEVEL
#endif
#define THERM_FASTER_LEVEL 144 // throttle back faster when high
-
-// no need to be extra-careful on this light
-#ifdef THERM_HARD_TURBO_DROP
-#undef THERM_HARD_TURBO_DROP
-#endif
diff --git a/spaghetti-monster/anduril/cfg-emisar-d1v2.h b/spaghetti-monster/anduril/cfg-emisar-d1v2.h
new file mode 100644
index 0000000..91be3f3
--- /dev/null
+++ b/spaghetti-monster/anduril/cfg-emisar-d1v2.h
@@ -0,0 +1,17 @@
+// Emisar D1v2 config options for Anduril (D1 w/ D4v2 driver)
+// ATTINY: 1634
+// same as Emisar D4v2, mostly
+#include "cfg-emisar-d4v2.h"
+
+// there are no aux LEDs on a D1
+#undef USE_AUX_RGB_LEDS
+// ... and no button LED
+#undef USE_BUTTON_LED
+// no aux LEDs means no need for sleep ticks
+#undef TICK_DURING_STANDBY
+
+// stop panicking at ~75% power or ~1000 lm (D1 has a decent power-to-thermal-mass ratio)
+#ifdef THERM_FASTER_LEVEL
+#undef THERM_FASTER_LEVEL
+#endif
+#define THERM_FASTER_LEVEL (RAMP_SIZE*9/10) // throttle back faster when high
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4.h b/spaghetti-monster/anduril/cfg-emisar-d4.h
index 501b9c7..7700d88 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d4.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d4.h
@@ -18,10 +18,6 @@
#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
#define RAMP_DISCRETE_STEPS 7
-// optional, makes initial turbo step-down faster so first peak isn't as hot
-// the D4 runs very very hot, so be extra careful
-//#define THERM_HARD_TURBO_DROP
-
// stop panicking at ~30% power or ~1200 lm
#define THERM_FASTER_LEVEL 105
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s.h b/spaghetti-monster/anduril/cfg-emisar-d4s.h
index 88465da..f5addb2 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d4s.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d4s.h
@@ -37,8 +37,3 @@
#endif
#define MIN_THERM_STEPDOWN 60 // lowest value it'll step down to
#define THERM_FASTER_LEVEL (RAMP_SIZE-20) // don't throttle back faster when high
-
-// no need to be extra-careful on this light
-#ifdef THERM_HARD_TURBO_DROP
-#undef THERM_HARD_TURBO_DROP
-#endif
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h b/spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h
new file mode 100644
index 0000000..cbb5891
--- /dev/null
+++ b/spaghetti-monster/anduril/cfg-emisar-d4v2-nofet.h
@@ -0,0 +1,34 @@
+// Emisar D4v2-noFET config options for Anduril
+#include "cfg-emisar-d4v2.h"
+// ATTINY: 1634
+
+#undef PWM_CHANNELS
+#define PWM_CHANNELS 1
+#undef PWM1_LEVELS
+#undef PWM2_LEVELS
+#define PWM1_LEVELS 1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,6,6,7,8,8,9,9,10,10,11,12,13,13,14,15,16,16,17,18,19,20,21,22,23,23,24,26,27,28,29,30,31,32,33,34,36,37,38,39,41,42,43,45,46,47,49,50,52,53,55,56,58,59,61,62,64,66,67,69,71,72,74,76,78,80,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,116,118,120,122,125,127,129,132,134,136,139,141,144,146,148,151,154,156,159,161,164,166,169,172,174,177,180,183,185,188,191,194,197,200,203,205,208,211,214,217,220,223,226,230,233,236,239,242,245,249,252,255
+#undef MAX_1x7135
+#define MAX_1x7135 150
+#undef QUARTERSPEED_LEVEL
+#undef HALFSPEED_LEVEL
+#define QUARTERSPEED_LEVEL 8
+#define HALFSPEED_LEVEL 16
+
+#define DEFAULT_LEVEL 80
+
+#undef RAMP_SMOOTH_CEIL
+#define RAMP_SMOOTH_CEIL 150
+// 10, 45, 80, 115, 150
+#undef RAMP_DISCRETE_FLOOR
+#undef RAMP_DISCRETE_CEIL
+#undef RAMP_DISCRETE_STEPS
+#define RAMP_DISCRETE_FLOOR 10
+#define RAMP_DISCRETE_CEIL 150
+#define RAMP_DISCRETE_STEPS 5
+
+#define CANDLE_AMPLITUDE 60
+
+#undef THERM_FASTER_LEVEL
+#define THERM_FASTER_LEVEL 150
+
+#undef USE_THERMAL_REGULATION
diff --git a/spaghetti-monster/fsm-events.c b/spaghetti-monster/fsm-events.c
index a1b013a..ad869a6 100644
--- a/spaghetti-monster/fsm-events.c
+++ b/spaghetti-monster/fsm-events.c
@@ -120,7 +120,7 @@ uint8_t nice_delay_ms(uint16_t ms) {
uint8_t level = actual_level; // volatile, avoid repeat access
if (level < QUARTERSPEED_LEVEL) {
clock_prescale_set(clock_div_4);
- _delay_loop_2(BOGOMIPS*95/100/4);
+ _delay_loop_2(BOGOMIPS*90/100/4);
}
//else if (level < HALFSPEED_LEVEL) {
// clock_prescale_set(clock_div_2);
@@ -128,7 +128,7 @@ uint8_t nice_delay_ms(uint16_t ms) {
//}
else {
clock_prescale_set(clock_div_1);
- _delay_loop_2(BOGOMIPS*95/100);
+ _delay_loop_2(BOGOMIPS*90/100);
}
// restore regular clock speed
clock_prescale_set(clock_div_1);
@@ -136,13 +136,13 @@ uint8_t nice_delay_ms(uint16_t ms) {
// underclock MCU to save power
clock_prescale_set(clock_div_4);
// wait
- _delay_loop_2(BOGOMIPS*95/100/4);
+ _delay_loop_2(BOGOMIPS*90/100/4);
// restore regular clock speed
clock_prescale_set(clock_div_1);
#endif // ifdef USE_RAMPING
#else
// wait
- _delay_loop_2(BOGOMIPS*95/100);
+ _delay_loop_2(BOGOMIPS*90/100);
#endif // ifdef USE_DYNAMIC_UNDERCLOCKING
// run pending system processes while we wait
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.