diff options
| author | Selene ToyKeeper | 2023-07-10 11:56:04 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-07-10 11:56:04 -0600 |
| commit | 95a9eb6b3078915a2686c7ec55320273ef429838 (patch) | |
| tree | b185eca82ac208bf75e732a2ee300ab99eda0bbb /hwdef-emisar-2ch.c | |
| parent | Partially fixed oscillating aux LED voltage colors while asleep. (diff) | |
| download | anduril-95a9eb6b3078915a2686c7ec55320273ef429838.tar.gz anduril-95a9eb6b3078915a2686c7ec55320273ef429838.tar.bz2 anduril-95a9eb6b3078915a2686c7ec55320273ef429838.zip | |
refactored how channel modes are defined, and converted emisar-2ch build
Diffstat (limited to 'hwdef-emisar-2ch.c')
| -rw-r--r-- | hwdef-emisar-2ch.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/hwdef-emisar-2ch.c b/hwdef-emisar-2ch.c index 53117e0..427509f 100644 --- a/hwdef-emisar-2ch.c +++ b/hwdef-emisar-2ch.c @@ -3,6 +3,52 @@ // SPDX-License-Identifier: GPL-3.0-or-later #pragma once +#include "chan-rgbaux.c" + + +void set_level_ch1(uint8_t level); +void set_level_ch2(uint8_t level); +void set_level_both(uint8_t level); +void set_level_blend(uint8_t level); +void set_level_auto(uint8_t level); + +bool gradual_tick_ch1(uint8_t gt); +bool gradual_tick_ch2(uint8_t gt); +bool gradual_tick_both(uint8_t gt); +bool gradual_tick_blend(uint8_t gt); +bool gradual_tick_auto(uint8_t gt); + + +Channel channels[] = { + { // channel 1 only + .set_level = set_level_ch1, + .gradual_tick = gradual_tick_ch1, + .has_args = 0 + }, + { // channel 2 only + .set_level = set_level_ch2, + .gradual_tick = gradual_tick_ch2, + .has_args = 0 + }, + { // both channels, tied together (max "200%" power) + .set_level = set_level_both, + .gradual_tick = gradual_tick_both, + .has_args = 0 + }, + { // both channels, manual blend (max "100%" power) + .set_level = set_level_blend, + .gradual_tick = gradual_tick_blend, + .has_args = 1 + }, + { // both channels, auto blend + .set_level = set_level_auto, + .gradual_tick = gradual_tick_auto, + .has_args = 1 + }, + RGB_AUX_CHANNELS +}; + + // set new values for both channels, // handling any possible combination // and any before/after state |
