summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprofanum429 <profanum429@gmail.com>2018-01-04 07:20:58 +0100
committerJack Humbert <jack.humb@gmail.com>2018-01-04 07:20:58 +0100
commit9e0b244a34d28aa2a03f2bf87919af4f25e5e96f (patch)
tree85b37f2fd7bb554f429d1901709ab03acde23229
parent4b7fcf0af06070fc184350e9639f4da07210fc3d (diff)
downloadqmk_firmware-9e0b244a34d28aa2a03f2bf87919af4f25e5e96f.tar.gz
qmk_firmware-9e0b244a34d28aa2a03f2bf87919af4f25e5e96f.tar.xz
profanum429@gmail.com (#2222)
* Added initial in-switch LED support for the Eagle/Viper V2. Currently only has four modes: All ON, Mods/Nums ON, Alphas ON, or All OFF * Revert keymap changes * Changed switch curly bracket to match style.
-rw-r--r--keyboards/eagle_viper/v2/config.h2
-rw-r--r--keyboards/eagle_viper/v2/v2.c41
2 files changed, 21 insertions, 22 deletions
diff --git a/keyboards/eagle_viper/v2/config.h b/keyboards/eagle_viper/v2/config.h
index 0538f9620..f04b4a0fd 100644
--- a/keyboards/eagle_viper/v2/config.h
+++ b/keyboards/eagle_viper/v2/config.h
@@ -38,7 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEBOUNCING_DELAY 5
/* number of backlight levels */
-#define BACKLIGHT_LEVELS 1
+#define BACKLIGHT_LEVELS 3
/* key combination for magic key command */
#define IS_COMMAND() ( \
diff --git a/keyboards/eagle_viper/v2/v2.c b/keyboards/eagle_viper/v2/v2.c
index 2d7fe1a20..a60acb978 100644
--- a/keyboards/eagle_viper/v2/v2.c
+++ b/keyboards/eagle_viper/v2/v2.c
@@ -17,30 +17,29 @@
#include "indicator_leds.h"
enum BACKLIGHT_AREAS {
- BACKLIGHT_ALPHA = 0b0000001,
- BACKLIGHT_EXTRA = 0b0000010,
- BACKLIGHT_MODNUM = 0b0000100,
- BACKLIGHT_FROW = 0b0001000,
- BACKLIGHT_RGB = 0b0010000,
- BACKLIGHT_SWITCH = 0b0001111
+ BACKLIGHT_ALPHAS = 0b00000010,
+ BACKLIGHT_MODNUM = 0b00001000
};
-uint8_t backlight_rgb_r = 255;
-uint8_t backlight_rgb_g = 0;
-uint8_t backlight_rgb_b = 0;
-
void backlight_set(uint8_t level) {
-/*
- * DISABLE for now -> this causes issues with initial rgb setup
- */
-
-/*
- level & BACKLIGHT_ALPHA ? (PORTB |= 0b00000010) : (PORTB &= ~0b00000010);
- level & BACKLIGHT_EXTRA ? (PORTB |= 0b00000100) : (PORTB &= ~0b00000100);
- level & BACKLIGHT_MODNUM ? (PORTB |= 0b00001000) : (PORTB &= ~0b00001000);
- level & BACKLIGHT_FROW ? (PORTE |= 0b01000000) : (PORTE &= ~0b01000000);
- level & BACKLIGHT_RGB ? backlight_toggle_rgb(true) : backlight_toggle_rgb(false);
-*/
+ switch(level) {
+ case 0:
+ PORTB |= BACKLIGHT_ALPHAS;
+ PORTB |= BACKLIGHT_MODNUM;
+ break;
+ case 1:
+ PORTB &= ~BACKLIGHT_ALPHAS;
+ PORTB |= BACKLIGHT_MODNUM;
+ break;
+ case 2:
+ PORTB |= BACKLIGHT_ALPHAS;
+ PORTB &= ~BACKLIGHT_MODNUM;
+ break;
+ case 3:
+ PORTB &= ~BACKLIGHT_ALPHAS;
+ PORTB &= ~BACKLIGHT_MODNUM;
+ break;
+ }
}
// Port from backlight_update_state