aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-05-01 19:54:43 -0600
committerSelene ToyKeeper2018-05-01 19:54:43 -0600
commit6a3a10faa447b0d9f53d2fe2e38fccab6d7cc439 (patch)
treec6d62ad8cd838e75a91fda7ed43c508dab90eba7
parentMade voltage ADC readings work on pin7 if USE_VOLTAGE_DIVIDER is defined. (diff)
downloadanduril-6a3a10faa447b0d9f53d2fe2e38fccab6d7cc439.tar.gz
anduril-6a3a10faa447b0d9f53d2fe2e38fccab6d7cc439.tar.bz2
anduril-6a3a10faa447b0d9f53d2fe2e38fccab6d7cc439.zip
Added BLF GT support to Anduril.
-rw-r--r--spaghetti-monster/anduril/anduril.c52
1 files changed, 42 insertions, 10 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 8e298b9..36d29ac 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -23,6 +23,7 @@
#define FSM_EMISAR_D4_DRIVER
//#define FSM_BLF_Q8_DRIVER
//#define FSM_FW3A_DRIVER
+//#define FSM_BLF_GT_DRIVER
#define USE_LVP
#define USE_THERMAL_REGULATION
@@ -62,10 +63,25 @@
#ifdef FSM_BLF_Q8_DRIVER
#define USE_INDICATOR_LED
#define VOLTAGE_FUDGE_FACTOR 7 // add 0.35V
+
#elif defined(FSM_EMISAR_D4_DRIVER)
#define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V
+
#elif defined(FSM_FW3A_DRIVER)
#define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V
+
+#elif defined(FSM_BLF_GT_DRIVER)
+#define USE_INDICATOR_LED
+#undef BLINK_AT_CHANNEL_BOUNDARIES
+#undef BLINK_AT_RAMP_CEILING
+#undef BLINK_AT_RAMP_FLOOR
+//#undef USE_SET_LEVEL_GRADUALLY
+#define RAMP_SMOOTH_FLOOR 1
+#define RAMP_SMOOTH_CEIL POWER_80PX
+#define RAMP_DISCRETE_FLOOR 1
+#define RAMP_DISCRETE_CEIL POWER_80PX
+#define RAMP_DISCRETE_STEPS 7
+
#endif
// try to auto-detect how many eeprom bytes
@@ -162,20 +178,36 @@ void save_config();
void save_config_wl();
#endif
+// default ramp options if not overridden earlier per-driver
+#ifndef RAMP_SMOOTH_FLOOR
+ #define RAMP_SMOOTH_FLOOR 1
+#endif
+#ifndef RAMP_SMOOTH_CEIL
+ #if PWM_CHANNELS == 3
+ #define RAMP_SMOOTH_CEIL MAX_Nx7135
+ #else
+ #define RAMP_SMOOTH_CEIL MAX_LEVEL - 30
+ #endif
+#endif
+#ifndef RAMP_DISCRETE_FLOOR
+ #define RAMP_DISCRETE_FLOOR 20
+#endif
+#ifndef RAMP_DISCRETE_CEIL
+ #define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
+#endif
+#ifndef RAMP_DISCRETE_STEPS
+ #define RAMP_DISCRETE_STEPS 7
+#endif
+
// brightness control
uint8_t memorized_level = MAX_1x7135;
// smooth vs discrete ramping
volatile uint8_t ramp_style = 0; // 0 = smooth, 1 = discrete
-volatile uint8_t ramp_smooth_floor = 1;
-#if PWM_CHANNELS == 3
-volatile uint8_t ramp_smooth_ceil = MAX_Nx7135;
-volatile uint8_t ramp_discrete_ceil = MAX_Nx7135;
-#else
-volatile uint8_t ramp_smooth_ceil = MAX_LEVEL - 30;
-volatile uint8_t ramp_discrete_ceil = MAX_LEVEL - 30;
-#endif
-volatile uint8_t ramp_discrete_floor = 20;
-volatile uint8_t ramp_discrete_steps = 7;
+volatile uint8_t ramp_smooth_floor = RAMP_SMOOTH_FLOOR;
+volatile uint8_t ramp_smooth_ceil = RAMP_SMOOTH_CEIL;
+volatile uint8_t ramp_discrete_floor = RAMP_DISCRETE_FLOOR;
+volatile uint8_t ramp_discrete_ceil = RAMP_DISCRETE_CEIL;
+volatile uint8_t ramp_discrete_steps = RAMP_DISCRETE_STEPS;
uint8_t ramp_discrete_step_size; // don't set this
#ifdef USE_INDICATOR_LED
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.