summaryrefslogtreecommitdiff
path: root/quantum/quantum.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c91
1 files changed, 11 insertions, 80 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 35b6351e9d..f12b1a9526 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -47,10 +47,6 @@ float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS;
# endif
#endif
-#ifdef AUTO_SHIFT_ENABLE
-# include "process_auto_shift.h"
-#endif
-
uint8_t extract_mod_bits(uint16_t code) {
switch (code) {
case QK_MODS ... QK_MODS_MAX:
@@ -76,9 +72,9 @@ uint8_t extract_mod_bits(uint16_t code) {
return mods_to_send;
}
-static void do_code16(uint16_t code, void (*f)(uint8_t)) { f(extract_mod_bits(code)); }
+void do_code16(uint16_t code, void (*f)(uint8_t)) { f(extract_mod_bits(code)); }
-void register_code16(uint16_t code) {
+__attribute__((weak)) void register_code16(uint16_t code) {
if (IS_MOD(code) || code == KC_NO) {
do_code16(code, register_mods);
} else {
@@ -87,7 +83,7 @@ void register_code16(uint16_t code) {
register_code(code);
}
-void unregister_code16(uint16_t code) {
+__attribute__((weak)) void unregister_code16(uint16_t code) {
unregister_code(code);
if (IS_MOD(code) || code == KC_NO) {
do_code16(code, unregister_mods);
@@ -96,7 +92,7 @@ void unregister_code16(uint16_t code) {
}
}
-void tap_code16(uint16_t code) {
+__attribute__((weak)) void tap_code16(uint16_t code) {
register_code16(code);
#if TAP_CODE_DELAY > 0
wait_ms(TAP_CODE_DELAY);
@@ -263,7 +259,7 @@ bool process_record_quantum(keyrecord_t *record) {
#ifdef TAP_DANCE_ENABLE
process_tap_dance(keycode, record) &&
#endif
-#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)
+#if defined(UNICODE_COMMON_ENABLE)
process_unicode_common(keycode, record) &&
#endif
#ifdef LEADER_ENABLE
@@ -306,12 +302,12 @@ bool process_record_quantum(keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
#ifndef NO_RESET
- case RESET:
+ case QK_BOOTLOADER:
reset_keyboard();
return false;
#endif
#ifndef NO_DEBUG
- case DEBUG:
+ case QK_DEBUG_TOGGLE:
debug_enable ^= 1;
if (debug_enable) {
print("DEBUG: enabled.\n");
@@ -320,7 +316,7 @@ bool process_record_quantum(keyrecord_t *record) {
}
#endif
return false;
- case EEPROM_RESET:
+ case QK_CLEAR_EEPROM:
eeconfig_init();
return false;
#ifdef VELOCIKEY_ENABLE
@@ -387,7 +383,7 @@ void matrix_init_quantum() {
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_init();
#endif
-#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)
+#if defined(UNICODE_COMMON_ENABLE)
unicode_input_mode_init();
#endif
#ifdef HAPTIC_ENABLE
@@ -400,73 +396,8 @@ void matrix_init_quantum() {
matrix_init_kb();
}
-void matrix_scan_quantum() {
-#if defined(AUDIO_ENABLE) && defined(AUDIO_INIT_DELAY)
- // There are some tasks that need to be run a little bit
- // after keyboard startup, or else they will not work correctly
- // because of interaction with the USB device state, which
- // may still be in flux...
- //
- // At the moment the only feature that needs this is the
- // startup song.
- static bool delayed_tasks_run = false;
- static uint16_t delayed_task_timer = 0;
- if (!delayed_tasks_run) {
- if (!delayed_task_timer) {
- delayed_task_timer = timer_read();
- } else if (timer_elapsed(delayed_task_timer) > 300) {
- audio_startup();
- delayed_tasks_run = true;
- }
- }
-#endif
-
-#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE)
- music_task();
-#endif
-
-#ifdef KEY_OVERRIDE_ENABLE
- key_override_task();
-#endif
-
-#ifdef SEQUENCER_ENABLE
- sequencer_task();
-#endif
-
-#ifdef TAP_DANCE_ENABLE
- tap_dance_task();
-#endif
-
-#ifdef COMBO_ENABLE
- combo_task();
-#endif
-
-#ifdef LED_MATRIX_ENABLE
- led_matrix_task();
-#endif
-
-#ifdef WPM_ENABLE
- decay_wpm();
-#endif
-
-#ifdef HAPTIC_ENABLE
- haptic_task();
-#endif
-
-#ifdef DIP_SWITCH_ENABLE
- dip_switch_read(false);
-#endif
-
-#ifdef AUTO_SHIFT_ENABLE
- autoshift_matrix_scan();
-#endif
-
- matrix_scan_kb();
-}
-
-#ifdef HD44780_ENABLED
-# include "hd44780.h"
-#endif
+// TODO: remove legacy api
+void matrix_scan_quantum() { matrix_scan_kb(); }
//------------------------------------------------------------------------------
// Override these functions in your keymap file to play different tunes on