From 95a9eb6b3078915a2686c7ec55320273ef429838 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 10 Jul 2023 11:56:04 -0600 Subject: refactored how channel modes are defined, and converted emisar-2ch build --- hwdef-emisar-2ch.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'hwdef-emisar-2ch.c') 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 -- cgit v1.2.3