Skip to content

Commit

Permalink
Fix keymaps, fix RGB matrix layout, add WS2812 support
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNguyen168 committed Oct 31, 2021
1 parent 5621c6b commit d556898
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 47 deletions.
39 changes: 0 additions & 39 deletions keyboards/canary/canary60rgb/canary60rgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@
*/
#include "canary60rgb.h"

typedef void (*rgb_func_pointer)(void);

static void __attribute__((noinline)) handleKeycodeRGB(const uint8_t is_shifted, const rgb_func_pointer inc_func, const rgb_func_pointer dec_func) {
if (is_shifted) {
dec_func();
} else {
inc_func();
}
}

#ifdef RGB_MATRIX_ENABLE
const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = {
{ 0, J_14, K_14, L_14 },
Expand Down Expand Up @@ -125,32 +115,3 @@ void rgb_matrix_indicators_user(void) {
}
}
#endif

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
uint8_t shifted = get_mods() & MOD_MASK_SHIFT;
if (record->event.pressed) {
switch (keycode) {
case BL_ON:
handleKeycodeRGB(shifted, rgblight_increase_hue, rgblight_decrease_hue);
return false;
case BL_OFF:
handleKeycodeRGB(shifted, rgblight_decrease_hue, rgblight_increase_hue);
return false;
case BL_DEC:
handleKeycodeRGB(shifted, rgblight_decrease_val, rgblight_increase_val);
return false;
case BL_INC:
handleKeycodeRGB(shifted, rgblight_increase_val, rgblight_decrease_val);
return false;
case BL_TOGG:
rgblight_toggle();
return false;
case BL_STEP:
handleKeycodeRGB(shifted, rgblight_step, rgblight_step_reverse);
return false;
default:
return true; // Process all other keycodes normally
}
}
return true;
}
2 changes: 1 addition & 1 deletion keyboards/canary/canary60rgb/info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"keyboard_name": "CANARY60RGB",
"url": "",
"maintainer": "canary",
"maintainer": "tuananhnguyen204",
"layouts": {
"LAYOUT": {
"layout": [
Expand Down
2 changes: 1 addition & 1 deletion keyboards/canary/canary60rgb/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, RESET,
_______, _______, _______, _______, _______, _______, _______, _______, RGB_SPI, RGB_SPD, _______, _______, EEP_RST,
_______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, BL_ON, BL_OFF, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______
),
[3] = LAYOUT(
Expand Down
2 changes: 1 addition & 1 deletion keyboards/canary/canary60rgb/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, RESET,
_______, _______, _______, _______, _______, _______, _______, _______, RGB_SPI, RGB_SPD, _______, _______, EEP_RST,
_______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, BL_ON, BL_OFF, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______
),
[3] = LAYOUT(
Expand Down
8 changes: 4 additions & 4 deletions keyboards/canary/canary60rgb/readme.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# CANARY60RGB
# Canary60RGB

![canary60rgb1](https://github.com/AnthonyNguyen168/keyboards/blob/main/2.jpg)
![canary60rgb2](https://github.com/AnthonyNguyen168/keyboards/blob/main/3.jpg)

A hotswap 60% RGB keyboard.

* Keyboard Maintainer: [AnthonyNguyen168](https://github.com/AnthonyNguyen168)
* Hardware Supported: CanaryTeam CANARY60RGB V1
* Hardware Availability: [CanaryTeam](https://www.facebook.com/CanaryTeam/) (https://shopee.vn/M%E1%BA%A1ch-b%C3%A0n-ph%C3%ADm-Canary60RGB-PCB-Layout-60--i.196623820.5093520199)
* Keyboard Maintainer: [tuananhnguyen204](https://github.com/AnthonyNguyen168) ([email protected])
* Hardware Supported: CanaryTeam Canary60RGB V1
* Hardware Availability: [CanaryTeam](https://www.facebook.com/CanaryTeam/), [Shopee](https://shopee.vn/search?keyword=canary60rgb)
* To reset the board into bootloader mode: press Reset hardware button or hold FN + Backslash (layer 1 RESET key)


Expand Down
1 change: 0 additions & 1 deletion keyboards/canary/canary60rgb/v1/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
# define RGBLIGHT_SAT_STEP 8
# define RGBLIGHT_VAL_STEP 8
# define RGBLIGHT_SLEEP
# define RGBLIGHT_DISABLE_KEYCODES
#endif

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
Expand Down

0 comments on commit d556898

Please sign in to comment.