From 1720d63d174cb6f795f2c4b881d96e943ad00df4 Mon Sep 17 00:00:00 2001 From: nicarran Date: Sat, 6 Jul 2024 18:15:35 -0500 Subject: [PATCH 01/11] setup new keyboard folder royalkludge-rk61 copying nuphy-air60 --- src/keyboards/royalkludge-rk61/kbdef.h | 125 +++++++++++ .../layouts/default/indicators.c | 201 ++++++++++++++++++ .../royalkludge-rk61/layouts/default/layout.c | 107 ++++++++++ src/keyboards/royalkludge-rk61/user_init.c | 84 ++++++++ .../royalkludge-rk61/user_keyboard.c | 53 +++++ src/keyboards/royalkludge-rk61/user_matrix.c | 99 +++++++++ 6 files changed, 669 insertions(+) create mode 100644 src/keyboards/royalkludge-rk61/kbdef.h create mode 100644 src/keyboards/royalkludge-rk61/layouts/default/indicators.c create mode 100644 src/keyboards/royalkludge-rk61/layouts/default/layout.c create mode 100644 src/keyboards/royalkludge-rk61/user_init.c create mode 100644 src/keyboards/royalkludge-rk61/user_keyboard.c create mode 100644 src/keyboards/royalkludge-rk61/user_matrix.c diff --git a/src/keyboards/royalkludge-rk61/kbdef.h b/src/keyboards/royalkludge-rk61/kbdef.h new file mode 100644 index 0000000..a45c6a7 --- /dev/null +++ b/src/keyboards/royalkludge-rk61/kbdef.h @@ -0,0 +1,125 @@ +#ifndef KBDEF_H +#define KBDEF_H + +#include "sh68f90a.h" + +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +// Row Pin Bits +#define KB_R0_P7_1 _P7_1 +#define KB_R1_P7_2 _P7_2 +#define KB_R2_P7_3 _P7_3 +#define KB_R3_P5_3 _P5_3 +#define KB_R4_P5_4 _P5_4 + +// Row Pins +#define KB_R0 P7_1 +#define KB_R1 P7_2 +#define KB_R2 P7_3 +#define KB_R3 P5_3 +#define KB_R4 P5_4 + +// Column Pin Bits +#define KB_C0_P5_0 _P5_0 +#define KB_C1_P5_1 _P5_1 +#define KB_C2_P5_2 _P5_2 +#define KB_C3_P3_5 _P3_5 +#define KB_C4_P3_4 _P3_4 +#define KB_C5_P3_3 _P3_3 +#define KB_C6_P3_2 _P3_2 +#define KB_C7_P3_1 _P3_1 +#define KB_C8_P3_0 _P3_0 +#define KB_C9_P2_5 _P2_5 +#define KB_C10_P2_4 _P2_4 +#define KB_C11_P2_3 _P2_3 +#define KB_C12_P2_2 _P2_2 +#define KB_C13_P2_1 _P2_1 +#define KB_C14_P2_0 _P2_0 +#define KB_C15_P1_5 _P1_5 + +// Column Pins +#define KB_C0 P5_0 +#define KB_C1 P5_1 +#define KB_C2 P5_2 +#define KB_C3 P3_5 +#define KB_C4 P3_4 +#define KB_C5 P3_3 +#define KB_C6 P3_2 +#define KB_C7 P3_1 +#define KB_C8 P3_0 +#define KB_C9 P2_5 +#define KB_C10 P2_4 +#define KB_C11 P2_3 +#define KB_C12 P2_2 +#define KB_C13 P2_1 +#define KB_C14 P2_0 +#define KB_C15 P1_5 + +// LED PWM Registers +#define LED_PWM_C0 PWM40 +#define LED_PWM_C1 PWM41 +#define LED_PWM_C2 PWM42 +#define LED_PWM_C3 PWM05 +#define LED_PWM_C4 PWM04 +#define LED_PWM_C5 PWM03 +#define LED_PWM_C6 PWM02 +#define LED_PWM_C7 PWM01 +#define LED_PWM_C8 PWM00 +#define LED_PWM_C9 PWM15 +#define LED_PWM_C10 PWM14 +#define LED_PWM_C11 PWM13 +#define LED_PWM_C12 PWM12 +#define LED_PWM_C13 PWM11 +#define LED_PWM_C14 PWM10 +#define LED_PWM_C15 PWM25 + +// RGB Row Pins +#define RGB_R0R P0_4 +#define RGB_R0G P6_1 +#define RGB_R0B P0_3 +#define RGB_R1R P6_7 +#define RGB_R1G P6_2 +#define RGB_R1B P6_6 +#define RGB_R2R P0_2 +#define RGB_R2G P6_3 +#define RGB_R2B P5_7 +#define RGB_R3R P4_5 +#define RGB_R3G P6_4 +#define RGB_R3B P4_6 +#define RGB_R4R P4_4 +#define RGB_R4G P6_5 +#define RGB_R4B P4_3 +#define RGB_ULR P1_1 +#define RGB_ULG P1_2 +#define RGB_ULB P1_3 + +// RGB Row Pin Bits +#define RGB_R0R_P0_4 _P0_4 +#define RGB_R0G_P6_1 _P6_1 +#define RGB_R0B_P0_3 _P0_3 +#define RGB_R1R_P6_7 _P6_7 +#define RGB_R1G_P6_2 _P6_2 +#define RGB_R1B_P6_6 _P6_6 +#define RGB_R2R_P0_2 _P0_2 +#define RGB_R2G_P6_3 _P6_3 +#define RGB_R2B_P5_7 _P5_7 +#define RGB_R3R_P4_5 _P4_5 +#define RGB_R3G_P6_4 _P6_4 +#define RGB_R3B_P4_6 _P4_6 +#define RGB_R4R_P4_4 _P4_4 +#define RGB_R4G_P6_5 _P6_5 +#define RGB_R4B_P4_3 _P4_3 +#define RGB_ULR_P1_1 _P1_1 +#define RGB_ULG_P1_2 _P1_2 +#define RGB_ULB_P1_3 _P1_3 + +// Config Switch Pins +#define CONN_MODE_SWITCH P5_5 // 1 - USB, 0 - RF +#define OS_MODE_SWITCH P5_6 // 1 - MAC, 0 - WIN + +// Config Switch Pin Bits +#define CONN_MODE_SWITCH_P5_5 _P5_5 // 1 - USB, 0 - RF +#define OS_MODE_SWITCH_P5_6 _P5_6 // 1 - MAC, 0 - WIN + +#endif diff --git a/src/keyboards/royalkludge-rk61/layouts/default/indicators.c b/src/keyboards/royalkludge-rk61/layouts/default/indicators.c new file mode 100644 index 0000000..7b68687 --- /dev/null +++ b/src/keyboards/royalkludge-rk61/layouts/default/indicators.c @@ -0,0 +1,201 @@ +#include "indicators.h" +#include "kbdef.h" +#include "pwm.h" +#include + +// TODO: move these defines out +#define PWM_CLK_DIV 0b010 // PWM_CLK = SYS_CLK / 4 +#define PWM_SS_BIT (1 << 3) +#define PWM_MOD_BIT (1 << 4) +#define PWM_INT_ENABLE_BIT (1 << 6) +#define PWM_MODE_ENABLE_BIT (1 << 7) + +void indicators_pwm_set_all_columns(uint16_t intensity); +void indicators_pwm_enable(); +void indicators_pwm_disable(); + +void indicators_start() +{ + indicators_pwm_enable(); +} + +void indicators_pre_update() +{ + // set all rgb sinks to low (animation step will enable needed ones) + P0 &= ~(RGB_R2R_P0_2 | RGB_R0B_P0_3 | RGB_R0R_P0_4); + P1 &= ~(RGB_ULR_P1_1 | RGB_ULG_P1_2 | RGB_ULB_P1_3); + P4 &= ~(RGB_R4B_P4_3 | RGB_R4R_P4_4 | RGB_R3R_P4_5 | RGB_R3B_P4_6); + P5 &= ~(RGB_R2B_P5_7); + P6 &= ~(RGB_R0G_P6_1 | RGB_R1G_P6_2 | RGB_R2G_P6_3 | RGB_R3G_P6_4 | RGB_R4G_P6_5 | RGB_R1B_P6_6 | RGB_R1R_P6_7); + + indicators_pwm_disable(); +} + +bool indicators_update_step(keyboard_state_t *keyboard, uint8_t current_step) +{ + static uint16_t current_cycle = 0; + + if (current_step == 0) { + if (current_cycle < 3072) { + current_cycle++; + } else { + current_cycle = 0; + } + } + + uint16_t red_intensity = 0; + uint16_t green_intensity = 0; + uint16_t blue_intensity = 0; + + if (current_cycle < 1024) { + blue_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle + 1024) % 2048) - 1024); + red_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle) % 2048) - 1024); + } else if (current_cycle < 2048) { + red_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle) % 2048) - 1024); + green_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle + 1024) % 2048) - 1024); + } else { + green_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle + 1024) % 2048) - 1024); + blue_intensity = 1024 - (uint16_t)abs((int16_t)((current_cycle) % 2048) - 1024); + } + + uint16_t color_intensity; + + if (keyboard->led_state & (1 << 0)) { // num_lock + red_intensity = 1024; + } + + if (keyboard->led_state & (1 << 1)) { // caps_lock + green_intensity = 1024; + } + + if (keyboard->led_state & (1 << 2)) { // scroll_lock + blue_intensity = 1024; + } + + switch (current_step % 3) { + case 0: // red + RGB_R0R = 1; + RGB_R1R = 1; + RGB_R2R = 1; + RGB_R3R = 1; + RGB_R4R = 1; + RGB_ULR = 1; + + color_intensity = red_intensity; + break; + + case 1: // green + RGB_R0G = 1; + RGB_R1G = 1; + RGB_R2G = 1; + RGB_R3G = 1; + RGB_R4G = 1; + RGB_ULG = 1; + + color_intensity = green_intensity; + break; + + case 2: // blue + RGB_R0B = 1; + RGB_R1B = 1; + RGB_R2B = 1; + RGB_R3B = 1; + RGB_R4B = 1; + RGB_ULB = 1; + + color_intensity = blue_intensity; + break; + + default: + // unreachable + color_intensity = 0; + break; + } + + // set pwm duty cycles to expected colors + indicators_pwm_set_all_columns(color_intensity); + + return false; +} + +void indicators_post_update() +{ + // clear pwm isr flag + PWM00CON &= ~(1 << 5); + + indicators_pwm_enable(); +} + +void indicators_pwm_set_all_columns(uint16_t intensity) +{ + uint16_t adjusted = 0x0400 - intensity; + + SET_PWM_DUTY_2(LED_PWM_C0, adjusted); + SET_PWM_DUTY_2(LED_PWM_C1, adjusted); + SET_PWM_DUTY_2(LED_PWM_C2, adjusted); + SET_PWM_DUTY_2(LED_PWM_C3, adjusted); + SET_PWM_DUTY_2(LED_PWM_C4, adjusted); + SET_PWM_DUTY_2(LED_PWM_C5, adjusted); + SET_PWM_DUTY_2(LED_PWM_C6, adjusted); + SET_PWM_DUTY_2(LED_PWM_C7, adjusted); + SET_PWM_DUTY_2(LED_PWM_C8, adjusted); + SET_PWM_DUTY_2(LED_PWM_C9, adjusted); + SET_PWM_DUTY_2(LED_PWM_C10, adjusted); + SET_PWM_DUTY_2(LED_PWM_C11, adjusted); + SET_PWM_DUTY_2(LED_PWM_C12, adjusted); + SET_PWM_DUTY_2(LED_PWM_C13, adjusted); + SET_PWM_DUTY_2(LED_PWM_C14, adjusted); + SET_PWM_DUTY_2(LED_PWM_C15, adjusted); +} + +void indicators_pwm_enable() +{ + // TODO: try abstracting individual banks away + PWM00CON = (uint8_t)(PWM_MODE_ENABLE_BIT | PWM_INT_ENABLE_BIT | PWM_SS_BIT | PWM_CLK_DIV); + PWM01CON = PWM_SS_BIT; + PWM02CON = PWM_SS_BIT; + PWM03CON = PWM_SS_BIT; + PWM04CON = PWM_SS_BIT; + PWM05CON = PWM_SS_BIT; + + PWM10CON = (uint8_t)(PWM_MODE_ENABLE_BIT | PWM_SS_BIT | PWM_CLK_DIV); + PWM11CON = PWM_SS_BIT; + PWM12CON = PWM_SS_BIT; + PWM13CON = PWM_SS_BIT; + PWM14CON = PWM_SS_BIT; + PWM15CON = PWM_SS_BIT; + + PWM20CON = (uint8_t)(PWM_MODE_ENABLE_BIT | PWM_SS_BIT | PWM_CLK_DIV); + // PWM24CON = PWM_SS_BIT; + PWM25CON = PWM_SS_BIT; + + PWM40CON = (uint8_t)(PWM_MODE_ENABLE_BIT | PWM_SS_BIT | PWM_CLK_DIV); + PWM41CON = PWM_SS_BIT; + PWM42CON = PWM_SS_BIT; +} + +void indicators_pwm_disable() +{ + // TODO: try abstracting individual banks away + PWM00CON = (uint8_t)(PWM_CLK_DIV); + PWM01CON = 0; + PWM02CON = 0; + PWM03CON = 0; + PWM04CON = 0; + PWM05CON = 0; + + PWM10CON = (uint8_t)(PWM_CLK_DIV); + PWM11CON = 0; + PWM12CON = 0; + PWM13CON = 0; + PWM14CON = 0; + PWM15CON = 0; + + PWM20CON = (uint8_t)(PWM_CLK_DIV); + // PWM24CON = 0; + PWM25CON = 0; + + PWM40CON = (uint8_t)(PWM_CLK_DIV); + PWM41CON = 0; + PWM42CON = 0; +} diff --git a/src/keyboards/royalkludge-rk61/layouts/default/layout.c b/src/keyboards/royalkludge-rk61/layouts/default/layout.c new file mode 100644 index 0000000..17316f5 --- /dev/null +++ b/src/keyboards/royalkludge-rk61/layouts/default/layout.c @@ -0,0 +1,107 @@ +#include "kbdef.h" +#include "layout.h" +#include "user_layout.h" +#include "report.h" +#include + +// clang-format off + +#define LAYOUT_60( \ + K00_0, K01_0, K02_0, K03_0, K04_0, K05_0, K06_0, K07_0, K08_0, K09_0, K10_0, K11_0, K12_0, K13_0, \ + K00_1, K01_1, K02_1, K03_1, K04_1, K05_1, K06_1, K07_1, K08_1, K09_1, K10_1, K11_1, K12_1, K13_1, \ + K00_2, K01_2, K02_2, K03_2, K04_2, K05_2, K06_2, K07_2, K08_2, K09_2, K10_2, K11_2, K13_2, \ + K00_3, K01_3, K02_3, K03_3, K04_3, K05_3, K06_3, K07_3, K08_3, K09_3, K10_3, K13_3, K14_3, K15_3, \ + K00_4, K01_4, K02_4, K05_4, K08_4, K09_4, K10_4, K13_4, K14_4 \ + ) { \ + { K00_0, K01_0, K02_0, K03_0, K04_0, K05_0, K06_0, K07_0, K08_0, K09_0, K10_0, K11_0, K12_0, K13_0, KC_NO, KC_NO }, \ + { K00_1, K01_1, K02_1, K03_1, K04_1, K05_1, K06_1, K07_1, K08_1, K09_1, K10_1, K11_1, K12_1, K13_1, KC_NO, KC_NO }, \ + { K00_2, K01_2, K02_2, K03_2, K04_2, K05_2, K06_2, K07_2, K08_2, K09_2, K10_2, K11_2, KC_NO, K13_2, KC_NO, KC_NO }, \ + { K00_3, K01_3, K02_3, K03_3, K04_3, K05_3, K06_3, K07_3, K08_3, K09_3, K10_3, KC_NO, KC_NO, K13_3, K14_3, K15_3 }, \ + { K00_4, K01_4, K02_4, KC_NO, KC_NO, K05_4, KC_NO, KC_NO, K08_4, K09_4, K10_4, KC_NO, KC_NO, K13_4, K14_4, KC_NO } \ +} + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +enum custom_keycodes { + SFT_ESC = SAFE_RANGE +}; + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp| + * |------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| Return| + * |------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shi| Up|Del| + * |------------------------------------------------------------| + * |Ctrl|Alt |Gui | Space |Gui|Fn |Lef|Dow|Rig| + * `------------------------------------------------------------' + */ + [_BL] = LAYOUT_60( + SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_LGUI, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Keymap _FL: (Base Layer) Function Layer + * ,------------------------------------------------------------. + * | ~ | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del | + * |------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |------------------------------------------------------------| + * | | | | | | | | | | | | | | + * |------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |------------------------------------------------------------| + * | | | | | | | | | | + * `------------------------------------------------------------' + */ + [_FL] = LAYOUT_60( + KC_GRV, 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, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +// clang-format on + +bool layout_process_record(uint16_t keycode, bool key_pressed) +{ + switch (keycode) { + case SFT_ESC: + if (key_pressed) { + if (get_mods() & MODS_SHIFT_MASK) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (get_mods() & MODS_SHIFT_MASK) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + + return false; + + default: + return true; + } +} diff --git a/src/keyboards/royalkludge-rk61/user_init.c b/src/keyboards/royalkludge-rk61/user_init.c new file mode 100644 index 0000000..2fb9f17 --- /dev/null +++ b/src/keyboards/royalkludge-rk61/user_init.c @@ -0,0 +1,84 @@ +#include "kbdef.h" +#include "user_init.h" +#include "pwm.h" + +// TODO: move these defines out +#define PWM_PERD 0x0400 // 1024 / PWM_CLK ~= 43 us + +#define PWM_DUTY1 (uint16_t) PWM_PERD +#define PWM_DUTY2 (uint16_t)0 + +#define PWM_PERDH_INIT ((uint8_t)(PWM_PERD >> 8)) +#define PWM_PERDL_INIT ((uint8_t)(PWM_PERD)) + +void user_gpio_init(); +void user_pwm_init(); + +void user_init() +{ + user_gpio_init(); + user_pwm_init(); + + IEN1 |= (1 << 1); // EPWM0 +} + +void user_gpio_init() +{ + // configure driving capabilities + DRVCON = 0x05; // allow P1 to be changed + P1DRV = 0x00; // 25mA + + DRVCON = 0x45; // allow P2 to be changed + P2DRV = 0x00; // 25mA + + DRVCON = 0x85; // allow P3 to be changed + P3DRV = 0x00; // 25mA + + DRVCON = 0xc5; // allow P5 to be changed + P5DRV = 0x00; // 25mA + + DRVCON = 0; + + P0CR = (uint8_t)(RGB_R2R_P0_2 | RGB_R0B_P0_3 | RGB_R0R_P0_4); + P1CR = (uint8_t)(RGB_ULR_P1_1 | RGB_ULG_P1_2 | RGB_ULB_P1_3 | KB_C15_P1_5); + P2CR = (uint8_t)(KB_C14_P2_0 | KB_C13_P2_1 | KB_C12_P2_2 | KB_C11_P2_3 | KB_C10_P2_4 | KB_C9_P2_5); + P3CR = (uint8_t)(KB_C8_P3_0 | KB_C7_P3_1 | KB_C6_P3_2 | KB_C5_P3_3 | KB_C4_P3_4 | KB_C3_P3_5); + P4CR = (uint8_t)(RGB_R4B_P4_3 | RGB_R4R_P4_4 | RGB_R3R_P4_5 | RGB_R3B_P4_6); + P5CR = (uint8_t)(KB_C0_P5_0 | KB_C1_P5_1 | KB_C2_P5_2 | RGB_R2B_P5_7); + P6CR = (uint8_t)(RGB_R0G_P6_1 | RGB_R1G_P6_2 | RGB_R2G_P6_3 | RGB_R3G_P6_4 | RGB_R4G_P6_5 | RGB_R1B_P6_6 | RGB_R1R_P6_7); + + P5PCR = (uint8_t)(KB_R3_P5_3 | KB_R4_P5_4 | CONN_MODE_SWITCH_P5_5 | OS_MODE_SWITCH_P5_6); + P7PCR = (uint8_t)(KB_R0_P7_1 | KB_R1_P7_2 | KB_R2_P7_3); +} + +void user_pwm_init() +{ + PWM0PERDH = PWM_PERDH_INIT; + PWM0PERDL = PWM_PERDL_INIT; + + PWM1PERDH = PWM_PERDH_INIT; + PWM1PERDL = PWM_PERDL_INIT; + + PWM2PERDH = PWM_PERDH_INIT; + PWM2PERDL = PWM_PERDL_INIT; + + PWM4PERDH = PWM_PERDH_INIT; + PWM4PERDL = PWM_PERDL_INIT; + + SET_PWM_DUTY(LED_PWM_C0, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C1, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C2, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C3, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C4, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C5, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C6, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C7, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C8, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C9, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C10, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C11, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C12, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C13, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C14, PWM_DUTY1, PWM_DUTY2); + SET_PWM_DUTY(LED_PWM_C15, PWM_DUTY1, PWM_DUTY2); +} diff --git a/src/keyboards/royalkludge-rk61/user_keyboard.c b/src/keyboards/royalkludge-rk61/user_keyboard.c new file mode 100644 index 0000000..d7ba55f --- /dev/null +++ b/src/keyboards/royalkludge-rk61/user_keyboard.c @@ -0,0 +1,53 @@ +#include "kbdef.h" +#include "keyboard.h" +#include "debug.h" + +typedef enum { + KEYBOARD_CONN_MODE_RF = 0, + KEYBOARD_CONN_MODE_USB = 1, +} user_keyboard_conn_mode_t; + +typedef enum { + KEYBOARD_OS_MODE_WIN = 0, + KEYBOARD_OS_MODE_MAC = 1, +} user_keyboard_os_mode_t; + +typedef struct { + user_keyboard_conn_mode_t conn_mode; + user_keyboard_os_mode_t os_mode; +} user_keyboard_state_t; + +volatile __xdata user_keyboard_state_t user_keyboard_state; + +void user_keyboard_init() +{ + user_keyboard_state.conn_mode = CONN_MODE_SWITCH; + user_keyboard_state.os_mode = OS_MODE_SWITCH; +} + +void user_keyboard_update_switches() +{ + if (user_keyboard_state.conn_mode != CONN_MODE_SWITCH) { + user_keyboard_state.conn_mode = CONN_MODE_SWITCH; + switch (user_keyboard_state.conn_mode) { + case KEYBOARD_CONN_MODE_USB: + dprintf("USB_MODE\r\n"); + break; + case KEYBOARD_CONN_MODE_RF: + dprintf("RF_MODE\r\n"); + break; + } + } + + if (user_keyboard_state.os_mode != OS_MODE_SWITCH) { + user_keyboard_state.os_mode = OS_MODE_SWITCH; + switch (user_keyboard_state.os_mode) { + case KEYBOARD_OS_MODE_MAC: + dprintf("MAC_MODE\r\n"); + break; + case KEYBOARD_OS_MODE_WIN: + dprintf("WIN_MODE\r\n"); + break; + } + } +} diff --git a/src/keyboards/royalkludge-rk61/user_matrix.c b/src/keyboards/royalkludge-rk61/user_matrix.c new file mode 100644 index 0000000..3699d7c --- /dev/null +++ b/src/keyboards/royalkludge-rk61/user_matrix.c @@ -0,0 +1,99 @@ +#include "kbdef.h" +#include "user_matrix.h" + +void user_matrix_pre_scan(uint8_t col) +{ + // set all columns to high + P1 |= (uint8_t)(KB_C15_P1_5); + P2 |= (uint8_t)(KB_C14_P2_0 | KB_C13_P2_1 | KB_C12_P2_2 | KB_C11_P2_3 | KB_C10_P2_4 | KB_C9_P2_5); + P3 |= (uint8_t)(KB_C8_P3_0 | KB_C7_P3_1 | KB_C6_P3_2 | KB_C5_P3_3 | KB_C4_P3_4 | KB_C3_P3_5); + P5 |= (uint8_t)(KB_C0_P5_0 | KB_C1_P5_1 | KB_C2_P5_2); + + // set current (!) column to low + switch (col) { + case 0: + KB_C0 = 0; + break; + + case 1: + KB_C1 = 0; + break; + + case 2: + KB_C2 = 0; + break; + + case 3: + KB_C3 = 0; + break; + + case 4: + KB_C4 = 0; + break; + + case 5: + KB_C5 = 0; + break; + + case 6: + KB_C6 = 0; + break; + + case 7: + KB_C7 = 0; + break; + + case 8: + KB_C8 = 0; + break; + + case 9: + KB_C9 = 0; + break; + + case 10: + KB_C10 = 0; + break; + + case 11: + KB_C11 = 0; + break; + + case 12: + KB_C12 = 0; + break; + + case 13: + KB_C13 = 0; + break; + + case 14: + KB_C14 = 0; + break; + + case 15: + KB_C15 = 0; + break; + } +} + +uint8_t user_matrix_scan_col(uint8_t col) +{ + col; + // grab key for the column state + // P7_1 - R0 + // P7_2 - R1 + // P7_3 - R2 + // P5_3 - R3 + // P5_4 - R4 + return (((P7 >> 1) & 0x07) | (P5 & 0x18)) | 0xe0; +} + +void user_matrix_post_scan() +{ + // set all columns down to low + P1 &= (uint8_t) ~(KB_C15_P1_5); + P2 &= (uint8_t) ~(KB_C14_P2_0 | KB_C13_P2_1 | KB_C12_P2_2 | KB_C11_P2_3 | KB_C10_P2_4 | KB_C9_P2_5); + P3 &= (uint8_t) ~(KB_C8_P3_0 | KB_C7_P3_1 | KB_C6_P3_2 | KB_C5_P3_3 | KB_C4_P3_4 | KB_C3_P3_5); + P5 &= (uint8_t) ~(KB_C0_P5_0 | KB_C1_P5_1 | KB_C2_P5_2); +} From 6fabac7260fa3f168a37deccd7f6cfe158e482f3 Mon Sep 17 00:00:00 2001 From: nicarran Date: Sat, 6 Jul 2024 18:19:10 -0500 Subject: [PATCH 02/11] setup meson.build part for the royalkludge-rk61 --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index cfd9e09..2b3f1d8 100644 --- a/meson.build +++ b/meson.build @@ -22,6 +22,7 @@ parts = [ ['example', 'sh68f90a', ['default'], {}], ['nuphy-air60', 'sh68f90a', ['default'], { 'vendor_id': '0x05ac', 'product_id': '0x024f' }], ['eyooso-z11', 'sh68f90a', ['default'], { 'vendor_id': '0x258a', 'product_id': '0x002a' }], + ['royalkludge-rk61', 'sh68f90a', ['default'], { 'vendor_id': '0x258a', 'product_id': '0x00c7' }], ] # SMK From f42c71c75b5458af9bd1de7b65cbef9db98b9201 Mon Sep 17 00:00:00 2001 From: nicarran Date: Sat, 6 Jul 2024 18:23:22 -0500 Subject: [PATCH 03/11] migrate to the new royalkludge-rk61 folder --- src/keyboards/royalkludge-rk61/kbdef.h | 68 +++------- .../layouts/default/indicators.c | 6 + .../royalkludge-rk61/layouts/default/layout.c | 120 +++++++++--------- src/keyboards/royalkludge-rk61/user_init.c | 25 ++-- .../royalkludge-rk61/user_keyboard.c | 53 -------- src/keyboards/royalkludge-rk61/user_matrix.c | 105 +++++++-------- 6 files changed, 150 insertions(+), 227 deletions(-) delete mode 100644 src/keyboards/royalkludge-rk61/user_keyboard.c diff --git a/src/keyboards/royalkludge-rk61/kbdef.h b/src/keyboards/royalkludge-rk61/kbdef.h index a45c6a7..4a27320 100644 --- a/src/keyboards/royalkludge-rk61/kbdef.h +++ b/src/keyboards/royalkludge-rk61/kbdef.h @@ -4,14 +4,7 @@ #include "sh68f90a.h" #define MATRIX_ROWS 5 -#define MATRIX_COLS 16 - -// Row Pin Bits -#define KB_R0_P7_1 _P7_1 -#define KB_R1_P7_2 _P7_2 -#define KB_R2_P7_3 _P7_3 -#define KB_R3_P5_3 _P5_3 -#define KB_R4_P5_4 _P5_4 +#define MATRIX_COLS 14 // Row Pins #define KB_R0 P7_1 @@ -20,41 +13,24 @@ #define KB_R3 P5_3 #define KB_R4 P5_4 -// Column Pin Bits -#define KB_C0_P5_0 _P5_0 -#define KB_C1_P5_1 _P5_1 -#define KB_C2_P5_2 _P5_2 -#define KB_C3_P3_5 _P3_5 -#define KB_C4_P3_4 _P3_4 -#define KB_C5_P3_3 _P3_3 -#define KB_C6_P3_2 _P3_2 -#define KB_C7_P3_1 _P3_1 -#define KB_C8_P3_0 _P3_0 -#define KB_C9_P2_5 _P2_5 -#define KB_C10_P2_4 _P2_4 -#define KB_C11_P2_3 _P2_3 -#define KB_C12_P2_2 _P2_2 -#define KB_C13_P2_1 _P2_1 -#define KB_C14_P2_0 _P2_0 -#define KB_C15_P1_5 _P1_5 - // Column Pins -#define KB_C0 P5_0 -#define KB_C1 P5_1 -#define KB_C2 P5_2 -#define KB_C3 P3_5 -#define KB_C4 P3_4 -#define KB_C5 P3_3 -#define KB_C6 P3_2 -#define KB_C7 P3_1 -#define KB_C8 P3_0 -#define KB_C9 P2_5 -#define KB_C10 P2_4 -#define KB_C11 P2_3 -#define KB_C12 P2_2 -#define KB_C13 P2_1 -#define KB_C14 P2_0 -#define KB_C15 P1_5 +#define KB_C0 P6_0 +#define KB_C1 P6_1 +#define KB_C2 P6_2 +#define KB_C3 P6_3 +#define KB_C4 P6_4 +#define KB_C5 P6_5 +#define KB_C6 P6_6 +#define KB_C7 P6_7 +#define KB_C8 P5_0 +#define KB_C9 P5_1 +#define KB_C10 P5_2 +#define KB_C11 P5_7 +#define KB_C12 P4_0 +#define KB_C13 P4_2 + +// ATTENTION: LED pins have not been traced. +// All code related to led handling doesn't do harm and serve as reference for future work on making the leds work. // LED PWM Registers #define LED_PWM_C0 PWM40 @@ -114,12 +90,4 @@ #define RGB_ULG_P1_2 _P1_2 #define RGB_ULB_P1_3 _P1_3 -// Config Switch Pins -#define CONN_MODE_SWITCH P5_5 // 1 - USB, 0 - RF -#define OS_MODE_SWITCH P5_6 // 1 - MAC, 0 - WIN - -// Config Switch Pin Bits -#define CONN_MODE_SWITCH_P5_5 _P5_5 // 1 - USB, 0 - RF -#define OS_MODE_SWITCH_P5_6 _P5_6 // 1 - MAC, 0 - WIN - #endif diff --git a/src/keyboards/royalkludge-rk61/layouts/default/indicators.c b/src/keyboards/royalkludge-rk61/layouts/default/indicators.c index 7b68687..5d8e9f7 100644 --- a/src/keyboards/royalkludge-rk61/layouts/default/indicators.c +++ b/src/keyboards/royalkludge-rk61/layouts/default/indicators.c @@ -33,6 +33,11 @@ void indicators_pre_update() bool indicators_update_step(keyboard_state_t *keyboard, uint8_t current_step) { + + keyboard; current_step; + indicators_pwm_set_all_columns(0); + + /* static uint16_t current_cycle = 0; if (current_step == 0) { @@ -114,6 +119,7 @@ bool indicators_update_step(keyboard_state_t *keyboard, uint8_t current_step) // set pwm duty cycles to expected colors indicators_pwm_set_all_columns(color_intensity); + */ return false; } diff --git a/src/keyboards/royalkludge-rk61/layouts/default/layout.c b/src/keyboards/royalkludge-rk61/layouts/default/layout.c index 17316f5..6765789 100644 --- a/src/keyboards/royalkludge-rk61/layouts/default/layout.c +++ b/src/keyboards/royalkludge-rk61/layouts/default/layout.c @@ -2,23 +2,24 @@ #include "layout.h" #include "user_layout.h" #include "report.h" +#include "delay.h" #include // clang-format off -#define LAYOUT_60( \ - K00_0, K01_0, K02_0, K03_0, K04_0, K05_0, K06_0, K07_0, K08_0, K09_0, K10_0, K11_0, K12_0, K13_0, \ - K00_1, K01_1, K02_1, K03_1, K04_1, K05_1, K06_1, K07_1, K08_1, K09_1, K10_1, K11_1, K12_1, K13_1, \ - K00_2, K01_2, K02_2, K03_2, K04_2, K05_2, K06_2, K07_2, K08_2, K09_2, K10_2, K11_2, K13_2, \ - K00_3, K01_3, K02_3, K03_3, K04_3, K05_3, K06_3, K07_3, K08_3, K09_3, K10_3, K13_3, K14_3, K15_3, \ - K00_4, K01_4, K02_4, K05_4, K08_4, K09_4, K10_4, K13_4, K14_4 \ - ) { \ - { K00_0, K01_0, K02_0, K03_0, K04_0, K05_0, K06_0, K07_0, K08_0, K09_0, K10_0, K11_0, K12_0, K13_0, KC_NO, KC_NO }, \ - { K00_1, K01_1, K02_1, K03_1, K04_1, K05_1, K06_1, K07_1, K08_1, K09_1, K10_1, K11_1, K12_1, K13_1, KC_NO, KC_NO }, \ - { K00_2, K01_2, K02_2, K03_2, K04_2, K05_2, K06_2, K07_2, K08_2, K09_2, K10_2, K11_2, KC_NO, K13_2, KC_NO, KC_NO }, \ - { K00_3, K01_3, K02_3, K03_3, K04_3, K05_3, K06_3, K07_3, K08_3, K09_3, K10_3, KC_NO, KC_NO, K13_3, K14_3, K15_3 }, \ - { K00_4, K01_4, K02_4, KC_NO, KC_NO, K05_4, KC_NO, KC_NO, K08_4, K09_4, K10_4, KC_NO, KC_NO, K13_4, K14_4, KC_NO } \ -} +#define LAYOUT_60( \ + K00_0, K01_0, K02_0, K03_0, K04_0, K05_0, K06_0, K07_0, K08_0, K09_0, K10_0, K11_0, K12_0, K13_0, \ + K00_1, K01_1, K02_1, K03_1, K04_1, K05_1, K06_1, K07_1, K08_1, K09_1, K10_1, K11_1, K12_1, K13_1, \ + K00_2, K01_2, K02_2, K03_2, K04_2, K05_2, K06_2, K07_2, K08_2, K09_2, K10_2, K11_2, K13_2, \ + K00_3, K01_3, K02_3, K03_3, K04_3, K05_3, K06_3, K07_3, K08_3, K09_3, K10_3, K13_3, K14_3, K15_3, \ + K00_4, K01_4, K02_4, K05_4, K08_4, K09_4, K10_4, K13_4, K14_4 \ + ) { \ + { K00_0, K01_0, K02_0, K03_0, K04_0, K05_0, K06_0, K07_0, K08_0, K09_0, K10_0, K11_0, K12_0, K13_0 }, \ + { K00_1, K01_1, K02_1, K03_1, K04_1, K05_1, K06_1, K07_1, K08_1, K09_1, K10_1, K11_1, K12_1, K13_1 }, \ + { K00_2, K01_2, K02_2, K03_2, K04_2, K05_2, K06_2, K07_2, K08_2, K09_2, K10_2, K11_2, KC_NO, K13_2 }, \ + { K00_3, K01_3, K02_3, K03_3, K04_3, K05_3, K06_3, K07_3, K08_3, K09_3, K10_3, KC_NO, KC_NO, K13_3 }, \ + { K00_4, K01_4, K02_4, KC_NO, KC_NO, K05_4, KC_NO, KC_NO, K08_4, K09_4, K10_4, KC_NO, KC_NO, K13_4 } \ + } // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -28,80 +29,85 @@ #define _FL 1 enum custom_keycodes { - SFT_ESC = SAFE_RANGE + RGUI_ESC = SAFE_RANGE }; const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,------------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backsp| + * |Fn | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Gui| * |------------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backsp| * |------------------------------------------------------------| - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| Return| + * |Gui | A| S| D| F| G| H| J| K| L| ;| '| Return| * |------------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shi| Up|Del| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shi| NO| NO| * |------------------------------------------------------------| - * |Ctrl|Alt |Gui | Space |Gui|Fn |Lef|Dow|Rig| + * |App |Alt |Ctl | Space |Ctl|Alt |App|Fn| NO| * `------------------------------------------------------------' */ [_BL] = LAYOUT_60( - SFT_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_LGUI, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT - ), + MO(_FL), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, RGUI_ESC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, KC_NO, + KC_APP, KC_LALT, KC_LCTL, KC_SPC, KC_RCTL, KC_RALT, KC_APP, MO(_FL), KC_NO + ), /* Keymap _FL: (Base Layer) Function Layer * ,------------------------------------------------------------. - * | ~ | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del | + * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Esc | * |------------------------------------------------------------| - * | | | | | | | | | | | | | | | + * | \ | `| | | | | | Hm| Up|End| F17| | | | * |------------------------------------------------------------| - * | | | | | | | | | | | | | | + * |Caps |F13|F14|F15|F16| |PgU|Lft|Dwn|Rgt|F18|F19| | * |------------------------------------------------------------| - * | | | | | | | | | | | | | | | + * | |F21| | | | |PgD| |Del| |F20| | | | * |------------------------------------------------------------| * | | | | | | | | | | * `------------------------------------------------------------' */ [_FL] = LAYOUT_60( - KC_GRV, 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, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), + _______, 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_BSLS, KC_GRV, _______, _______, _______, _______, _______, KC_HOME, KC_UP, KC_END, KC_F17, _______, _______, _______, + KC_CAPS, KC_F13, KC_F14, KC_F15, KC_F16, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RIGHT, KC_F18, KC_F19, _______, + _______, KC_F21, _______,_______, _______, _______, KC_PGDN, KC_DEL, KC_PAUSE, _______, KC_F20, _______, _______, _______, + _______, _______, _______, KC_ESC, _______, _______, _______, _______, _______ + ), }; // clang-format on +void key_action(uint16_t keycode){ + delay_ms(5); + add_key(keycode); + send_keyboard_report(); + + delay_ms(5); + del_key(keycode); + send_keyboard_report(); +} + bool layout_process_record(uint16_t keycode, bool key_pressed) { + static bool RGUI_ESC_SINGLE_ACTION=false; switch (keycode) { - case SFT_ESC: - if (key_pressed) { - if (get_mods() & MODS_SHIFT_MASK) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (get_mods() & MODS_SHIFT_MASK) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } + case RGUI_ESC: + if (key_pressed) { + add_mods((uint8_t)MOD_BIT(KC_RGUI)); + RGUI_ESC_SINGLE_ACTION=true; + send_keyboard_report(); + } else { + del_mods((uint8_t)MOD_BIT(KC_RGUI)); + send_keyboard_report(); + if(RGUI_ESC_SINGLE_ACTION){ + key_action(KC_ESC); + RGUI_ESC_SINGLE_ACTION=false; } - - return false; - - default: - return true; + } + return false; + default: + RGUI_ESC_SINGLE_ACTION=false; + return true; } } diff --git a/src/keyboards/royalkludge-rk61/user_init.c b/src/keyboards/royalkludge-rk61/user_init.c index 2fb9f17..3b56e8d 100644 --- a/src/keyboards/royalkludge-rk61/user_init.c +++ b/src/keyboards/royalkludge-rk61/user_init.c @@ -39,16 +39,21 @@ void user_gpio_init() DRVCON = 0; - P0CR = (uint8_t)(RGB_R2R_P0_2 | RGB_R0B_P0_3 | RGB_R0R_P0_4); - P1CR = (uint8_t)(RGB_ULR_P1_1 | RGB_ULG_P1_2 | RGB_ULB_P1_3 | KB_C15_P1_5); - P2CR = (uint8_t)(KB_C14_P2_0 | KB_C13_P2_1 | KB_C12_P2_2 | KB_C11_P2_3 | KB_C10_P2_4 | KB_C9_P2_5); - P3CR = (uint8_t)(KB_C8_P3_0 | KB_C7_P3_1 | KB_C6_P3_2 | KB_C5_P3_3 | KB_C4_P3_4 | KB_C3_P3_5); - P4CR = (uint8_t)(RGB_R4B_P4_3 | RGB_R4R_P4_4 | RGB_R3R_P4_5 | RGB_R3B_P4_6); - P5CR = (uint8_t)(KB_C0_P5_0 | KB_C1_P5_1 | KB_C2_P5_2 | RGB_R2B_P5_7); - P6CR = (uint8_t)(RGB_R0G_P6_1 | RGB_R1G_P6_2 | RGB_R2G_P6_3 | RGB_R3G_P6_4 | RGB_R4G_P6_5 | RGB_R1B_P6_6 | RGB_R1R_P6_7); - - P5PCR = (uint8_t)(KB_R3_P5_3 | KB_R4_P5_4 | CONN_MODE_SWITCH_P5_5 | OS_MODE_SWITCH_P5_6); - P7PCR = (uint8_t)(KB_R0_P7_1 | KB_R1_P7_2 | KB_R2_P7_3); + + // I set this up by following the same pattern done in the original setup (nuphy-air60) and it works, I don't really understand the meaning of this "registers" :D... + P5 = (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7); + P5CR = (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7); + P5PCR = (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_3 | _P5_4 | _P5_7); + + P7PCR = (uint8_t)(_P7_1 | _P7_2 | _P7_3); + + P6 = (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); + P6CR = (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); + P6PCR = (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); + + P4 = (uint8_t)(_P4_0 | _P4_2); + P4CR = (uint8_t)(_P4_0 | _P4_2); + P4PCR = (uint8_t)(_P4_0 | _P4_2); } void user_pwm_init() diff --git a/src/keyboards/royalkludge-rk61/user_keyboard.c b/src/keyboards/royalkludge-rk61/user_keyboard.c deleted file mode 100644 index d7ba55f..0000000 --- a/src/keyboards/royalkludge-rk61/user_keyboard.c +++ /dev/null @@ -1,53 +0,0 @@ -#include "kbdef.h" -#include "keyboard.h" -#include "debug.h" - -typedef enum { - KEYBOARD_CONN_MODE_RF = 0, - KEYBOARD_CONN_MODE_USB = 1, -} user_keyboard_conn_mode_t; - -typedef enum { - KEYBOARD_OS_MODE_WIN = 0, - KEYBOARD_OS_MODE_MAC = 1, -} user_keyboard_os_mode_t; - -typedef struct { - user_keyboard_conn_mode_t conn_mode; - user_keyboard_os_mode_t os_mode; -} user_keyboard_state_t; - -volatile __xdata user_keyboard_state_t user_keyboard_state; - -void user_keyboard_init() -{ - user_keyboard_state.conn_mode = CONN_MODE_SWITCH; - user_keyboard_state.os_mode = OS_MODE_SWITCH; -} - -void user_keyboard_update_switches() -{ - if (user_keyboard_state.conn_mode != CONN_MODE_SWITCH) { - user_keyboard_state.conn_mode = CONN_MODE_SWITCH; - switch (user_keyboard_state.conn_mode) { - case KEYBOARD_CONN_MODE_USB: - dprintf("USB_MODE\r\n"); - break; - case KEYBOARD_CONN_MODE_RF: - dprintf("RF_MODE\r\n"); - break; - } - } - - if (user_keyboard_state.os_mode != OS_MODE_SWITCH) { - user_keyboard_state.os_mode = OS_MODE_SWITCH; - switch (user_keyboard_state.os_mode) { - case KEYBOARD_OS_MODE_MAC: - dprintf("MAC_MODE\r\n"); - break; - case KEYBOARD_OS_MODE_WIN: - dprintf("WIN_MODE\r\n"); - break; - } - } -} diff --git a/src/keyboards/royalkludge-rk61/user_matrix.c b/src/keyboards/royalkludge-rk61/user_matrix.c index 3699d7c..defaafc 100644 --- a/src/keyboards/royalkludge-rk61/user_matrix.c +++ b/src/keyboards/royalkludge-rk61/user_matrix.c @@ -4,76 +4,68 @@ void user_matrix_pre_scan(uint8_t col) { // set all columns to high - P1 |= (uint8_t)(KB_C15_P1_5); - P2 |= (uint8_t)(KB_C14_P2_0 | KB_C13_P2_1 | KB_C12_P2_2 | KB_C11_P2_3 | KB_C10_P2_4 | KB_C9_P2_5); - P3 |= (uint8_t)(KB_C8_P3_0 | KB_C7_P3_1 | KB_C6_P3_2 | KB_C5_P3_3 | KB_C4_P3_4 | KB_C3_P3_5); - P5 |= (uint8_t)(KB_C0_P5_0 | KB_C1_P5_1 | KB_C2_P5_2); + P6 |= (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7 ); + P5 |= (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7 ); + P4 |= (uint8_t)(_P4_0 | _P4_2 ); // set current (!) column to low switch (col) { - case 0: - KB_C0 = 0; - break; + case 0: + KB_C0 = 0; + break; - case 1: - KB_C1 = 0; - break; + case 1: + KB_C1 = 0; + break; - case 2: - KB_C2 = 0; - break; + case 2: + KB_C2 = 0; + break; - case 3: - KB_C3 = 0; - break; + case 3: + KB_C3 = 0; + break; - case 4: - KB_C4 = 0; - break; + case 4: + KB_C4 = 0; + break; - case 5: - KB_C5 = 0; - break; + case 5: + KB_C5 = 0; + break; - case 6: - KB_C6 = 0; - break; + case 6: + KB_C6 = 0; + break; - case 7: - KB_C7 = 0; - break; + case 7: + KB_C7 = 0; + break; - case 8: - KB_C8 = 0; - break; + case 8: + KB_C8 = 0; + break; - case 9: - KB_C9 = 0; - break; + case 9: + KB_C9 = 0; + break; - case 10: - KB_C10 = 0; - break; + case 10: + KB_C10 = 0; + break; - case 11: - KB_C11 = 0; - break; + case 11: + KB_C11 = 0; + break; - case 12: - KB_C12 = 0; - break; + case 12: + KB_C12 = 0; + break; - case 13: - KB_C13 = 0; - break; + case 13: + KB_C13 = 0; + break; - case 14: - KB_C14 = 0; - break; - - case 15: - KB_C15 = 0; - break; } } @@ -92,8 +84,7 @@ uint8_t user_matrix_scan_col(uint8_t col) void user_matrix_post_scan() { // set all columns down to low - P1 &= (uint8_t) ~(KB_C15_P1_5); - P2 &= (uint8_t) ~(KB_C14_P2_0 | KB_C13_P2_1 | KB_C12_P2_2 | KB_C11_P2_3 | KB_C10_P2_4 | KB_C9_P2_5); - P3 &= (uint8_t) ~(KB_C8_P3_0 | KB_C7_P3_1 | KB_C6_P3_2 | KB_C5_P3_3 | KB_C4_P3_4 | KB_C3_P3_5); - P5 &= (uint8_t) ~(KB_C0_P5_0 | KB_C1_P5_1 | KB_C2_P5_2); + P6 &= (uint8_t)~(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7 ); + P5 &= (uint8_t)~(_P5_0 | _P5_1 | _P5_2 | _P5_7 ); + P4 &= (uint8_t)~(_P4_0 | _P4_2 ); } From fb9c1d07f7f866c2419b9978fd3948538a32b422 Mon Sep 17 00:00:00 2001 From: nicarran Date: Sat, 6 Jul 2024 18:47:01 -0500 Subject: [PATCH 04/11] format using clang-format --- src/keyboards/royalkludge-rk61/kbdef.h | 20 ++-- .../layouts/default/indicators.c | 4 +- .../royalkludge-rk61/layouts/default/layout.c | 37 +++---- src/keyboards/royalkludge-rk61/user_init.c | 15 ++- src/keyboards/royalkludge-rk61/user_matrix.c | 97 +++++++++---------- 5 files changed, 86 insertions(+), 87 deletions(-) diff --git a/src/keyboards/royalkludge-rk61/kbdef.h b/src/keyboards/royalkludge-rk61/kbdef.h index 4a27320..f49fe22 100644 --- a/src/keyboards/royalkludge-rk61/kbdef.h +++ b/src/keyboards/royalkludge-rk61/kbdef.h @@ -14,16 +14,16 @@ #define KB_R4 P5_4 // Column Pins -#define KB_C0 P6_0 -#define KB_C1 P6_1 -#define KB_C2 P6_2 -#define KB_C3 P6_3 -#define KB_C4 P6_4 -#define KB_C5 P6_5 -#define KB_C6 P6_6 -#define KB_C7 P6_7 -#define KB_C8 P5_0 -#define KB_C9 P5_1 +#define KB_C0 P6_0 +#define KB_C1 P6_1 +#define KB_C2 P6_2 +#define KB_C3 P6_3 +#define KB_C4 P6_4 +#define KB_C5 P6_5 +#define KB_C6 P6_6 +#define KB_C7 P6_7 +#define KB_C8 P5_0 +#define KB_C9 P5_1 #define KB_C10 P5_2 #define KB_C11 P5_7 #define KB_C12 P4_0 diff --git a/src/keyboards/royalkludge-rk61/layouts/default/indicators.c b/src/keyboards/royalkludge-rk61/layouts/default/indicators.c index 5d8e9f7..6484697 100644 --- a/src/keyboards/royalkludge-rk61/layouts/default/indicators.c +++ b/src/keyboards/royalkludge-rk61/layouts/default/indicators.c @@ -33,8 +33,8 @@ void indicators_pre_update() bool indicators_update_step(keyboard_state_t *keyboard, uint8_t current_step) { - - keyboard; current_step; + keyboard; + current_step; indicators_pwm_set_all_columns(0); /* diff --git a/src/keyboards/royalkludge-rk61/layouts/default/layout.c b/src/keyboards/royalkludge-rk61/layouts/default/layout.c index 6765789..c9a6fc6 100644 --- a/src/keyboards/royalkludge-rk61/layouts/default/layout.c +++ b/src/keyboards/royalkludge-rk61/layouts/default/layout.c @@ -78,7 +78,8 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on -void key_action(uint16_t keycode){ +void key_action(uint16_t keycode) +{ delay_ms(5); add_key(keycode); send_keyboard_report(); @@ -90,24 +91,24 @@ void key_action(uint16_t keycode){ bool layout_process_record(uint16_t keycode, bool key_pressed) { - static bool RGUI_ESC_SINGLE_ACTION=false; + static bool RGUI_ESC_SINGLE_ACTION = false; switch (keycode) { - case RGUI_ESC: - if (key_pressed) { - add_mods((uint8_t)MOD_BIT(KC_RGUI)); - RGUI_ESC_SINGLE_ACTION=true; - send_keyboard_report(); - } else { - del_mods((uint8_t)MOD_BIT(KC_RGUI)); - send_keyboard_report(); - if(RGUI_ESC_SINGLE_ACTION){ - key_action(KC_ESC); - RGUI_ESC_SINGLE_ACTION=false; + case RGUI_ESC: + if (key_pressed) { + add_mods((uint8_t)MOD_BIT(KC_RGUI)); + RGUI_ESC_SINGLE_ACTION = true; + send_keyboard_report(); + } else { + del_mods((uint8_t)MOD_BIT(KC_RGUI)); + send_keyboard_report(); + if (RGUI_ESC_SINGLE_ACTION) { + key_action(KC_ESC); + RGUI_ESC_SINGLE_ACTION = false; + } } - } - return false; - default: - RGUI_ESC_SINGLE_ACTION=false; - return true; + return false; + default: + RGUI_ESC_SINGLE_ACTION = false; + return true; } } diff --git a/src/keyboards/royalkludge-rk61/user_init.c b/src/keyboards/royalkludge-rk61/user_init.c index 3b56e8d..90eb164 100644 --- a/src/keyboards/royalkludge-rk61/user_init.c +++ b/src/keyboards/royalkludge-rk61/user_init.c @@ -39,20 +39,19 @@ void user_gpio_init() DRVCON = 0; - - // I set this up by following the same pattern done in the original setup (nuphy-air60) and it works, I don't really understand the meaning of this "registers" :D... - P5 = (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7); - P5CR = (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7); + // I set this up by following the same pattern done in the original setup (nuphy-air60) and it works, I don't really understand the meaning of this "registers" :D... + P5 = (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7); + P5CR = (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7); P5PCR = (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_3 | _P5_4 | _P5_7); P7PCR = (uint8_t)(_P7_1 | _P7_2 | _P7_3); - P6 = (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); - P6CR = (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); + P6 = (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); + P6CR = (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); P6PCR = (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); - P4 = (uint8_t)(_P4_0 | _P4_2); - P4CR = (uint8_t)(_P4_0 | _P4_2); + P4 = (uint8_t)(_P4_0 | _P4_2); + P4CR = (uint8_t)(_P4_0 | _P4_2); P4PCR = (uint8_t)(_P4_0 | _P4_2); } diff --git a/src/keyboards/royalkludge-rk61/user_matrix.c b/src/keyboards/royalkludge-rk61/user_matrix.c index defaafc..34604fb 100644 --- a/src/keyboards/royalkludge-rk61/user_matrix.c +++ b/src/keyboards/royalkludge-rk61/user_matrix.c @@ -4,68 +4,67 @@ void user_matrix_pre_scan(uint8_t col) { // set all columns to high - P6 |= (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7 ); - P5 |= (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7 ); - P4 |= (uint8_t)(_P4_0 | _P4_2 ); + P6 |= (uint8_t)(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); + P5 |= (uint8_t)(_P5_0 | _P5_1 | _P5_2 | _P5_7); + P4 |= (uint8_t)(_P4_0 | _P4_2); // set current (!) column to low switch (col) { - case 0: - KB_C0 = 0; - break; + case 0: + KB_C0 = 0; + break; - case 1: - KB_C1 = 0; - break; + case 1: + KB_C1 = 0; + break; - case 2: - KB_C2 = 0; - break; + case 2: + KB_C2 = 0; + break; - case 3: - KB_C3 = 0; - break; + case 3: + KB_C3 = 0; + break; - case 4: - KB_C4 = 0; - break; + case 4: + KB_C4 = 0; + break; - case 5: - KB_C5 = 0; - break; + case 5: + KB_C5 = 0; + break; - case 6: - KB_C6 = 0; - break; + case 6: + KB_C6 = 0; + break; - case 7: - KB_C7 = 0; - break; + case 7: + KB_C7 = 0; + break; - case 8: - KB_C8 = 0; - break; + case 8: + KB_C8 = 0; + break; - case 9: - KB_C9 = 0; - break; + case 9: + KB_C9 = 0; + break; - case 10: - KB_C10 = 0; - break; + case 10: + KB_C10 = 0; + break; - case 11: - KB_C11 = 0; - break; + case 11: + KB_C11 = 0; + break; - case 12: - KB_C12 = 0; - break; - - case 13: - KB_C13 = 0; - break; + case 12: + KB_C12 = 0; + break; + case 13: + KB_C13 = 0; + break; } } @@ -84,7 +83,7 @@ uint8_t user_matrix_scan_col(uint8_t col) void user_matrix_post_scan() { // set all columns down to low - P6 &= (uint8_t)~(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7 ); - P5 &= (uint8_t)~(_P5_0 | _P5_1 | _P5_2 | _P5_7 ); - P4 &= (uint8_t)~(_P4_0 | _P4_2 ); + P6 &= (uint8_t) ~(_P6_0 | _P6_1 | _P6_2 | _P6_3 | _P6_4 | _P6_5 | _P6_6 | _P6_7); + P5 &= (uint8_t) ~(_P5_0 | _P5_1 | _P5_2 | _P5_7); + P4 &= (uint8_t) ~(_P4_0 | _P4_2); } From d94f45c09c4c73c83ade8d9ffb4b96e062744905 Mon Sep 17 00:00:00 2001 From: nicarran Date: Sun, 7 Jul 2024 23:26:30 -0500 Subject: [PATCH 05/11] create royalkludge-rk61 documentation page --- docs/keyboards/royalkludge-rk61.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/keyboards/royalkludge-rk61.md diff --git a/docs/keyboards/royalkludge-rk61.md b/docs/keyboards/royalkludge-rk61.md new file mode 100644 index 0000000..5d7c632 --- /dev/null +++ b/docs/keyboards/royalkludge-rk61.md @@ -0,0 +1,16 @@ +# Royal Kludge RK61 + +**Warning:** There are many versions of the RK61 with different internals. This SMK firmware has been tested on a wired version from 2022 (board stamped 2022/08/16). If you are going to try this firmware, first make a backup of the original using the [sinowealth-kb-tool](https://github.com/carlossless/sinowealth-kb-tool). You must know how to reflash the original firmware using the sinowealth-kb-tool in case the SMK firmware does not function properly. We take no responsibility for any damage caused by trying this firmware or using the sinowealth-kb-tool. + +## Keyboard Specs + +- MCU: BYK916 (SH68F90?) +- Backlight: RGB LEDs +- Indicators: none +- Switches: none +- Wireless: wired only version + +## SMK Supported Features + +- [x] Key Scan +- [] RGB Matrix From 6fe7999a84a05f05730d5cc6165744953bb33ed8 Mon Sep 17 00:00:00 2001 From: nicarran Date: Mon, 8 Jul 2024 00:02:29 -0500 Subject: [PATCH 06/11] edit royalkludge-rk61.md --- docs/keyboards/royalkludge-rk61.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/keyboards/royalkludge-rk61.md b/docs/keyboards/royalkludge-rk61.md index 5d7c632..e669fcb 100644 --- a/docs/keyboards/royalkludge-rk61.md +++ b/docs/keyboards/royalkludge-rk61.md @@ -8,7 +8,11 @@ - Backlight: RGB LEDs - Indicators: none - Switches: none +<<<<<<< Updated upstream - Wireless: wired only version +======= +- Wireless: none, wired only version +>>>>>>> Stashed changes ## SMK Supported Features From 419a111270cd0f677ea03de041f5405dca91da7f Mon Sep 17 00:00:00 2001 From: nicarran Date: Mon, 8 Jul 2024 00:03:04 -0500 Subject: [PATCH 07/11] add royalkludge-rk61 doc linke to the main README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7f4ff68..b849ea4 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ You can very easily end up with a bricked device if the written firmware can't j | -------- | --- | --- | --- | -------- | ------- | | [NuPhy Air60 v1](https://nuphy.com/products/air60) | SH68F90A / BYK916 | ✅ | ✅ | TBD | [Details](docs/keyboards/nuphy-air60.md) | | E-YOOSO Z11 | SH68F90A / BYK901 | ✅ | ✅ | N/A | [Details](docs/keyboards/nuphy-air60.md) | +| Royal Kludge RK61 | SH68F90? / BYK901 | ✅ | ✅ | N/A | [Details](docs/keyboards/royalkludge-rk61.md) | ## Developing From 52c2d12002cb651bf247310ec154b5dbfc8d54e0 Mon Sep 17 00:00:00 2001 From: nicarran Date: Mon, 8 Jul 2024 00:07:57 -0500 Subject: [PATCH 08/11] eidt royalkludge-rk61.md --- docs/keyboards/royalkludge-rk61.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/keyboards/royalkludge-rk61.md b/docs/keyboards/royalkludge-rk61.md index e669fcb..d79b370 100644 --- a/docs/keyboards/royalkludge-rk61.md +++ b/docs/keyboards/royalkludge-rk61.md @@ -8,13 +8,10 @@ - Backlight: RGB LEDs - Indicators: none - Switches: none -<<<<<<< Updated upstream - Wireless: wired only version -======= - Wireless: none, wired only version ->>>>>>> Stashed changes ## SMK Supported Features - [x] Key Scan -- [] RGB Matrix +- [ ] RGB Matrix From 3fe694c10eeb846cd8d51e3051ad49dbce14979e Mon Sep 17 00:00:00 2001 From: nicarran Date: Mon, 8 Jul 2024 00:18:05 -0500 Subject: [PATCH 09/11] edit royalkludge-rk61.md --- docs/keyboards/royalkludge-rk61.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/keyboards/royalkludge-rk61.md b/docs/keyboards/royalkludge-rk61.md index d79b370..2e02466 100644 --- a/docs/keyboards/royalkludge-rk61.md +++ b/docs/keyboards/royalkludge-rk61.md @@ -1,6 +1,6 @@ # Royal Kludge RK61 -**Warning:** There are many versions of the RK61 with different internals. This SMK firmware has been tested on a wired version from 2022 (board stamped 2022/08/16). If you are going to try this firmware, first make a backup of the original using the [sinowealth-kb-tool](https://github.com/carlossless/sinowealth-kb-tool). You must know how to reflash the original firmware using the sinowealth-kb-tool in case the SMK firmware does not function properly. We take no responsibility for any damage caused by trying this firmware or using the sinowealth-kb-tool. +**Warning:** Be aware that there are several versions of the RK61 keyboard, each containing distinct internal components. This SMK firmware has been successfully tested on a wired 2022 model (with the date stamped on the board: 2022/08/16) and is likely to not function correctly on other variations. If you opt to install this firmware on your RK61, it is highly recommended to create a backup of your original firmware using the sinowealth-kb-tool [available here](https://github.com/carlossless/sinowealth-kb-tool) first. Keep in mind that you should know how to revert to the original firmware using sinowealth-kb-tool in case the SMK firmware does not work as intended. We disclaim any responsibility for any damage caused while trying this firmware or using the sinowealth-kb-tool. ## Keyboard Specs From 3caa21d1615768a477f5fbd1bdb00a0cf7b73a9c Mon Sep 17 00:00:00 2001 From: nicarran Date: Mon, 8 Jul 2024 14:04:51 -0500 Subject: [PATCH 10/11] royalkludge-rk61: RGUI_ESC keycode comment --- src/keyboards/royalkludge-rk61/layouts/default/layout.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/keyboards/royalkludge-rk61/layouts/default/layout.c b/src/keyboards/royalkludge-rk61/layouts/default/layout.c index c9a6fc6..0e8d6fd 100644 --- a/src/keyboards/royalkludge-rk61/layouts/default/layout.c +++ b/src/keyboards/royalkludge-rk61/layouts/default/layout.c @@ -29,6 +29,7 @@ #define _FL 1 enum custom_keycodes { + // Acts as KB_RGUI modifier when used with other keys, but if no other keys are pressed during the modifier's active state, sends an extra KB_ESC or Add/Del key on release. See layout_process_record for details. RGUI_ESC = SAFE_RANGE }; From 2eda9e943937206a6c4b38738371c1ae383c0303 Mon Sep 17 00:00:00 2001 From: nicarran Date: Mon, 8 Jul 2024 21:58:27 -0500 Subject: [PATCH 11/11] royalkludge-rk61: fix comment --- src/keyboards/royalkludge-rk61/layouts/default/layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/keyboards/royalkludge-rk61/layouts/default/layout.c b/src/keyboards/royalkludge-rk61/layouts/default/layout.c index 0e8d6fd..113d1c9 100644 --- a/src/keyboards/royalkludge-rk61/layouts/default/layout.c +++ b/src/keyboards/royalkludge-rk61/layouts/default/layout.c @@ -29,7 +29,7 @@ #define _FL 1 enum custom_keycodes { - // Acts as KB_RGUI modifier when used with other keys, but if no other keys are pressed during the modifier's active state, sends an extra KB_ESC or Add/Del key on release. See layout_process_record for details. + // Acts as KB_RGUI modifier when used with other keys, but if no other keys are pressed during the modifier's active state, sends an extra KB_ESC (add/del_key) on release. See layout_process_record for details. RGUI_ESC = SAFE_RANGE };