aboutsummaryrefslogtreecommitdiff
path: root/hwdef-emisar-2ch-fet.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-08-24 17:08:01 -0600
committerSelene ToyKeeper2023-08-24 17:08:01 -0600
commit04a48e44b25d1c42dc26f837586a7503bb74b749 (patch)
treefb4b0536ef8d9b05fa606d5ab082a30addf08781 /hwdef-emisar-2ch-fet.c
parentfixed issue where tactical mode overrode strobe group memory (diff)
downloadanduril-04a48e44b25d1c42dc26f837586a7503bb74b749.tar.gz
anduril-04a48e44b25d1c42dc26f837586a7503bb74b749.tar.bz2
anduril-04a48e44b25d1c42dc26f837586a7503bb74b749.zip
added channel mode per strobe mode, and made FSM channel mode more flexible,
and fixed issue in tactical mode where strobes wouldn't stop on button release
Diffstat (limited to 'hwdef-emisar-2ch-fet.c')
-rw-r--r--hwdef-emisar-2ch-fet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hwdef-emisar-2ch-fet.c b/hwdef-emisar-2ch-fet.c
index ea4f5e6..7cf48d3 100644
--- a/hwdef-emisar-2ch-fet.c
+++ b/hwdef-emisar-2ch-fet.c
@@ -134,7 +134,7 @@ void set_level_blend(uint8_t level) {
//uint16_t brightness = PWM_GET8 (pwm1_levels, level) << 1;
uint16_t brightness = PWM_GET8 (pwm1_levels, level) + pwm3;
uint16_t top = PWM_GET16(pwm3_levels, level);
- uint8_t blend = cfg.channel_mode_args[cfg.channel_mode];
+ uint8_t blend = cfg.channel_mode_args[channel_mode];
calc_2ch_blend(&pwm1, &pwm2, brightness, top, blend);
@@ -150,7 +150,7 @@ void set_level_auto(uint8_t level) {
uint8_t brightness = PWM_GET8 (pwm4_levels, level);
uint16_t top = PWM_GET16(pwm5_levels, level);
uint8_t blend = 255 * (uint16_t)level / RAMP_SIZE;
- if (cfg.channel_mode_args[cfg.channel_mode] & 0b01000000)
+ if (cfg.channel_mode_args[channel_mode] & 0b01000000)
blend = 255 - blend;
calc_2ch_blend(&pwm1, &pwm2, brightness, top, blend);
@@ -197,7 +197,7 @@ bool gradual_tick_blend(uint8_t level) {
//uint16_t brightness = PWM_GET8 (pwm1_levels, level) << 1;
uint16_t brightness = PWM_GET8 (pwm1_levels, level) + pwm3;
uint16_t top = PWM_GET16(pwm3_levels, level);
- uint8_t blend = cfg.channel_mode_args[cfg.channel_mode];
+ uint8_t blend = cfg.channel_mode_args[channel_mode];
calc_2ch_blend(&pwm1, &pwm2, brightness, top, blend);
@@ -209,7 +209,7 @@ bool gradual_tick_auto(uint8_t level) {
uint8_t brightness = PWM_GET8 (pwm4_levels, level);
uint16_t top = PWM_GET16(pwm5_levels, level);
uint8_t blend = 255 * (uint16_t)level / RAMP_SIZE;
- if (cfg.channel_mode_args[cfg.channel_mode] & 0b01000000)
+ if (cfg.channel_mode_args[channel_mode] & 0b01000000)
blend = 255 - blend;
calc_2ch_blend(&pwm1, &pwm2, brightness, top, blend);