From 5c2fc000a5081b203174b79d09044665fd0483ff Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 22 Jul 2023 18:08:12 -0600 Subject: 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) --- hwdef-noctigon-dm11-boost.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'hwdef-noctigon-dm11-boost.c') 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); -- cgit v1.2.3