Merge pull request #4501 from amayer5125/ergodox-ez-cleanup

Ergodox ez cleanup
master
Erez Zukerman 2018-11-27 19:42:09 -05:00 committed by GitHub
commit a152ad3145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 45 deletions

View File

@ -6,8 +6,7 @@
#define MDIA 2 // media keys #define MDIA 2 // media keys
enum custom_keycodes { enum custom_keycodes {
PLACEHOLDER = SAFE_RANGE, // can always be here EPRM = SAFE_RANGE,
EPRM,
VRSN, VRSN,
RGB_SLD RGB_SLD
}; };
@ -145,47 +144,21 @@ const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
}; };
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
break;
case 1:
if (record->event.pressed) { // For resetting EEPROM
eeconfig_init();
}
break;
}
return MACRO_NONE;
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { if (record->event.pressed) {
// dynamically generate these. switch (keycode) {
case EPRM: case EPRM:
if (record->event.pressed) {
eeconfig_init(); eeconfig_init();
} return false;
return false; case VRSN:
break;
case VRSN:
if (record->event.pressed) {
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
} return false;
return false; #ifdef RGBLIGHT_ENABLE
break; case RGB_SLD:
case RGB_SLD: rgblight_mode(1);
if (record->event.pressed) { return false;
#ifdef RGBLIGHT_ENABLE #endif
rgblight_mode(1); }
#endif
}
return false;
break;
} }
return true; return true;
} }
@ -197,11 +170,6 @@ void matrix_init_user(void) {
#endif #endif
}; };
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
};
// Runs whenever there is a layer state change. // Runs whenever there is a layer state change.
uint32_t layer_state_set_user(uint32_t state) { uint32_t layer_state_set_user(uint32_t state) {
ergodox_board_led_off(); ergodox_board_led_off();