diff options
| author | Selene ToyKeeper | 2023-11-02 17:16:25 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-11-02 17:16:25 -0600 |
| commit | 7cb4fe0944b839f28dfd96a88a772cd6a8b58019 (patch) | |
| tree | 8d3b203f1650edc28b1f67e1589e3bc870b33fa6 /hwdef-noctigon-k1.c | |
| parent | added LICENSE (GPLv3) (diff) | |
| download | anduril-7cb4fe0944b839f28dfd96a88a772cd6a8b58019.tar.gz anduril-7cb4fe0944b839f28dfd96a88a772cd6a8b58019.tar.bz2 anduril-7cb4fe0944b839f28dfd96a88a772cd6a8b58019.zip | |
reorganized project files (part 1)
(just moved files, didn't change the contents yet,
and nothing will work without updating #includes and build scripts and stuff)
Diffstat (limited to 'hwdef-noctigon-k1.c')
| -rw-r--r-- | hwdef-noctigon-k1.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/hwdef-noctigon-k1.c b/hwdef-noctigon-k1.c deleted file mode 100644 index 5d61860..0000000 --- a/hwdef-noctigon-k1.c +++ /dev/null @@ -1,65 +0,0 @@ -// Noctigon K1 PWM helper functions -// Copyright (C) 2019-2023 Selene ToyKeeper -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include "chan-rgbaux.c" - -void set_level_zero(); - -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 -}; - - -void set_level_zero() { - CH1_PWM = 0; - //CH2_PWM = 0; - //PWM_CNT = 0; // reset phase - CH1_ENABLE_PORT &= ~(1 << CH1_ENABLE_PIN); // disable opamp -} - -// single LED with 1 power channels, linear -void set_level_main(uint8_t level) { - CH1_ENABLE_PORT |= (1 << CH1_ENABLE_PIN); // enable opamp - - 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 - //uint16_t top = PWM_GET16(pwm_tops, level); - - CH1_PWM = ch1_pwm; - //CH2_PWM = ch2_pwm; - // wait to sync the counter and avoid flashes - //while(actual_level && (PWM_CNT > (top - 32))) {} - //PWM_TOP = top; - // force reset phase when turning on from zero - // (because otherwise the initial response is inconsistent) - //if (! actual_level) PWM_CNT = 0; -} - -bool gradual_tick_main(uint8_t gt) { - PWM_DATATYPE pwm1 = PWM_GET(pwm1_levels, gt); - //PWM_DATATYPE pwm2 = PWM_GET(pwm2_levels, gt); - - GRADUAL_ADJUST_SIMPLE (pwm1, CH1_PWM); - //GRADUAL_ADJUST_STACKED(pwm1, CH1_PWM, PWM_TOP_INIT); - //GRADUAL_ADJUST_SIMPLE (pwm2, CH2_PWM); - - if ( (pwm1 == CH1_PWM) - // && (pwm2 == CH2_PWM) - ) { - return true; // done - } - return false; // not done yet -} - |
