Make Dynamic Keymaps optional for Oryx

This commit is contained in:
Drashna Jael're
2020-01-28 17:13:04 -08:00
committed by Florian Didron
parent ed1cbad3e7
commit e7a2fdc271
3 changed files with 8 additions and 6 deletions

View File

@@ -350,7 +350,6 @@ ifeq ($(strip $(VELOCIKEY_ENABLE)), yes)
endif endif
ifeq ($(strip $(ORYX_ENABLE)), yes) ifeq ($(strip $(ORYX_ENABLE)), yes)
DYNAMIC_KEYMAP_ENABLE := yes
WEBUSB_ENABLE := yes WEBUSB_ENABLE := yes
SRC += $(QUANTUM_DIR)/oryx.c SRC += $(QUANTUM_DIR)/oryx.c
OPT_DEFS += -DORYX_ENABLE OPT_DEFS += -DORYX_ENABLE

View File

@@ -33,6 +33,7 @@ bool webusb_receive_oryx(uint8_t *data, uint8_t length) {
webusb_send(event, sizeof(event)); webusb_send(event, sizeof(event));
return true; return true;
} }
#ifdef DYNAMIC_KEYMAP_ENABLE
case ORYX_CMD_LIVE_UPDATE_GET_KEYCODE: { case ORYX_CMD_LIVE_UPDATE_GET_KEYCODE: {
uint8_t event[5]; uint8_t event[5];
// layer, row, col // layer, row, col
@@ -173,6 +174,7 @@ bool webusb_receive_oryx(uint8_t *data, uint8_t length) {
reset_keyboard(); reset_keyboard();
return true; return true;
} }
#endif
default: default:
return webusb_receive_kb(data, length); return webusb_receive_kb(data, length);
} }
@@ -210,11 +212,13 @@ bool process_record_oryx(uint16_t keycode, keyrecord_t *record) {
webusb_state.pairing = true; webusb_state.pairing = true;
} }
return false; return false;
#ifdef DYNAMIC_KEYMAP_ENABLE
case MACRO00 ... MACRO15: case MACRO00 ... MACRO15:
if (record->event.pressed) { if (record->event.pressed) {
dynamic_keymap_macro_send(keycode - MACRO00); dynamic_keymap_macro_send(keycode - MACRO00);
} }
return false; return false;
#endif
} }
return true; return true;
} }
@@ -232,6 +236,8 @@ void layer_state_set_oryx(layer_state_t state) {
void eeconfig_init_oryx(void) { void eeconfig_init_oryx(void) {
// reread settings from flash into eeprom // reread settings from flash into eeprom
#ifdef DYNAMIC_KEYMAP_ENABLE
dynamic_keymap_reset(); dynamic_keymap_reset();
dynamic_keymap_macro_reset(); dynamic_keymap_macro_reset();
#endif
} }

View File

@@ -7,10 +7,6 @@
# error "WebUSB needs to be enabled, please enable it!" # error "WebUSB needs to be enabled, please enable it!"
#endif #endif
#ifndef DYNAMIC_KEYMAP_ENABLE
# error "Dynamic Keymaps are not enabled. It must be enabled"
#endif
// enum Oryx_Status_code { // enum Oryx_Status_code {
// PLACEHOLDER = WEBUSB_STATUS_SAFE_RANGE, // PLACEHOLDER = WEBUSB_STATUS_SAFE_RANGE,
// } // }
@@ -54,6 +50,7 @@ enum Oryx_Event_Code {
ORYX_EVT_KEYUP, ORYX_EVT_KEYUP,
}; };
#ifdef DYNAMIC_KEYMAP_ENABLE
enum dynamic_macros_keycodes { enum dynamic_macros_keycodes {
MACRO00 = 0x5F12, MACRO00 = 0x5F12,
MACRO01, MACRO01,
@@ -72,7 +69,7 @@ enum dynamic_macros_keycodes {
MACRO14, MACRO14,
MACRO15, MACRO15,
}; };
#endif
extern bool oryx_state_live_training_enabled; extern bool oryx_state_live_training_enabled;