aboutsummaryrefslogtreecommitdiff
path: root/hwdef-noctigon-dm11-boost.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-07-22 18:08:12 -0600
committerSelene ToyKeeper2023-07-22 18:08:12 -0600
commit5c2fc000a5081b203174b79d09044665fd0483ff (patch)
tree61cd52b973753b8439e2e2371cf9452565ec496b /hwdef-noctigon-dm11-boost.c
parentconverted noctigon-k1 to multi-channel (diff)
downloadanduril-5c2fc000a5081b203174b79d09044665fd0483ff.tar.gz
anduril-5c2fc000a5081b203174b79d09044665fd0483ff.tar.bz2
anduril-5c2fc000a5081b203174b79d09044665fd0483ff.zip
converted noctigon-dm11-* builds to multi-channel
(but I could only test dm11-boost on actual hardware) (also, it looks like dm11-sbt90 is almost identical to the base kr4 build, so I removed its hwdef)
Diffstat (limited to 'hwdef-noctigon-dm11-boost.c')
-rw-r--r--hwdef-noctigon-dm11-boost.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/hwdef-noctigon-dm11-boost.c b/hwdef-noctigon-dm11-boost.c
index 2ea8f07..006cbf8 100644
--- a/hwdef-noctigon-dm11-boost.c
+++ b/hwdef-noctigon-dm11-boost.c
@@ -6,18 +6,31 @@
#include "chan-rgbaux.c"
+void set_level_main(uint8_t level);
+bool gradual_tick_main(uint8_t gt);
+
+
+Channel channels[] = {
+ { // channel 1 only
+ .set_level = set_level_main,
+ .gradual_tick = gradual_tick_main
+ },
+ RGB_AUX_CHANNELS
+};
+
+
// single set of LEDs with single power channel, boost
void set_level_main(uint8_t level) {
if (level == 0) {
CH1_PWM = 0;
PWM_CNT = 0; // reset phase
- LED_ENABLE_PORT &= ~(1 << LED_ENABLE_PIN ); // disable opamp
- LED_ENABLE_PORT2 &= ~(1 << LED_ENABLE_PIN2); // disable PMIC
+ CH1_ENABLE_PORT &= ~(1 << CH1_ENABLE_PIN ); // disable opamp
+ CH1_ENABLE_PORT2 &= ~(1 << CH1_ENABLE_PIN2); // disable PMIC
return;
}
- LED_ENABLE_PORT |= (1 << LED_ENABLE_PIN ); // enable opamp
- LED_ENABLE_PORT2 |= (1 << LED_ENABLE_PIN2); // enable PMIC
+ CH1_ENABLE_PORT |= (1 << CH1_ENABLE_PIN ); // enable opamp
+ CH1_ENABLE_PORT2 |= (1 << CH1_ENABLE_PIN2); // enable PMIC
level --; // PWM array index = level - 1
PWM_DATATYPE ch1_pwm = PWM_GET(pwm1_levels, level);