diff options
Diffstat (limited to 'quantum/quantum.h')
| -rw-r--r-- | quantum/quantum.h | 111 |
1 files changed, 74 insertions, 37 deletions
diff --git a/quantum/quantum.h b/quantum/quantum.h index d4da77289..7ebfb24e3 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h | |||
| @@ -1,28 +1,31 @@ | |||
| 1 | #ifndef QUANTUM_H | 1 | #ifndef QUANTUM_H |
| 2 | #define QUANTUM_H | 2 | #define QUANTUM_H |
| 3 | 3 | ||
| 4 | #if defined(__AVR__) | ||
| 5 | #include <avr/pgmspace.h> | ||
| 6 | #include <avr/io.h> | ||
| 7 | #include <avr/interrupt.h> | ||
| 8 | #endif | ||
| 9 | #include "wait.h" | ||
| 4 | #include "matrix.h" | 10 | #include "matrix.h" |
| 5 | #include "keymap_common.h" | 11 | #include "keymap.h" |
| 6 | #ifdef BACKLIGHT_ENABLE | 12 | #ifdef BACKLIGHT_ENABLE |
| 7 | #include "backlight.h" | 13 | #include "backlight.h" |
| 8 | #endif | 14 | #endif |
| 9 | #ifdef RGBLIGHT_ENABLE | 15 | #ifdef RGBLIGHT_ENABLE |
| 10 | #include "rgblight.h" | 16 | #include "rgblight.h" |
| 11 | #endif | 17 | #endif |
| 12 | #ifdef AUDIO_ENABLE | ||
| 13 | #include "audio.h" | ||
| 14 | #endif | ||
| 15 | #ifdef MIDI_ENABLE | ||
| 16 | #include <lufa.h> | ||
| 17 | #endif | ||
| 18 | #ifdef UNICODE_ENABLE | ||
| 19 | #include "unicode.h" | ||
| 20 | #endif | ||
| 21 | 18 | ||
| 22 | #include "action_layer.h" | 19 | #include "action_layer.h" |
| 23 | #include "eeconfig.h" | 20 | #include "eeconfig.h" |
| 24 | #include <stddef.h> | 21 | #include <stddef.h> |
| 25 | #include <avr/io.h> | 22 | #include "bootloader.h" |
| 23 | #include "timer.h" | ||
| 24 | #include "config_common.h" | ||
| 25 | #include "led.h" | ||
| 26 | #include "action_util.h" | ||
| 27 | #include <stdlib.h> | ||
| 28 | |||
| 26 | 29 | ||
| 27 | extern uint32_t default_layer_state; | 30 | extern uint32_t default_layer_state; |
| 28 | 31 | ||
| @@ -30,43 +33,77 @@ extern uint32_t default_layer_state; | |||
| 30 | extern uint32_t layer_state; | 33 | extern uint32_t layer_state; |
| 31 | #endif | 34 | #endif |
| 32 | 35 | ||
| 36 | #ifdef MIDI_ENABLE | ||
| 37 | #include <lufa.h> | ||
| 38 | #include "process_midi.h" | ||
| 39 | #endif | ||
| 40 | |||
| 33 | #ifdef AUDIO_ENABLE | 41 | #ifdef AUDIO_ENABLE |
| 34 | bool music_activated; | 42 | #include "audio.h" |
| 43 | #include "process_music.h" | ||
| 35 | #endif | 44 | #endif |
| 36 | 45 | ||
| 37 | #ifdef UNICODE_ENABLE | 46 | #ifndef DISABLE_LEADER |
| 38 | #define UC_OSX 0 | 47 | #include "process_leader.h" |
| 39 | #define UC_LNX 1 | 48 | #endif |
| 40 | #define UC_WIN 2 | ||
| 41 | #define UC_BSD 3 | ||
| 42 | 49 | ||
| 43 | void set_unicode_input_mode(uint8_t os_target); | 50 | #define DISABLE_CHORDING |
| 51 | #ifndef DISABLE_CHORDING | ||
| 52 | #include "process_chording.h" | ||
| 44 | #endif | 53 | #endif |
| 45 | 54 | ||
| 46 | #ifndef DISABLE_LEADER | 55 | #ifdef UNICODE_ENABLE |
| 47 | void leader_start(void); | 56 | #include "process_unicode.h" |
| 48 | void leader_end(void); | ||
| 49 | |||
| 50 | #ifndef LEADER_TIMEOUT | ||
| 51 | #define LEADER_TIMEOUT 200 | ||
| 52 | #endif | ||
| 53 | #define SEQ_ONE_KEY(key) if (leader_sequence[0] == (key) && leader_sequence[1] == 0 && leader_sequence[2] == 0) | ||
| 54 | #define SEQ_TWO_KEYS(key1, key2) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == 0) | ||
| 55 | #define SEQ_THREE_KEYS(key1, key2, key3) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == (key3)) | ||
| 56 | |||
| 57 | #define LEADER_EXTERNS() extern bool leading; extern uint16_t leader_time; extern uint16_t leader_sequence[3]; extern uint8_t leader_sequence_size | ||
| 58 | #define LEADER_DICTIONARY() if (leading && timer_elapsed(leader_time) > LEADER_TIMEOUT) | ||
| 59 | #endif | 57 | #endif |
| 60 | 58 | ||
| 59 | #include "process_tap_dance.h" | ||
| 60 | |||
| 61 | #define SEND_STRING(str) send_string(PSTR(str)) | ||
| 62 | void send_string(const char *str); | ||
| 63 | |||
| 64 | // For tri-layer | ||
| 65 | void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); | ||
| 66 | |||
| 67 | void tap_random_base64(void); | ||
| 68 | |||
| 69 | #define IS_LAYER_ON(layer) (layer_state & (1UL << (layer))) | ||
| 70 | #define IS_LAYER_OFF(layer) (~layer_state & (1UL << (layer))) | ||
| 71 | |||
| 61 | void matrix_init_kb(void); | 72 | void matrix_init_kb(void); |
| 62 | void matrix_scan_kb(void); | 73 | void matrix_scan_kb(void); |
| 74 | void matrix_init_user(void); | ||
| 75 | void matrix_scan_user(void); | ||
| 63 | bool process_action_kb(keyrecord_t *record); | 76 | bool process_action_kb(keyrecord_t *record); |
| 77 | bool process_record_kb(uint16_t keycode, keyrecord_t *record); | ||
| 78 | bool process_record_user(uint16_t keycode, keyrecord_t *record); | ||
| 64 | 79 | ||
| 65 | bool is_music_on(void); | 80 | void reset_keyboard(void); |
| 66 | void music_toggle(void); | ||
| 67 | void music_on(void); | ||
| 68 | void music_off(void); | ||
| 69 | 81 | ||
| 70 | void music_on_user(void); | 82 | void startup_user(void); |
| 83 | void shutdown_user(void); | ||
| 71 | 84 | ||
| 72 | #endif \ No newline at end of file | 85 | #ifdef BACKLIGHT_ENABLE |
| 86 | void backlight_init_ports(void); | ||
| 87 | |||
| 88 | #ifdef BACKLIGHT_BREATHING | ||
| 89 | void breathing_enable(void); | ||
| 90 | void breathing_pulse(void); | ||
| 91 | void breathing_disable(void); | ||
| 92 | void breathing_self_disable(void); | ||
| 93 | void breathing_toggle(void); | ||
| 94 | bool is_breathing(void); | ||
| 95 | |||
| 96 | void breathing_defaults(void); | ||
| 97 | void breathing_intensity_default(void); | ||
| 98 | void breathing_speed_default(void); | ||
| 99 | void breathing_speed_set(uint8_t value); | ||
| 100 | void breathing_speed_inc(uint8_t value); | ||
| 101 | void breathing_speed_dec(uint8_t value); | ||
| 102 | #endif | ||
| 103 | |||
| 104 | #endif | ||
| 105 | |||
| 106 | void led_set_user(uint8_t usb_led); | ||
| 107 | void led_set_kb(uint8_t usb_led); | ||
| 108 | |||
| 109 | #endif | ||
