aboutsummaryrefslogtreecommitdiff
path: root/hwdef-wurkkos-ts10.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-08-29 12:55:27 -0600
committerSelene ToyKeeper2023-08-29 12:55:27 -0600
commit158ad8bc28a578874e0906c0f2416ef8e5fa8446 (patch)
tree08ef6d3d7803e61ebf3b2ac700956d2d3939314c /hwdef-wurkkos-ts10.c
parentmade smooth steps look more natural (especially when turning off) (diff)
downloadanduril-158ad8bc28a578874e0906c0f2416ef8e5fa8446.tar.gz
anduril-158ad8bc28a578874e0906c0f2416ef8e5fa8446.tar.bz2
anduril-158ad8bc28a578874e0906c0f2416ef8e5fa8446.zip
renamed wurkkos-ts10-rgb to wurkkos-ts10-rgbaux
(for consistency, and in case they ever make a full RGB version) (also, raised the post-off voltage brightness threshold, because these aux LEDs are pretty bright) (and updated the TS10 hwdef to the current API)
Diffstat (limited to 'hwdef-wurkkos-ts10.c')
-rw-r--r--hwdef-wurkkos-ts10.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hwdef-wurkkos-ts10.c b/hwdef-wurkkos-ts10.c
index 44602c0..06f5bac 100644
--- a/hwdef-wurkkos-ts10.c
+++ b/hwdef-wurkkos-ts10.c
@@ -6,6 +6,8 @@
#include "chan-aux.c"
+void set_level_zero();
+
void set_level_main(uint8_t level);
bool gradual_tick_main(uint8_t gt);
@@ -22,16 +24,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