From 933842067df08e7d0515049509bdd3fa73b334e1 Mon Sep 17 00:00:00 2001 From: WarmCat Date: Thu, 10 May 2018 16:28:58 +0100 Subject: Backlight and RGB now working for JJ50 (#2929) * Added support for JJ50 from KPRepublic, no rgb or backlight control yet. Added as a layout of ymd96 at the moment (same microprocessor). Basic keymap with three layers to get started. * Added support for JJ50 * Tidied up jj50 code, backlight and RGB is now working. * Renaming "KEYMAP" to "LAYOUT" to adhere to the new QMK standards. --- keyboards/jj50/jj50.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 6 deletions(-) (limited to 'keyboards/jj50/jj50.c') diff --git a/keyboards/jj50/jj50.c b/keyboards/jj50/jj50.c index a75b12c4e..d4a70f68d 100644 --- a/keyboards/jj50/jj50.c +++ b/keyboards/jj50/jj50.c @@ -16,7 +16,6 @@ along with this program. If not, see . */ #include "jj50.h" -#include "rgblight.h" #include @@ -24,22 +23,72 @@ along with this program. If not, see . #include "i2c.h" #include "quantum.h" +#include "backlight.h" +#include "backlight_custom.h" + +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + matrix_init_user(); +} + +#ifdef BACKLIGHT_ENABLE +/// Overrides functions in `quantum.c` +void backlight_init_ports(void) { + b_led_init_ports(); +} + +void backlight_task(void) { + b_led_task(); +} + +void backlight_set(uint8_t level) { + b_led_set(level); +} +#endif + +#ifdef RGBLIGHT_ENABLE extern rgblight_config_t rgblight_config; +// custom RGB driver void rgblight_set(void) { if (!rgblight_config.enable) { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { + for (uint8_t i=0; i