From 1513966c3844df9303e2222e32824f3823e11d27 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Fri, 19 Apr 2024 02:18:51 +0100 Subject: [PATCH] Tidy use of raw hid within keyboards (#23557) --- keyboards/dp60/dp60.c | 24 ------ keyboards/dp60/keymaps/via/keymap.c | 20 +++++ keyboards/evyd13/plain60/keymaps/rgb/rules.mk | 2 - keyboards/hs60/v1/keyboard.json | 3 +- keyboards/hs60/v1/rules.mk | 4 - keyboards/hs60/v1/v1.c | 74 ------------------- keyboards/keychron/q6/iso/rules.mk | 1 - keyboards/keychron/q6/iso_encoder/rules.mk | 1 - keyboards/massdrop/alt/rules.mk | 1 - keyboards/massdrop/ctrl/rules.mk | 1 - keyboards/rocketboard_16/rules.mk | 2 - 11 files changed, 21 insertions(+), 112 deletions(-) diff --git a/keyboards/dp60/dp60.c b/keyboards/dp60/dp60.c index 5f23b35542..349e5cea9b 100644 --- a/keyboards/dp60/dp60.c +++ b/keyboards/dp60/dp60.c @@ -172,27 +172,3 @@ webusb_pos_t webusb_keymap[] = { {4, 0}, {4, 1}, {4, 2}, {4, 6}, {4, 10}, {4, 11}, {4, 12}, {4, 13}, }; #endif - -#ifndef RAW_ENABLE -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { -#else -bool process_record_user(uint16_t keycode, keyrecord_t *record) { -#endif - if (record->event.pressed) { - switch(keycode) { - #ifdef RGBLIGHT_ENABLE - #ifdef RGB_MATRIX_ENABLE - case KC_F13: // toggle rgb matrix - rgb_matrix_toggle(); - return false; - case KC_F14: - rgb_matrix_step(); - return false; - #endif - #endif - default: - break; - } - } - return true; -} diff --git a/keyboards/dp60/keymaps/via/keymap.c b/keyboards/dp60/keymaps/via/keymap.c index 538a27886f..fab799e08a 100644 --- a/keyboards/dp60/keymaps/via/keymap.c +++ b/keyboards/dp60/keymaps/via/keymap.c @@ -44,3 +44,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______, _______,_______,_______,_______) }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + #ifdef RGBLIGHT_ENABLE + #ifdef RGB_MATRIX_ENABLE + case KC_F13: // toggle rgb matrix + rgb_matrix_toggle(); + return false; + case KC_F14: + rgb_matrix_step(); + return false; + #endif + #endif + default: + break; + } + } + return true; +} diff --git a/keyboards/evyd13/plain60/keymaps/rgb/rules.mk b/keyboards/evyd13/plain60/keymaps/rgb/rules.mk index b6cd87b7d4..1e3cebb145 100644 --- a/keyboards/evyd13/plain60/keymaps/rgb/rules.mk +++ b/keyboards/evyd13/plain60/keymaps/rgb/rules.mk @@ -1,3 +1 @@ RGBLIGHT_ENABLE = yes -RAW_ENABLE = no -DYNAMIC_KEYMAP_ENABLE = no diff --git a/keyboards/hs60/v1/keyboard.json b/keyboards/hs60/v1/keyboard.json index 63fef23384..3c07491a3d 100644 --- a/keyboards/hs60/v1/keyboard.json +++ b/keyboards/hs60/v1/keyboard.json @@ -73,8 +73,7 @@ "mousekey": false, "extrakey": true, "nkro": true, - "rgb_matrix": true, - "raw": true + "rgb_matrix": true }, "community_layouts": ["60_ansi", "60_iso"], "layouts": { diff --git a/keyboards/hs60/v1/rules.mk b/keyboards/hs60/v1/rules.mk index 4af34f6e5b..806a82e12a 100644 --- a/keyboards/hs60/v1/rules.mk +++ b/keyboards/hs60/v1/rules.mk @@ -2,7 +2,3 @@ # when we get USB suspend event. We want it to keep updating # backlight effects. OPT_DEFS += -DNO_SUSPEND_POWER_DOWN - -# Experimental features for zealcmd please do no enable -#RAW_ENABLE = yes -#USE_KEYMAPS_IN_EEPROM = yes diff --git a/keyboards/hs60/v1/v1.c b/keyboards/hs60/v1/v1.c index f68bcbdf9e..7a43784ad9 100644 --- a/keyboards/hs60/v1/v1.c +++ b/keyboards/hs60/v1/v1.c @@ -15,80 +15,6 @@ */ #include "quantum.h" -// Please ignore this is for upcoming features -/*#ifdef RAW_ENABLE - -void raw_hid_receive( uint8_t *data, uint8_t length ) -{ - uint8_t command = data[0]; - switch ( command ) - { - case id_protocol_version: - { - msg_protocol_version *msg = (msg_protocol_version*)&data[1]; - msg->version = PROTOCOL_VERSION; - break; - } -#if USE_KEYMAPS_IN_EEPROM - case id_keymap_keycode_load: - { - msg_keymap_keycode_load *msg = (msg_keymap_keycode_load*)&data[1]; - msg->keycode = keymap_keycode_load( msg->layer, msg->row, msg->column ); - break; - } - case id_keymap_keycode_save: - { - msg_keymap_keycode_save *msg = (msg_keymap_keycode_save*)&data[1]; - keymap_keycode_save( msg->layer, msg->row, msg->column, msg->keycode); - break; - } - case id_keymap_default_save: - { - keymap_default_save(); - break; - } -#endif // USE_KEYMAPS_IN_EEPROM - case id_backlight_config_set_values: - { - msg_backlight_config_set_values *msg = (msg_backlight_config_set_values*)&data[1]; - backlight_config_set_values(msg); - backlight_config_save(); - break; - } - case id_backlight_config_set_alphas_mods: - { - msg_backlight_config_set_alphas_mods *msg = (msg_backlight_config_set_alphas_mods*)&data[1]; - backlight_config_set_alphas_mods( msg->alphas_mods ); - backlight_config_save(); - break; - } - case id_backlight_set_key_color: - { - msg_backlight_set_key_color *msg = (msg_backlight_set_key_color*)&data[1]; - backlight_set_key_color(msg->row, msg->column, msg->hsv); - break; - } - case id_system_get_state: - { - msg_system_state *msg = (msg_system_state*)&data[1]; - msg->value = backlight_get_tick(); - break; - } - default: - { - // Unhandled message. - data[0] = id_unhandled; - break; - } - } - - // Return same buffer with values changed - raw_hid_send( data, length ); - -} - -#endif*/ - #ifdef HS60_ANSI const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT] = { diff --git a/keyboards/keychron/q6/iso/rules.mk b/keyboards/keychron/q6/iso/rules.mk index f16a475f61..9383cc955f 100644 --- a/keyboards/keychron/q6/iso/rules.mk +++ b/keyboards/keychron/q6/iso/rules.mk @@ -12,7 +12,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output DIP_SWITCH_ENABLE = yes RGB_MATRIX_ENABLE = yes -RAW_ENABLE = yes LTO_ENABLE = yes # custom matrix setup diff --git a/keyboards/keychron/q6/iso_encoder/rules.mk b/keyboards/keychron/q6/iso_encoder/rules.mk index 712c2ef1fd..929c4532a0 100644 --- a/keyboards/keychron/q6/iso_encoder/rules.mk +++ b/keyboards/keychron/q6/iso_encoder/rules.mk @@ -13,7 +13,6 @@ AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = yes # Enable Encoder DIP_SWITCH_ENABLE = yes RGB_MATRIX_ENABLE = yes -RAW_ENABLE = yes LTO_ENABLE = yes # custom matrix setup diff --git a/keyboards/massdrop/alt/rules.mk b/keyboards/massdrop/alt/rules.mk index e176fa733d..765e92b916 100644 --- a/keyboards/massdrop/alt/rules.mk +++ b/keyboards/massdrop/alt/rules.mk @@ -21,7 +21,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output VIRTSER_ENABLE = no # USB Serial Driver -RAW_ENABLE = no # Raw device AUTO_SHIFT_ENABLE = no # Auto Shift # Custom RGB matrix handling diff --git a/keyboards/massdrop/ctrl/rules.mk b/keyboards/massdrop/ctrl/rules.mk index e176fa733d..765e92b916 100644 --- a/keyboards/massdrop/ctrl/rules.mk +++ b/keyboards/massdrop/ctrl/rules.mk @@ -21,7 +21,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output VIRTSER_ENABLE = no # USB Serial Driver -RAW_ENABLE = no # Raw device AUTO_SHIFT_ENABLE = no # Auto Shift # Custom RGB matrix handling diff --git a/keyboards/rocketboard_16/rules.mk b/keyboards/rocketboard_16/rules.mk index c8915ad182..ad74cd9306 100644 --- a/keyboards/rocketboard_16/rules.mk +++ b/keyboards/rocketboard_16/rules.mk @@ -3,5 +3,3 @@ MCU_LDSCRIPT = STM32F103xB # Extra include SRC += keycode_lookup.c - -RAW_ENABLE = yes # Enables HID RAW communication between the board and the PC