Merge remote-tracking branch 'qmk/master' into merge-2022-07-11
This commit is contained in:
commit
fde0c10bae
7121 changed files with 170388 additions and 28118 deletions
|
|
@ -127,7 +127,7 @@ __attribute__((weak)) void post_process_record_kb(uint16_t keycode, keyrecord_t
|
|||
|
||||
__attribute__((weak)) void post_process_record_user(uint16_t keycode, keyrecord_t *record) {}
|
||||
|
||||
void reset_keyboard(void) {
|
||||
void shutdown_quantum(void) {
|
||||
clear_keyboard();
|
||||
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
|
||||
process_midi_all_notes_off();
|
||||
|
|
@ -149,9 +149,18 @@ void reset_keyboard(void) {
|
|||
#ifdef HAPTIC_ENABLE
|
||||
haptic_shutdown();
|
||||
#endif
|
||||
}
|
||||
|
||||
void reset_keyboard(void) {
|
||||
shutdown_quantum();
|
||||
bootloader_jump();
|
||||
}
|
||||
|
||||
void soft_reset_keyboard(void) {
|
||||
shutdown_quantum();
|
||||
mcu_reset();
|
||||
}
|
||||
|
||||
/* Convert record into usable keycode via the contained event. */
|
||||
uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) {
|
||||
#ifdef COMBO_ENABLE
|
||||
|
|
@ -220,6 +229,12 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
// return false;
|
||||
// }
|
||||
|
||||
#if defined(SECURE_ENABLE)
|
||||
if (!preprocess_secure(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef VELOCIKEY_ENABLE
|
||||
if (velocikey_enabled() && record->event.pressed) {
|
||||
velocikey_accelerate();
|
||||
|
|
@ -258,6 +273,9 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
process_record_vial(keycode, record) &&
|
||||
#endif
|
||||
process_record_kb(keycode, record) &&
|
||||
#if defined(SECURE_ENABLE)
|
||||
process_secure(keycode, record) &&
|
||||
#endif
|
||||
#if defined(SEQUENCER_ENABLE)
|
||||
process_sequencer(keycode, record) &&
|
||||
#endif
|
||||
|
|
@ -282,6 +300,9 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
#ifdef TAP_DANCE_ENABLE
|
||||
process_tap_dance(keycode, record) &&
|
||||
#endif
|
||||
#ifdef CAPS_WORD_ENABLE
|
||||
process_caps_word(keycode, record) &&
|
||||
#endif
|
||||
#if defined(UNICODE_COMMON_ENABLE)
|
||||
process_unicode_common(keycode, record) &&
|
||||
#endif
|
||||
|
|
@ -328,6 +349,9 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
case QK_BOOTLOADER:
|
||||
reset_keyboard();
|
||||
return false;
|
||||
case QK_REBOOT:
|
||||
soft_reset_keyboard();
|
||||
return false;
|
||||
#endif
|
||||
#ifndef NO_DEBUG
|
||||
case QK_DEBUG_TOGGLE:
|
||||
|
|
@ -341,6 +365,9 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
return false;
|
||||
case QK_CLEAR_EEPROM:
|
||||
eeconfig_init();
|
||||
#ifndef NO_RESET
|
||||
soft_reset_keyboard();
|
||||
#endif
|
||||
return false;
|
||||
#ifdef VELOCIKEY_ENABLE
|
||||
case VLK_TOG:
|
||||
|
|
@ -368,6 +395,26 @@ bool process_record_quantum_helper(uint16_t keycode, keyrecord_t *record) {
|
|||
case ONESHOT_DISABLE:
|
||||
oneshot_disable();
|
||||
break;
|
||||
#endif
|
||||
#ifdef ENABLE_COMPILE_KEYCODE
|
||||
case QK_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
|
||||
{
|
||||
# ifdef NO_ACTION_ONESHOT
|
||||
const uint8_t temp_mod = mod_config(get_mods());
|
||||
# else
|
||||
const uint8_t temp_mod = mod_config(get_mods() | get_oneshot_mods());
|
||||
clear_oneshot_mods();
|
||||
# endif
|
||||
clear_mods();
|
||||
|
||||
SEND_STRING_DELAY("qmk", TAP_CODE_DELAY);
|
||||
if (temp_mod & MOD_MASK_SHIFT) { // if shift is held, flash rather than compile
|
||||
SEND_STRING_DELAY(" flash ", TAP_CODE_DELAY);
|
||||
} else {
|
||||
SEND_STRING_DELAY(" compile ", TAP_CODE_DELAY);
|
||||
}
|
||||
SEND_STRING_DELAY("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP SS_TAP(X_ENTER), TAP_CODE_DELAY);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -535,3 +582,16 @@ const char *get_u16_str(uint16_t curr_num, char curr_pad) {
|
|||
last_pad = curr_pad;
|
||||
return get_numeric_str(buf, sizeof(buf), curr_num, curr_pad);
|
||||
}
|
||||
|
||||
#if defined(SECURE_ENABLE)
|
||||
void secure_hook_quantum(secure_status_t secure_status) {
|
||||
// If keys are being held when this is triggered, they may not be released properly
|
||||
// this can result in stuck keys, mods and layers. To prevent that, manually
|
||||
// clear these, when it is triggered.
|
||||
|
||||
if (secure_status == SECURE_PENDING) {
|
||||
clear_keyboard();
|
||||
layer_clear();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue