aboutsummaryrefslogtreecommitdiff
path: root/hwdef-emisar-2ch.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-2ch.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 'hwdef-emisar-2ch.c')
-rw-r--r--hwdef-emisar-2ch.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/hwdef-emisar-2ch.c b/hwdef-emisar-2ch.c
index 7955cf6..31d27af 100644
--- a/hwdef-emisar-2ch.c
+++ b/hwdef-emisar-2ch.c
@@ -7,6 +7,8 @@
#include "chan-rgbaux.c"
+void set_level_zero();
+
void set_level_ch1(uint8_t level);
void set_level_ch2(uint8_t level);
void set_level_both(uint8_t level);
@@ -90,41 +92,29 @@ void set_pwms(uint16_t ch1_pwm, uint16_t ch2_pwm, uint16_t top) {
if (! was_on) PWM_CNT = 0;
}
-void set_level_ch1(uint8_t level) {
- if (0 == level)
- return set_pwms(0, 0, PWM_TOP_INIT);
+void set_level_zero() {
+ return set_pwms(0, 0, PWM_TOP_INIT);
+}
- level --;
+void set_level_ch1(uint8_t level) {
uint16_t pwm = PWM_GET(pwm1_levels, level);
uint16_t top = PWM_GET(pwm_tops, level);
set_pwms(pwm, 0, top);
}
void set_level_ch2(uint8_t level) {
- if (0 == level)
- return set_pwms(0, 0, PWM_TOP_INIT);
-
- level --;
uint16_t pwm = PWM_GET(pwm1_levels, level);
uint16_t top = PWM_GET(pwm_tops, level);
set_pwms(0, pwm, top);
}
void set_level_both(uint8_t level) {
- if (0 == level)
- return set_pwms(0, 0, PWM_TOP_INIT);
-
- level --;
uint16_t pwm = PWM_GET(pwm1_levels, level);
uint16_t top = PWM_GET(pwm_tops, level);
set_pwms(pwm, pwm, top);
}
void set_level_blend(uint8_t level) {
- if (0 == level)
- return set_pwms(0, 0, PWM_TOP_INIT);
-
- level --;
PWM_DATATYPE ch1_pwm, ch2_pwm;
PWM_DATATYPE brightness = PWM_GET(pwm1_levels, level);
PWM_DATATYPE top = PWM_GET(pwm_tops, level);
@@ -136,10 +126,6 @@ void set_level_blend(uint8_t level) {
}
void set_level_auto(uint8_t level) {
- if (0 == level)
- return set_pwms(0, 0, PWM_TOP_INIT);
-
- level --;
PWM_DATATYPE ch1_pwm, ch2_pwm;
PWM_DATATYPE brightness = PWM_GET(pwm1_levels, level);
PWM_DATATYPE top = PWM_GET(pwm_tops, level);