X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fquantum.h;h=c7fce9a0f6099d09c8611999cec22a0b4ed98fdf;hb=f8d365a47847f8e49fde5096aa065dbee08cf728;hp=5920e4b13955894c4f64c3c225c83f70646bd3b0;hpb=28fbf84cc5ff52f545011ea4198a6cc6d054f896;p=qmk_firmware.git diff --git a/quantum/quantum.h b/quantum/quantum.h index 5920e4b13..c7fce9a0f 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -28,10 +28,11 @@ #include "matrix.h" #include "keymap.h" #ifdef BACKLIGHT_ENABLE - #include "backlight.h" -#endif -#if !defined(RGBLIGHT_ENABLE) && !defined(RGB_MATRIX_ENABLE) - #include "rgb.h" + #ifdef LED_MATRIX_ENABLE + #include "ledmatrix.h" + #else + #include "backlight.h" + #endif #endif #ifdef RGBLIGHT_ENABLE #include "rgblight.h" @@ -43,10 +44,6 @@ #endif #endif -#ifdef SPLIT_KEYBOARD - #include "split_flags.h" -#endif - #ifdef RGB_MATRIX_ENABLE #include "rgb_matrix.h" #endif @@ -138,6 +135,10 @@ extern uint32_t default_layer_state; #include "hd44780.h" #endif +#ifdef HAPTIC_ENABLE + #include "haptic.h" +#endif + //Function substitutions to ease GPIO manipulation #ifdef __AVR__ #define PIN_ADDRESS(p, offset) _SFR_IO8(ADDRESS_BASE + (p >> PORT_SHIFTER) + offset) @@ -161,7 +162,7 @@ extern uint32_t default_layer_state; } } - #define readPin(pin) (PIN_ADDRESS(pin, 0) & _BV(pin & 0xF)) + #define readPin(pin) ((bool)(PIN_ADDRESS(pin, 0) & _BV(pin & 0xF))) #elif defined(PROTOCOL_CHIBIOS) #define pin_t ioline_t #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) @@ -186,6 +187,10 @@ extern uint32_t default_layer_state; #define ADD_SLASH_X(y) STRINGIZE(\x ## y) #define SYMBOL_STR(x) ADD_SLASH_X(x) +#define SS_TAP_CODE 1 +#define SS_DOWN_CODE 2 +#define SS_UP_CODE 3 + #define SS_TAP(keycode) "\1" SYMBOL_STR(keycode) #define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode) #define SS_UP(keycode) "\3" SYMBOL_STR(keycode) @@ -223,6 +228,8 @@ void matrix_init_kb(void); void matrix_scan_kb(void); void matrix_init_user(void); void matrix_scan_user(void); +uint16_t get_record_keycode(keyrecord_t *record); +uint16_t get_event_keycode(keyevent_t event); bool process_action_kb(keyrecord_t *record); bool process_record_kb(uint16_t keycode, keyrecord_t *record); bool process_record_user(uint16_t keycode, keyrecord_t *record); @@ -243,7 +250,7 @@ void shutdown_user(void); void register_code16(uint16_t code); void unregister_code16(uint16_t code); -inline void tap_code16(uint16_t code) { register_code16(code); unregister_code16(code); } +void tap_code16(uint16_t code); #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void);