diff options
Diffstat (limited to 'keyboards/nullbitsco/snap')
-rw-r--r-- | keyboards/nullbitsco/snap/config.h | 10 | ||||
-rw-r--r-- | keyboards/nullbitsco/snap/info.json | 20 | ||||
-rw-r--r-- | keyboards/nullbitsco/snap/keymaps/bongo_reactive/keymap.c | 14 | ||||
-rw-r--r-- | keyboards/nullbitsco/snap/keymaps/oled/keymap.c | 14 | ||||
-rw-r--r-- | keyboards/nullbitsco/snap/keymaps/typehud/keymap.c | 14 |
5 files changed, 41 insertions, 31 deletions
diff --git a/keyboards/nullbitsco/snap/config.h b/keyboards/nullbitsco/snap/config.h index 24e9340c0e..e859b5b47d 100644 --- a/keyboards/nullbitsco/snap/config.h +++ b/keyboards/nullbitsco/snap/config.h @@ -58,10 +58,6 @@ #define MATRIX_EXT_PIN_RIGHT B6 /* Optional SMT LED pins */ -#define RGBLED_NUM 10 -#define RGBLED_SPLIT { 5, 5 } -#define RGBLIGHT_LED_MAP { 8, 9, 0, 1, 2, 6, 7, 3, 4, 5 } -#define RGBLIGHT_SLEEP #define RGBLIGHT_EFFECT_BREATHING #define RGBLIGHT_EFFECT_RAINBOW_MOOD #define RGBLIGHT_EFFECT_RAINBOW_SWIRL @@ -73,12 +69,6 @@ #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE -/* Optional encoder pins */ -#define ENCODERS_PAD_A { B3 } -#define ENCODERS_PAD_B { B1 } -#define ENCODERS_PAD_A_RIGHT { B4 } -#define ENCODERS_PAD_B_RIGHT { B5 } - /* Optional speaker pin */ #define AUDIO_PIN B6 diff --git a/keyboards/nullbitsco/snap/info.json b/keyboards/nullbitsco/snap/info.json index 560389a11f..97b06b5b34 100644 --- a/keyboards/nullbitsco/snap/info.json +++ b/keyboards/nullbitsco/snap/info.json @@ -7,6 +7,26 @@ "pid": "0x6063", "device_version": "0.0.1" }, + "encoder": { + "rotary": [ + {"pin_a": "B3", "pin_b": "B1"} + ] + }, + "rgblight": { + "led_count": 10, + "sleep": true, + "led_map": [8, 9, 0, 1, 2, 6, 7, 3, 4, 5], + "split_count": [5, 5] + }, + "split": { + "encoder": { + "right": { + "rotary": [ + {"pin_a": "B4", "pin_b": "B5"} + ] + } + } + }, "ws2812": { "pin": "B2" }, diff --git a/keyboards/nullbitsco/snap/keymaps/bongo_reactive/keymap.c b/keyboards/nullbitsco/snap/keymaps/bongo_reactive/keymap.c index 31e58c24a6..3dfe7e4057 100644 --- a/keyboards/nullbitsco/snap/keymaps/bongo_reactive/keymap.c +++ b/keyboards/nullbitsco/snap/keymaps/bongo_reactive/keymap.c @@ -87,27 +87,27 @@ static void render_status(void) { // Host Keyboard LED Status oled_set_cursor(0, 1); - static uint8_t persistent_led_state = 0; - uint8_t led_usb_state = host_keyboard_leds(); + static led_t persistent_led_state = {0}; + led_t led_state = host_keyboard_led_state(); // Only update if the LED state has changed // Otherwise, the OLED will not turn off if an LED is on. - if (persistent_led_state != led_usb_state) { - persistent_led_state = led_usb_state; + if (persistent_led_state != led_state) { + persistent_led_state = led_state; oled_write_ln_P(PSTR(""), false); - if (IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK)) { + if (led_state.caps_lock) { oled_set_cursor(0, 1); oled_write_P(PSTR("CAPS"), false); } - if (IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK)) { + if (led_state.num_lock) { oled_set_cursor(5, 1); oled_write_P(PSTR("NUM"), true); } - if (IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK)) { + if (led_state.scroll_lock) { oled_set_cursor(9, 1); oled_write_P(PSTR("SCR"), false); } diff --git a/keyboards/nullbitsco/snap/keymaps/oled/keymap.c b/keyboards/nullbitsco/snap/keymaps/oled/keymap.c index 3a48e90134..004d2f40c1 100644 --- a/keyboards/nullbitsco/snap/keymaps/oled/keymap.c +++ b/keyboards/nullbitsco/snap/keymaps/oled/keymap.c @@ -114,27 +114,27 @@ static void render_status(void) { // Host Keyboard LED Status oled_set_cursor(0, 1); - static uint8_t persistent_led_state = 0; - uint8_t led_usb_state = host_keyboard_leds(); + static led_t persistent_led_state = {0}; + led_t led_state = host_keyboard_led_state(); // Only update if the LED state has changed // Otherwise, the OLED will not turn off if an LED is on. - if (persistent_led_state != led_usb_state) { - persistent_led_state = led_usb_state; + if (persistent_led_state != led_state) { + persistent_led_state = led_state; oled_write_ln_P(PSTR(""), false); - if (IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK)) { + if (led_state.caps_lock) { oled_set_cursor(0, 1); oled_write_P(PSTR("CAPS"), false); } - if (IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK)) { + if (led_state.num_lock) { oled_set_cursor(5, 1); oled_write_P(PSTR("NUM"), true); } - if (IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK)) { + if (led_state.scroll_lock) { oled_set_cursor(9, 1); oled_write_P(PSTR("SCR"), false); } diff --git a/keyboards/nullbitsco/snap/keymaps/typehud/keymap.c b/keyboards/nullbitsco/snap/keymaps/typehud/keymap.c index 50e164f408..afdc5333ee 100644 --- a/keyboards/nullbitsco/snap/keymaps/typehud/keymap.c +++ b/keyboards/nullbitsco/snap/keymaps/typehud/keymap.c @@ -94,27 +94,27 @@ static void render_status(void) { // Host Keyboard LED Status oled_set_cursor(0, 1); - static uint8_t persistent_led_state = 0; - uint8_t led_usb_state = host_keyboard_leds(); + static led_t persistent_led_state = {0}; + led_t led_state = host_keyboard_led_state(); // Only update if the LED state has changed // Otherwise, the OLED will not turn off if an LED is on. - if (persistent_led_state != led_usb_state) { - persistent_led_state = led_usb_state; + if (persistent_led_state != led_state) { + persistent_led_state = led_state; oled_write_ln_P(PSTR(" "), false); - if (IS_LED_ON(led_usb_state, USB_LED_CAPS_LOCK)) { + if (led_state.caps_lock) { oled_set_cursor(0, 1); oled_write_P(PSTR("CAPS"), false); } - if (IS_LED_ON(led_usb_state, USB_LED_NUM_LOCK)) { + if (led_state.num_lock) { oled_set_cursor(5, 1); oled_write_P(PSTR("NUM"), true); } - if (IS_LED_ON(led_usb_state, USB_LED_SCROLL_LOCK)) { + if (led_state.scroll_lock) { oled_set_cursor(9, 1); oled_write_P(PSTR("SCR"), false); } |