From becb1525aadc1039a99ecdc6f7ae5cf3a1beb2fb Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 28 Apr 2023 03:06:22 -0600 Subject: D4v2 FET+1 model: works again, and now uses dynamic PWM (lower lows) (also added generic channel modes for RGB aux LEDs) --- spaghetti-monster/chan-rgbaux.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spaghetti-monster/chan-rgbaux.c (limited to 'spaghetti-monster/chan-rgbaux.c') diff --git a/spaghetti-monster/chan-rgbaux.c b/spaghetti-monster/chan-rgbaux.c new file mode 100644 index 0000000..355f246 --- /dev/null +++ b/spaghetti-monster/chan-rgbaux.c @@ -0,0 +1,19 @@ +// channel modes for RGB aux LEDs +// Copyright (C) 2023 Selene ToyKeeper +// SPDX-License-Identifier: GPL-3.0-or-later +#pragma once + +void set_level_auxred(uint8_t level) { + rgb_led_set(!(!(level)) << 1); // red, high (or off) +} + +void set_level_auxgrn(uint8_t level) { + rgb_led_set(!(!(level)) << 3); // green, high (or off) +} + +void set_level_auxblu(uint8_t level) { + rgb_led_set(!(!(level)) << 5); // blue, high (or off) +} + +bool gradual_tick_null(uint8_t gt) { return true; } // do nothing + -- cgit v1.2.3 From fbed17d3260d1fca312d655818cc2394654615aa Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 2 May 2023 08:47:42 -0600 Subject: D4v2: added the rest of the aux RGB colors as channel modes, and set aux "white" as the mode it uses to blink out numbers --- spaghetti-monster/chan-rgbaux.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'spaghetti-monster/chan-rgbaux.c') diff --git a/spaghetti-monster/chan-rgbaux.c b/spaghetti-monster/chan-rgbaux.c index 355f246..19d18a6 100644 --- a/spaghetti-monster/chan-rgbaux.c +++ b/spaghetti-monster/chan-rgbaux.c @@ -4,15 +4,31 @@ #pragma once void set_level_auxred(uint8_t level) { - rgb_led_set(!(!(level)) << 1); // red, high (or off) + rgb_led_set(!(!(level)) * 0b000010); // red, high (or off) +} + +void set_level_auxyel(uint8_t level) { + rgb_led_set(!(!(level)) * 0b001010); // red+green, high (or off) } void set_level_auxgrn(uint8_t level) { - rgb_led_set(!(!(level)) << 3); // green, high (or off) + rgb_led_set(!(!(level)) * 0b001000); // green, high (or off) +} + +void set_level_auxcyn(uint8_t level) { + rgb_led_set(!(!(level)) * 0b101000); // green+blue, high (or off) } void set_level_auxblu(uint8_t level) { - rgb_led_set(!(!(level)) << 5); // blue, high (or off) + rgb_led_set(!(!(level)) * 0b100000); // blue, high (or off) +} + +void set_level_auxprp(uint8_t level) { + rgb_led_set(!(!(level)) * 0b100010); // red+blue, high (or off) +} + +void set_level_auxwht(uint8_t level) { + rgb_led_set(!(!(level)) * 0b101010); // red+green+blue, high (or off) } bool gradual_tick_null(uint8_t gt) { return true; } // do nothing -- cgit v1.2.3