aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hwdef-Emisar_D4S.h10
-rw-r--r--spaghetti-monster/anduril/anduril.c5
-rwxr-xr-xspaghetti-monster/anduril/build-all.sh1
-rw-r--r--spaghetti-monster/fsm-ramping.h20
-rw-r--r--tk-attiny.h3
5 files changed, 39 insertions, 0 deletions
diff --git a/hwdef-Emisar_D4S.h b/hwdef-Emisar_D4S.h
new file mode 100644
index 0000000..47ef1eb
--- /dev/null
+++ b/hwdef-Emisar_D4S.h
@@ -0,0 +1,10 @@
+/* Emisar D4S driver layout
+ */
+// same as a D4, basically
+#include "hwdef-Emisar_D4.h"
+
+// ... except the D4S has aux LEDs under the optic
+#ifndef AUXLED_PIN
+#define AUXLED_PIN PB4 // pin 3
+#endif
+
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index abd3ed8..a79220b 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -21,6 +21,7 @@
/********* User-configurable options *********/
// Physical driver type (uncomment one of the following or define it at the gcc command line)
//#define FSM_EMISAR_D4_DRIVER
+//#define FSM_EMISAR_D4S_DRIVER
//#define FSM_BLF_Q8_DRIVER
//#define FSM_FW3A_DRIVER
//#define FSM_BLF_GT_DRIVER
@@ -229,9 +230,13 @@ uint8_t ramp_discrete_step_size; // don't set this
// 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 FSM_EMISAR_D4S_DRIVER
+uint8_t indicator_led_mode = (3<<2) + 1;
+#else
//uint8_t indicator_led_mode = (1<<2) + 2;
uint8_t indicator_led_mode = (2<<2) + 1;
#endif
+#endif
// calculate the nearest ramp level which would be valid at the moment
// (is a no-op for smooth ramp, but limits discrete ramp to only the
diff --git a/spaghetti-monster/anduril/build-all.sh b/spaghetti-monster/anduril/build-all.sh
index 4100805..9c7a07d 100755
--- a/spaghetti-monster/anduril/build-all.sh
+++ b/spaghetti-monster/anduril/build-all.sh
@@ -4,6 +4,7 @@ for TARGET in \
BLF_GT \
BLF_Q8 \
EMISAR_D4 \
+ EMISAR_D4S \
FW3A \
; do
echo "===== $TARGET ====="
diff --git a/spaghetti-monster/fsm-ramping.h b/spaghetti-monster/fsm-ramping.h
index 86742f6..d530f6a 100644
--- a/spaghetti-monster/fsm-ramping.h
+++ b/spaghetti-monster/fsm-ramping.h
@@ -73,6 +73,26 @@ void gradual_tick();
#define MAX_1x7135 60 // where it switches from PWM to current control
#define HALFSPEED_LEVEL 17
#define QUARTERSPEED_LEVEL 6
+ #elif defined(FSM_EMISAR_D4S_DRIVER)
+ // 3x7135 + FET
+ #if 0
+ // ../../bin/level_calc.py 2 150 7135 1 6 450 FET 1 10 1810
+ // (because it made the ramp look better than accurate values)
+ PROGMEM const uint8_t pwm1_levels[] = { 1,1,2,2,3,3,4,5,5,6,7,7,8,9,10,11,12,13,14,15,16,18,19,20,22,23,25,26,28,30,32,33,35,37,39,42,44,46,48,51,53,56,58,61,64,67,70,73,76,79,83,86,89,93,97,100,104,108,112,116,121,125,129,134,139,143,148,153,158,163,169,174,180,185,191,197,203,209,215,222,228,235,241,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,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 };
+ PROGMEM const uint8_t 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,1,4,6,9,11,14,16,19,22,24,27,30,33,36,39,42,45,48,51,54,57,61,64,67,71,74,78,82,85,89,93,96,100,104,108,112,116,121,125,129,133,138,142,147,151,156,160,165,170,175,180,185,190,195,200,205,210,216,221,227,232,238,243,249,255 };
+ #define MAX_1x7135 85
+ #define HALFSPEED_LEVEL 11
+ #define QUARTERSPEED_LEVEL 5
+ #else
+ // ../../bin/level_calc.py 2 150 7135 1 11.2 450 FET 1 10 4000
+ // (with a x**9 curve instead of x**3)
+ // (because it made the ramp look better than accurate values)
+ PROGMEM const uint8_t pwm1_levels[] = { 1,1,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,29,31,32,34,36,38,40,42,44,46,49,51,54,56,59,62,65,68,71,74,78,81,85,89,93,97,101,106,110,115,120,125,130,136,141,147,153,160,166,173,180,187,195,202,210,219,227,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,0 };
+ PROGMEM const uint8_t 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,1,3,4,5,7,8,10,11,13,14,16,18,19,21,23,25,27,29,31,34,36,38,41,43,46,48,51,54,57,60,63,66,69,72,76,79,83,87,91,95,99,103,107,112,116,121,126,131,136,141,146,152,158,163,169,175,182,188,195,202,209,216,223,231,239,247,255 };
+ #define MAX_1x7135 83
+ #define HALFSPEED_LEVEL 13
+ #define QUARTERSPEED_LEVEL 6
+ #endif
#else
// ../../bin/level_calc.py 2 150 7135 4 0.33 150 FET 1 10 1500
//PROGMEM const uint8_t pwm1_levels[] = { 4,4,4,5,5,5,6,6,7,7,8,9,10,11,12,13,14,15,17,18,20,21,23,25,27,30,32,34,37,40,43,46,49,52,56,59,63,67,71,76,80,85,90,95,100,106,112,118,124,130,137,144,151,158,166,173,181,190,198,207,216,225,235,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 };
diff --git a/tk-attiny.h b/tk-attiny.h
index b3edb6d..4973ed5 100644
--- a/tk-attiny.h
+++ b/tk-attiny.h
@@ -84,6 +84,9 @@
#elif defined(FSM_EMISAR_D4_DRIVER)
#include "hwdef-Emisar_D4.h"
+#elif defined(FSM_EMISAR_D4S_DRIVER)
+#include "hwdef-Emisar_D4S.h"
+
#elif defined(FSM_FW3A_DRIVER)
#include "hwdef-FW3A.h"