aboutsummaryrefslogtreecommitdiff
path: root/hwdef-emisar-d4v2.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-09-17 04:37:25 -0600
committerSelene ToyKeeper2023-09-17 04:37:25 -0600
commitd34d0e7acb1f1e49d21af7cf1c9e08161ce95dd4 (patch)
treef2bcb36951f2c83064c17ff58aca4c5c59eed112 /hwdef-emisar-d4v2.c
parentfixed bug: smooth steps could sometimes turn off entirely (diff)
downloadanduril-d34d0e7acb1f1e49d21af7cf1c9e08161ce95dd4.tar.gz
anduril-d34d0e7acb1f1e49d21af7cf1c9e08161ce95dd4.tar.bz2
anduril-d34d0e7acb1f1e49d21af7cf1c9e08161ce95dd4.zip
fixed builds which weren't using set_level_zero() yet...
- emisar-d4 - emisar-d4v2 - emisar-d4v2-nofet - emisar-d4sv2 - emisar-2ch - emisar-2ch-fet - noctigon-dm11-boost - noctigon-k1 - noctigon-kr4 - noctigon-kr4-nofet - sofirn-lt1s-pro ... and removed old build targets for d4sv2-tintramp, because it was replaced by emisar-2ch a while ago.
Diffstat (limited to '')
-rw-r--r--hwdef-emisar-d4v2.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hwdef-emisar-d4v2.c b/hwdef-emisar-d4v2.c
index ada4eb8..026b30d 100644
--- a/hwdef-emisar-d4v2.c
+++ b/hwdef-emisar-d4v2.c
@@ -6,6 +6,8 @@
#include "chan-rgbaux.c"
+void set_level_zero();
+
void set_level_main(uint8_t level);
bool gradual_tick_main(uint8_t gt);
@@ -19,16 +21,14 @@ Channel channels[] = {
};
+void set_level_zero() {
+ CH1_PWM = 0;
+ CH2_PWM = 0;
+ PWM_CNT = 0; // reset phase
+}
+
// single set of LEDs with 2 stacked power channels, DDFET+1 or DDFET+linear
void set_level_main(uint8_t level) {
- if (level == 0) {
- CH1_PWM = 0;
- CH2_PWM = 0;
- PWM_CNT = 0; // reset phase
- return;
- }
-
- level --; // PWM array index = level - 1
PWM_DATATYPE ch1_pwm = PWM_GET(pwm1_levels, level);
PWM_DATATYPE ch2_pwm = PWM_GET(pwm2_levels, level);
// pulse frequency modulation, a.k.a. dynamic PWM