From d15bb05c935e378f2e1e912a46c3114697dd00e4 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Sat, 30 Mar 2019 14:24:13 +1100 Subject: Added SS_TAP_CODE, SS_DOWN_CODE, SS_UP_CODE --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index d2c5862f88..e1e20a7606 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -191,6 +191,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) -- cgit v1.2.3 From 5701b75e3c10728d424ec058d26ef2e354aba0c0 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 5 Apr 2019 12:47:25 -0700 Subject: Custom Tapping Term per key (#5009) * Add customizable tapping terms * Add Documentation * Fix function * Fixes * It's not a pointer * Add debugging output * Update documentation to be at least vaguely accurate * Use `get_tapping_term(tapping_key.event)` instead `e` doesn't include column and row information, properly. It registers as 255, regardless of the actual keypress. However `tapping_key.event` actually gives the correct column and row information. It appears be the correct structure to use. In fact, it looks like the issue is that `e` is actually the "TICK" structure, as defined in keyboard.h * Use variable tapping term value rather than define * Silly drashna - tapping_key.event, not event * add get_event_keycode() function * Fix typo Co-Authored-By: drashna * Remove post_process_record_quantum since it's the wrong PR * Update quantum/quantum.c Co-Authored-By: drashna * Better handle ifdef statement for permissive hold Since we can't be sure that tapping term is actually 500 * Update quantum.c comments based on feedback * Clean up get_tapping_term function Clean up function so that users don't need to call the event function, and instead only check the keycode * Add ability to run functionality on and off * Make ifdef's more compact --- quantum/quantum.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index c12ac9ab8a..d0b2bedb1b 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -224,6 +224,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); -- cgit v1.2.3 From 7148c0b10c298af12172231e79c0cda1c1f76f04 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 17 Feb 2019 08:58:02 -0800 Subject: Clean up some of the code --- quantum/quantum.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index c7fce9a0f6..f7b278cefd 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -206,6 +206,7 @@ extern uint32_t default_layer_state; #define SEND_STRING(str) send_string_P(PSTR(str)) extern const bool ascii_to_shift_lut[0x80]; +extern const bool ascii_to_alt_lut[0x80]; extern const uint8_t ascii_to_keycode_lut[0x80]; void send_string(const char *str); void send_string_with_delay(const char *str, uint8_t interval); -- cgit v1.2.3 From a6857d18e14322fb75bb168ab13fbea0ff631324 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 11 Apr 2019 15:21:45 -0700 Subject: Change table names --- quantum/quantum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index f7b278cefd..e2f467125e 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -206,7 +206,7 @@ extern uint32_t default_layer_state; #define SEND_STRING(str) send_string_P(PSTR(str)) extern const bool ascii_to_shift_lut[0x80]; -extern const bool ascii_to_alt_lut[0x80]; +extern const bool ascii_to_altgr_lut[0x80]; extern const uint8_t ascii_to_keycode_lut[0x80]; void send_string(const char *str); void send_string_with_delay(const char *str, uint8_t interval); -- cgit v1.2.3 From 0a645225b9c863a106921185a6c2e0c340f10694 Mon Sep 17 00:00:00 2001 From: Ryan Caltabiano Date: Mon, 15 Apr 2019 22:32:57 -0500 Subject: OLED Driver Feature --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index e2f467125e..987516dedb 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -139,6 +139,10 @@ extern uint32_t default_layer_state; #include "haptic.h" #endif +#ifdef OLED_DRIVER_ENABLE + #include "oled_driver.h" +#endif + //Function substitutions to ease GPIO manipulation #ifdef __AVR__ #define PIN_ADDRESS(p, offset) _SFR_IO8(ADDRESS_BASE + (p >> PORT_SHIFTER) + offset) -- cgit v1.2.3 From b61baf4281bde34bfe28aaa1109bd5d5c6471116 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Mon, 22 Apr 2019 11:34:13 -0400 Subject: Fix #3566 use an hardware timer for software PWM stability (#3615) With my XD60, I noticed that when typing the backlight was flickering. The XD60 doesn't have the backlight wired to a hardware PWM pin. I assumed it was a timing issue in the matrix scan that made the PWM lit the LED a bit too longer. I verified it because the more keys that were pressed, the more lighting I observed. This patch makes the software PWM be called during CPU interruptions. It works almost like the hardware PWM, except instead of using the CPU waveform generation, the CPU will fire interruption when the LEDs need be turned on or off. Using the same timer system as for hardware PWM, when the counter will reach OCRxx (the current backlight level), an Output Compare match interrupt will be fired and we'll turn the LEDs off. When the counter reaches its maximum value, an overflow interrupt will be triggered in which we turn the LEDs on. This way we replicate the hardware backlight PWM duty cycle. This gives a better time stability of the PWM computation than pure software PWM, leading to a flicker free backlight. Since this is reusing the hardware PWM code, software PWM also supports backlight breathing. Note that if timer1 is used for audio, backlight will use timer3, and if timer3 is used for audio backlight will use timer1. If both timers are used for audio, then this feature is disabled and we revert to the matrix scan based PWM computation. Signed-off-by: Brice Figureau --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 987516dedb..17cb902740 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -260,8 +260,12 @@ void tap_code16(uint16_t code); #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void); void backlight_task(void); +void backlight_task_internal(void); +void backlight_on(uint8_t backlight_pin); +void backlight_off(uint8_t backlight_pin); #ifdef BACKLIGHT_BREATHING +void breathing_task(void); void breathing_enable(void); void breathing_pulse(void); void breathing_disable(void); -- cgit v1.2.3 From c745d9b82e3f2047feb97a7a8937f27c6e989fd7 Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Mon, 29 Apr 2019 22:21:46 -0500 Subject: Simple extended space cadet (#5277) * Simplifying and Extending Space Cadet to work on Ctrl and Alt keys * PR Review feedback * Reverting back to keycodes --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 17cb902740..208268df65 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -131,6 +131,10 @@ extern uint32_t default_layer_state; #include "process_terminal_nop.h" #endif +#ifdef SPACE_CADET_ENABLE + #include "process_space_cadet.h" +#endif + #ifdef HD44780_ENABLE #include "hd44780.h" #endif -- cgit v1.2.3 From 00d1d7828c63538122d9d3db7336b9a40c9ffe80 Mon Sep 17 00:00:00 2001 From: Alex Ong Date: Sat, 18 May 2019 06:47:50 +1000 Subject: Typedef'ed layer_state_t to uint32_t (#3637) * Typedef'ed layer_state_t to uint32_t. This enables future work with layer_state_t to uint8_t for optimization purposes. * Removed accidental xeal60 commit * Revert to egyptian brackets, added sizeof(layer_state_t) so when layer_state_t is redefined it will automagically work. * Add additional typedefs * Add checks for setting layer state * Update tmk_core/common/action_layer.h Co-Authored-By: alex-ong * Revert commit. --- quantum/quantum.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 208268df65..451dd8a4bd 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -61,10 +61,10 @@ #include "send_string_keycodes.h" #include "suspend.h" -extern uint32_t default_layer_state; +extern layer_state_t default_layer_state; #ifndef NO_ACTION_LAYER - extern uint32_t layer_state; + extern layer_state_t layer_state; #endif #ifdef MIDI_ENABLE -- cgit v1.2.3 From c69060465ea1ce4f77fb69e2dea7cb035f89ba4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 9 Jul 2019 20:16:24 +0200 Subject: Fix parentheses in macros, and in general clean up quantum.h (#5021) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix up GPIO macros * Fix up send string macros `string` arguments must not be parenthesized * Fix up miscellaneous macros * Make indentation uniform (4 spaces) * Make #ifdef vs #if defined usage consistent * Reorder standard includes * Revert indentation changes as per review comments * Revert #if defined(__AVR__) → #ifdef __AVR__ change * Change 2 space indent to 4 spaces on a couple of lines * Replace include guard with #pragma once --- quantum/quantum.h | 119 ++++++++++++++++++++++++------------------------------ 1 file changed, 53 insertions(+), 66 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 451dd8a4bd..f089c6ef64 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef QUANTUM_H -#define QUANTUM_H +#pragma once #if defined(__AVR__) #include @@ -24,9 +23,11 @@ #if defined(PROTOCOL_CHIBIOS) #include "hal.h" #endif + #include "wait.h" #include "matrix.h" #include "keymap.h" + #ifdef BACKLIGHT_ENABLE #ifdef LED_MATRIX_ENABLE #include "ledmatrix.h" @@ -34,14 +35,13 @@ #include "backlight.h" #endif #endif -#ifdef RGBLIGHT_ENABLE - #include "rgblight.h" -#else - #ifdef RGB_MATRIX_ENABLE - /* dummy define RGBLIGHT_MODE_xxxx */ - #define RGBLIGHT_H_DUMMY_DEFINE - #include "rgblight.h" - #endif + +#if defined(RGBLIGHT_ENABLE) + #include "rgblight.h" +#elif defined(RGB_MATRIX_ENABLE) + // Dummy define RGBLIGHT_MODE_xxxx + #define RGBLIGHT_H_DUMMY_DEFINE + #include "rgblight.h" #endif #ifdef RGB_MATRIX_ENABLE @@ -50,16 +50,16 @@ #include "action_layer.h" #include "eeconfig.h" -#include #include "bootloader.h" #include "timer.h" #include "config_common.h" #include "led.h" #include "action_util.h" -#include #include "print.h" #include "send_string_keycodes.h" #include "suspend.h" +#include +#include extern layer_state_t default_layer_state; @@ -67,18 +67,16 @@ extern layer_state_t default_layer_state; extern layer_state_t layer_state; #endif -#ifdef MIDI_ENABLE -#ifdef MIDI_ADVANCED +#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) #include "process_midi.h" #endif -#endif // MIDI_ENABLE #ifdef AUDIO_ENABLE #include "audio.h" #include "process_audio.h" #ifdef AUDIO_CLICKY #include "process_clicky.h" - #endif // AUDIO_CLICKY + #endif #endif #ifdef STENO_ENABLE @@ -106,7 +104,7 @@ extern layer_state_t default_layer_state; #endif #ifdef TAP_DANCE_ENABLE - #include "process_tap_dance.h" + #include "process_tap_dance.h" #endif #ifdef PRINTING_ENABLE @@ -132,7 +130,7 @@ extern layer_state_t default_layer_state; #endif #ifdef SPACE_CADET_ENABLE - #include "process_space_cadet.h" + #include "process_space_cadet.h" #endif #ifdef HD44780_ENABLE @@ -147,50 +145,38 @@ extern layer_state_t default_layer_state; #include "oled_driver.h" #endif -//Function substitutions to ease GPIO manipulation -#ifdef __AVR__ - #define PIN_ADDRESS(p, offset) _SFR_IO8(ADDRESS_BASE + (p >> PORT_SHIFTER) + offset) - - #define pin_t uint8_t - #define setPinInput(pin) PIN_ADDRESS(pin, 1) &= ~ _BV(pin & 0xF) - #define setPinInputHigh(pin) ({\ - PIN_ADDRESS(pin, 1) &= ~ _BV(pin & 0xF);\ - PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF);\ - }) - #define setPinInputLow(pin) _Static_assert(0, "AVR Processors cannot impliment an input as pull low") - #define setPinOutput(pin) PIN_ADDRESS(pin, 1) |= _BV(pin & 0xF) - - #define writePinHigh(pin) PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF) - #define writePinLow(pin) PIN_ADDRESS(pin, 2) &= ~_BV(pin & 0xF) - static inline void writePin(pin_t pin, uint8_t level){ - if (level){ - PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF); - } else { - PIN_ADDRESS(pin, 2) &= ~_BV(pin & 0xF); - } - } - - #define readPin(pin) ((bool)(PIN_ADDRESS(pin, 0) & _BV(pin & 0xF))) +// Function substitutions to ease GPIO manipulation +#if defined(__AVR__) + typedef uint8_t pin_t; + + #define PIN_ADDRESS(p, offset) (_SFR_IO8(ADDRESS_BASE + ((p) >> PORT_SHIFTER) + (offset))) + #define setPinInput(pin) (PIN_ADDRESS(pin, 1) &= ~_BV((pin) & 0xF)) + #define setPinInputHigh(pin) (PIN_ADDRESS(pin, 1) &= ~_BV((pin) & 0xF), \ + PIN_ADDRESS(pin, 2) |= _BV((pin) & 0xF)) + #define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") + #define setPinOutput(pin) (PIN_ADDRESS(pin, 1) |= _BV((pin) & 0xF)) + + #define writePinHigh(pin) (PIN_ADDRESS(pin, 2) |= _BV((pin) & 0xF)) + #define writePinLow(pin) (PIN_ADDRESS(pin, 2) &= ~_BV((pin) & 0xF)) + #define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) + + #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) - #define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) - #define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) - #define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) - - #define writePinHigh(pin) palSetLine(pin) - #define writePinLow(pin) palClearLine(pin) - static inline void writePin(pin_t pin, uint8_t level){ - if (level){ - palSetLine(pin); - } else { - palClearLine(pin); - } - } - - #define readPin(pin) palReadLine(pin) + typedef ioline_t pin_t; + + #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) + #define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) + #define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) + #define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) + + #define writePinHigh(pin) palSetLine(pin) + #define writePinLow(pin) palClearLine(pin) + #define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) + + #define readPin(pin) palReadLine(pin) #endif +// Send string macros #define STRINGIZE(z) #z #define ADD_SLASH_X(y) STRINGIZE(\x ## y) #define SYMBOL_STR(x) ADD_SLASH_X(x) @@ -203,6 +189,7 @@ extern layer_state_t default_layer_state; #define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode) #define SS_UP(keycode) "\3" SYMBOL_STR(keycode) +// `string` arguments must not be parenthesized #define SS_LCTRL(string) SS_DOWN(X_LCTRL) string SS_UP(X_LCTRL) #define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI) #define SS_LCMD(string) SS_LGUI(string) @@ -212,10 +199,12 @@ extern layer_state_t default_layer_state; #define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT) #define SS_ALGR(string) SS_RALT(string) -#define SEND_STRING(str) send_string_P(PSTR(str)) +#define SEND_STRING(string) send_string_P(PSTR(string)) + extern const bool ascii_to_shift_lut[0x80]; extern const bool ascii_to_altgr_lut[0x80]; extern const uint8_t ascii_to_keycode_lut[0x80]; + void send_string(const char *str); void send_string_with_delay(const char *str, uint8_t interval); void send_string_P(const char *str); @@ -244,10 +233,10 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record); bool process_record_user(uint16_t keycode, keyrecord_t *record); #ifndef BOOTMAGIC_LITE_COLUMN - #define BOOTMAGIC_LITE_COLUMN 0 + #define BOOTMAGIC_LITE_COLUMN 0 #endif #ifndef BOOTMAGIC_LITE_ROW - #define BOOTMAGIC_LITE_ROW 0 + #define BOOTMAGIC_LITE_ROW 0 #endif void bootmagic_lite(void); @@ -268,7 +257,7 @@ void backlight_task_internal(void); void backlight_on(uint8_t backlight_pin); void backlight_off(uint8_t backlight_pin); -#ifdef BACKLIGHT_BREATHING + #ifdef BACKLIGHT_BREATHING void breathing_task(void); void breathing_enable(void); void breathing_pulse(void); @@ -282,9 +271,9 @@ void breathing_period_default(void); void breathing_period_set(uint8_t value); void breathing_period_inc(void); void breathing_period_dec(void); + #endif #endif -#endif void send_dword(uint32_t number); void send_word(uint16_t number); void send_byte(uint8_t number); @@ -295,5 +284,3 @@ void led_set_user(uint8_t usb_led); void led_set_kb(uint8_t usb_led); void api_send_unicode(uint32_t unicode); - -#endif -- cgit v1.2.3 From a5ecf146085716f3a79424c2f4b3b3039ff36b3e Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 16 Jul 2019 16:15:07 +1000 Subject: Sendstring LUT improvements (#5727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Align sendstring LUTs to 9 characters wide * Replace 0 with XXXXXXX * Use decimal 128 for LUT size * Align heading comments * Add ASCII table comments * Add missing AltGr LUTs and adjust keycode LUTs accordingly * Use pragma once * Correct a couple more keycodes * Capitalise "BÉPO" * Also clean up the default tables * Tidy up Belgian and Norman LUTs --- quantum/quantum.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index f089c6ef64..56f30624c7 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -201,9 +201,9 @@ extern layer_state_t default_layer_state; #define SEND_STRING(string) send_string_P(PSTR(string)) -extern const bool ascii_to_shift_lut[0x80]; -extern const bool ascii_to_altgr_lut[0x80]; -extern const uint8_t ascii_to_keycode_lut[0x80]; +extern const bool ascii_to_shift_lut[128]; +extern const bool ascii_to_altgr_lut[128]; +extern const uint8_t ascii_to_keycode_lut[128]; void send_string(const char *str); void send_string_with_delay(const char *str, uint8_t interval); -- cgit v1.2.3 From b62e160a8950f451b08f1fee0109e60a58c5ddaa Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 21 Aug 2019 17:07:49 -0700 Subject: Additional changes for Layer State typedef compatibility (#5906) * Additional changes for Layer State typedef compatibility * Replace biton32 with get_highest_layer in docs * Change additional layer structure code * Fix uGFX reference issue * Remove dynamic_keymap check * Where did all these extra spaces come from Co-Authored-By: fauxpark --- quantum/quantum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 56f30624c7..2214625670 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -213,7 +213,7 @@ void send_char(char ascii_code); // For tri-layer void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); -uint32_t update_tri_layer_state(uint32_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); +layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); void set_single_persistent_default_layer(uint8_t default_layer); -- cgit v1.2.3 From 1c5b0cbbeb049b1ce3fb2da6a81fbf83dd9a3ea7 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Thu, 22 Aug 2019 09:10:47 +0900 Subject: AVR GPIO macro defines more readable (#5937) * A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro. --- quantum/quantum.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 2214625670..2cb26d4f46 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -149,18 +149,17 @@ extern layer_state_t default_layer_state; #if defined(__AVR__) typedef uint8_t pin_t; - #define PIN_ADDRESS(p, offset) (_SFR_IO8(ADDRESS_BASE + ((p) >> PORT_SHIFTER) + (offset))) - #define setPinInput(pin) (PIN_ADDRESS(pin, 1) &= ~_BV((pin) & 0xF)) - #define setPinInputHigh(pin) (PIN_ADDRESS(pin, 1) &= ~_BV((pin) & 0xF), \ - PIN_ADDRESS(pin, 2) |= _BV((pin) & 0xF)) + #define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin) & 0xF)) + #define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin) & 0xF), \ + PORTx_ADDRESS(pin) |= _BV((pin) & 0xF)) #define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") - #define setPinOutput(pin) (PIN_ADDRESS(pin, 1) |= _BV((pin) & 0xF)) + #define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin) & 0xF)) - #define writePinHigh(pin) (PIN_ADDRESS(pin, 2) |= _BV((pin) & 0xF)) - #define writePinLow(pin) (PIN_ADDRESS(pin, 2) &= ~_BV((pin) & 0xF)) + #define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin) & 0xF)) + #define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin) & 0xF)) #define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) - #define readPin(pin) ((bool)(PIN_ADDRESS(pin, 0) & _BV((pin) & 0xF))) + #define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin) & 0xF))) #elif defined(PROTOCOL_CHIBIOS) typedef ioline_t pin_t; -- cgit v1.2.3 From b624f32f944acdc59dcb130674c09090c5c404cb Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 30 Aug 2019 11:19:03 -0700 Subject: clang-format changes --- quantum/quantum.h | 153 +++++++++++++++++++++++++++--------------------------- 1 file changed, 76 insertions(+), 77 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 2cb26d4f46..066113590e 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -16,12 +16,12 @@ #pragma once #if defined(__AVR__) - #include - #include - #include +# include +# include +# include #endif #if defined(PROTOCOL_CHIBIOS) - #include "hal.h" +# include "hal.h" #endif #include "wait.h" @@ -29,23 +29,23 @@ #include "keymap.h" #ifdef BACKLIGHT_ENABLE - #ifdef LED_MATRIX_ENABLE - #include "ledmatrix.h" - #else - #include "backlight.h" - #endif +# ifdef LED_MATRIX_ENABLE +# include "ledmatrix.h" +# else +# include "backlight.h" +# endif #endif #if defined(RGBLIGHT_ENABLE) - #include "rgblight.h" +# include "rgblight.h" #elif defined(RGB_MATRIX_ENABLE) - // Dummy define RGBLIGHT_MODE_xxxx - #define RGBLIGHT_H_DUMMY_DEFINE - #include "rgblight.h" +// Dummy define RGBLIGHT_MODE_xxxx +# define RGBLIGHT_H_DUMMY_DEFINE +# include "rgblight.h" #endif #ifdef RGB_MATRIX_ENABLE - #include "rgb_matrix.h" +# include "rgb_matrix.h" #endif #include "action_layer.h" @@ -64,120 +64,119 @@ extern layer_state_t default_layer_state; #ifndef NO_ACTION_LAYER - extern layer_state_t layer_state; +extern layer_state_t layer_state; #endif #if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) - #include "process_midi.h" +# include "process_midi.h" #endif #ifdef AUDIO_ENABLE - #include "audio.h" - #include "process_audio.h" - #ifdef AUDIO_CLICKY - #include "process_clicky.h" - #endif +# include "audio.h" +# include "process_audio.h" +# ifdef AUDIO_CLICKY +# include "process_clicky.h" +# endif #endif #ifdef STENO_ENABLE - #include "process_steno.h" +# include "process_steno.h" #endif #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) - #include "process_music.h" +# include "process_music.h" #endif #ifdef LEADER_ENABLE - #include "process_leader.h" +# include "process_leader.h" #endif #ifdef UNICODE_ENABLE - #include "process_unicode.h" +# include "process_unicode.h" #endif #ifdef UCIS_ENABLE - #include "process_ucis.h" +# include "process_ucis.h" #endif #ifdef UNICODEMAP_ENABLE - #include "process_unicodemap.h" +# include "process_unicodemap.h" #endif #ifdef TAP_DANCE_ENABLE - #include "process_tap_dance.h" +# include "process_tap_dance.h" #endif #ifdef PRINTING_ENABLE - #include "process_printer.h" +# include "process_printer.h" #endif #ifdef AUTO_SHIFT_ENABLE - #include "process_auto_shift.h" +# include "process_auto_shift.h" #endif #ifdef COMBO_ENABLE - #include "process_combo.h" +# include "process_combo.h" #endif #ifdef KEY_LOCK_ENABLE - #include "process_key_lock.h" +# include "process_key_lock.h" #endif #ifdef TERMINAL_ENABLE - #include "process_terminal.h" +# include "process_terminal.h" #else - #include "process_terminal_nop.h" +# include "process_terminal_nop.h" #endif #ifdef SPACE_CADET_ENABLE - #include "process_space_cadet.h" +# include "process_space_cadet.h" #endif #ifdef HD44780_ENABLE - #include "hd44780.h" +# include "hd44780.h" #endif #ifdef HAPTIC_ENABLE - #include "haptic.h" +# include "haptic.h" #endif #ifdef OLED_DRIVER_ENABLE - #include "oled_driver.h" +# include "oled_driver.h" #endif // Function substitutions to ease GPIO manipulation #if defined(__AVR__) - typedef uint8_t pin_t; +typedef uint8_t pin_t; - #define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin) & 0xF)) - #define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin) & 0xF), \ - PORTx_ADDRESS(pin) |= _BV((pin) & 0xF)) - #define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") - #define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin) & 0xF)) +# define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF)) +# define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) +# define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") +# define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) - #define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin) & 0xF)) - #define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin) & 0xF)) - #define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) +# define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) +# define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) +# define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) - #define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin) & 0xF))) +# define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) #elif defined(PROTOCOL_CHIBIOS) - typedef ioline_t pin_t; +typedef ioline_t pin_t; - #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) - #define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) - #define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) - #define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) +# define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) +# define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) +# define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) +# define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) - #define writePinHigh(pin) palSetLine(pin) - #define writePinLow(pin) palClearLine(pin) - #define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) +# define writePinHigh(pin) palSetLine(pin) +# define writePinLow(pin) palClearLine(pin) +# define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) - #define readPin(pin) palReadLine(pin) +# define readPin(pin) palReadLine(pin) #endif // Send string macros #define STRINGIZE(z) #z -#define ADD_SLASH_X(y) STRINGIZE(\x ## y) +#define ADD_SLASH_X(y) STRINGIZE(\x##y) #define SYMBOL_STR(x) ADD_SLASH_X(x) #define SS_TAP_CODE 1 @@ -200,8 +199,8 @@ extern layer_state_t default_layer_state; #define SEND_STRING(string) send_string_P(PSTR(string)) -extern const bool ascii_to_shift_lut[128]; -extern const bool ascii_to_altgr_lut[128]; +extern const bool ascii_to_shift_lut[128]; +extern const bool ascii_to_altgr_lut[128]; extern const uint8_t ascii_to_keycode_lut[128]; void send_string(const char *str); @@ -211,31 +210,31 @@ void send_string_with_delay_P(const char *str, uint8_t interval); void send_char(char ascii_code); // For tri-layer -void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); +void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3); void set_single_persistent_default_layer(uint8_t default_layer); void tap_random_base64(void); -#define IS_LAYER_ON(layer) (layer_state & (1UL << (layer))) +#define IS_LAYER_ON(layer) (layer_state & (1UL << (layer))) #define IS_LAYER_OFF(layer) (~layer_state & (1UL << (layer))) -void matrix_init_kb(void); -void matrix_scan_kb(void); -void matrix_init_user(void); -void matrix_scan_user(void); +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); +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); #ifndef BOOTMAGIC_LITE_COLUMN - #define BOOTMAGIC_LITE_COLUMN 0 +# define BOOTMAGIC_LITE_COLUMN 0 #endif #ifndef BOOTMAGIC_LITE_ROW - #define BOOTMAGIC_LITE_ROW 0 +# define BOOTMAGIC_LITE_ROW 0 #endif void bootmagic_lite(void); @@ -256,7 +255,7 @@ void backlight_task_internal(void); void backlight_on(uint8_t backlight_pin); void backlight_off(uint8_t backlight_pin); - #ifdef BACKLIGHT_BREATHING +# ifdef BACKLIGHT_BREATHING void breathing_task(void); void breathing_enable(void); void breathing_pulse(void); @@ -270,13 +269,13 @@ void breathing_period_default(void); void breathing_period_set(uint8_t value); void breathing_period_inc(void); void breathing_period_dec(void); - #endif +# endif #endif -void send_dword(uint32_t number); -void send_word(uint16_t number); -void send_byte(uint8_t number); -void send_nibble(uint8_t number); +void send_dword(uint32_t number); +void send_word(uint16_t number); +void send_byte(uint8_t number); +void send_nibble(uint8_t number); uint16_t hex_to_keycode(uint8_t hex); void led_set_user(uint8_t usb_led); -- cgit v1.2.3 From dab4967f1bebc9a70374ed3e1fe7906828b280c2 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 3 Sep 2019 08:34:31 -0700 Subject: Add Dip Switch as a core feature (#6140) * Add Dip Switches as a core feature * Add documentation for Dip Switch feature * Update Preonic Rev3 to use new feature and remove custom matrix * Apply suggestions from code review Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Remove custom matrix line completely Rather than just disabling it Co-Authored-By: fauxpark * DIP changes Co-Authored-By: fauxpark * Use better check for DIP Switch configuration * Add to show features * Add bitmask callback for dip switch * Fix OLKB Boards dip switch config * Update docs to include bitmask example * Fix comments/documentation Co-Authored-By: fauxpark * Fix issues with docs and use example from @tuzonghua * Fix wording Co-Authored-By: fauxpark * Fix example to use proper formatting Bad, BAAAAAAD drashna!!! * Handle dip switch initialization better --- quantum/quantum.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 066113590e..f5ac97379d 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -145,6 +145,11 @@ extern layer_state_t layer_state; # include "oled_driver.h" #endif +#ifdef DIP_SWITCH_ENABLE + #include "dip_switch.h" +#endif + + // Function substitutions to ease GPIO manipulation #if defined(__AVR__) typedef uint8_t pin_t; -- cgit v1.2.3 From 4531cc874e1bb8602fede9dc038b692673521590 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 2 Nov 2019 21:20:03 +0000 Subject: Initial migration of software PWM backlight (#6709) * Initial migration of software PWM backlight * First pass at backlight driver docs * Correct driver name in docs * Run backlight_task when using BACKLIGHT_PINS * Resolve backlight docs TODOs --- quantum/quantum.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index f5ac97379d..01abe1c0a1 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -257,8 +257,8 @@ void tap_code16(uint16_t code); void backlight_init_ports(void); void backlight_task(void); void backlight_task_internal(void); -void backlight_on(uint8_t backlight_pin); -void backlight_off(uint8_t backlight_pin); +void backlight_on(pin_t backlight_pin); +void backlight_off(pin_t backlight_pin); # ifdef BACKLIGHT_BREATHING void breathing_task(void); -- cgit v1.2.3 From 542cb0a8ce3f324c6bd46751d733daf86384a8f6 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 4 Nov 2019 22:59:13 -0800 Subject: [Core] Convert Dynamic Macro to a Core Feature (#5948) * Convert Dynamic Macro to a Core Feature This imports the code from Dynamic Macro into the core code, and handles it, as such. This deprecates the old method but does not remove it, for legacy support. This way, no existing user files need to be touched. Additionally, this reorganizes the documentation to better reflect the changes. Also, it adds user hooks to the feature so users can customize the existing functionality. Based heavily on and closes #2976 * Apply suggestions from code review Co-Authored-By: fauxpark Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Cleanup based on feedback * Add short-form keycodes and document them - add short-form keycodes to quantum/quantum_keycodes.h - document the new aliases in docs/feature_dynamic_macros.md * Add Dynamic Macros section and keycodes to docs/keycodes.md * Make anti-nesting optional * Add documentation for DYNAMIC_MACRO_NO_NESTING option * Fix Merge artifacts * Fix formatting typo in docs Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Remove DYNAMIC_MACRO_RANGE as it's not needed * Fix includes and layer var type --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 01abe1c0a1..87343a15df 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -149,6 +149,10 @@ extern layer_state_t layer_state; #include "dip_switch.h" #endif +#ifdef DYNAMIC_MACRO_ENABLE + #include "process_dynamic_macro.h" +#endif + // Function substitutions to ease GPIO manipulation #if defined(__AVR__) -- cgit v1.2.3 From dfb78d2a086daa2ceb3fd043afce03785abfa23a Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 6 Nov 2019 11:42:16 +1100 Subject: New and improved lock LED callbacks (#7215) * New and improved lock LED callbacks * Include stdbool * Update documentation * Use full function signatures and add keyboard-level example --- quantum/quantum.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 87343a15df..7988c58788 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -289,5 +289,7 @@ uint16_t hex_to_keycode(uint8_t hex); void led_set_user(uint8_t usb_led); void led_set_kb(uint8_t usb_led); +bool led_update_user(led_t led_state); +bool led_update_kb(led_t led_state); void api_send_unicode(uint32_t unicode); -- cgit v1.2.3 From a91c0c476507cb8c12840abb59bff34ab0de3c03 Mon Sep 17 00:00:00 2001 From: zvecr Date: Sun, 17 Nov 2019 14:02:26 +0000 Subject: Run clang-format manually to fix recently changed files --- quantum/quantum.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 7988c58788..6beab65a32 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -146,14 +146,13 @@ extern layer_state_t layer_state; #endif #ifdef DIP_SWITCH_ENABLE - #include "dip_switch.h" +# include "dip_switch.h" #endif #ifdef DYNAMIC_MACRO_ENABLE - #include "process_dynamic_macro.h" +# include "process_dynamic_macro.h" #endif - // Function substitutions to ease GPIO manipulation #if defined(__AVR__) typedef uint8_t pin_t; -- cgit v1.2.3 From 5a6737a778cfa828e4fdb5d382a84a41e5210d8e Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 26 Nov 2019 18:16:58 +1100 Subject: Send string keycode tweaks (#7471) --- quantum/quantum.h | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 6beab65a32..91b9170b16 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -182,30 +182,8 @@ typedef ioline_t pin_t; # define readPin(pin) palReadLine(pin) #endif -// Send string macros -#define STRINGIZE(z) #z -#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) - -// `string` arguments must not be parenthesized -#define SS_LCTRL(string) SS_DOWN(X_LCTRL) string SS_UP(X_LCTRL) -#define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI) -#define SS_LCMD(string) SS_LGUI(string) -#define SS_LWIN(string) SS_LGUI(string) -#define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT) -#define SS_LSFT(string) SS_DOWN(X_LSHIFT) string SS_UP(X_LSHIFT) -#define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT) -#define SS_ALGR(string) SS_RALT(string) - #define SEND_STRING(string) send_string_P(PSTR(string)) +#define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) extern const bool ascii_to_shift_lut[128]; extern const bool ascii_to_altgr_lut[128]; -- cgit v1.2.3 From d598f01cb7b9d4d9e8fc7bbc951b70be7726a468 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 3 Dec 2019 19:48:55 +0000 Subject: Relocate magic keycode processing (#7512) * Move magic keycode processing to own file * Save some bytes * Update comments * Update define to one thats not already used... * Fix audio --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 91b9170b16..2ee261e60d 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -133,6 +133,10 @@ extern layer_state_t layer_state; # include "process_space_cadet.h" #endif +#ifdef MAGIC_KEYCODE_ENABLE +# include "process_magic.h" +#endif + #ifdef HD44780_ENABLE # include "hd44780.h" #endif -- cgit v1.2.3 From ae40fc498b185d3d23908780a3d3425eb5ff05b5 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 16 Dec 2019 20:27:53 +0000 Subject: Relocate RGB keycode processing (#7508) * Move rgb keycode logic to process_keycode * Fixes for rgb matrix * Fixes for mxss * Fix inc/dec logic, add comments * Fix return RAINBOW_SWIRL logic * stop external use of rgb helper functions * merge fix * Fix 'defined but not used' when all animations are disabled --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 2ee261e60d..b9e7eea24b 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -137,6 +137,10 @@ extern layer_state_t layer_state; # include "process_magic.h" #endif +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +# include "process_rgb.h" +#endif + #ifdef HD44780_ENABLE # include "hd44780.h" #endif -- cgit v1.2.3 From 376419a4f7e0489111a9ac24acc847342fe9d64d Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 21 Dec 2019 18:22:49 +0000 Subject: Add central location for ChibiOS defines (#7542) * Add central location for chibios defines * Add central location for chibios defines - actually add files this time.... * Add Copyright header * Update include order to resolve i2cv1 build errors --- quantum/quantum.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index b9e7eea24b..053b33b917 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -22,6 +22,7 @@ #endif #if defined(PROTOCOL_CHIBIOS) # include "hal.h" +# include "chibios_config.h" #endif #include "wait.h" -- cgit v1.2.3 From 320822d75b785401809f45007320e6fb6885b3fd Mon Sep 17 00:00:00 2001 From: Wilba Date: Sat, 4 Jan 2020 07:52:00 +1100 Subject: VIA Configurator Refactor (#7268) * VIA Refactor * Remove old code * review changes * review changes * Fix cannonkeys/satisfaction75/prototype:via build * Add via.h to quantum.h * Move backlight init to after backlight config load * Merge branch 'master' into via_refactor_pr * Update user's rules.mk to new way of enabling VIA * Added id_switch_matrix_state * Review changes --- quantum/quantum.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 053b33b917..9758374f64 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -162,6 +162,14 @@ extern layer_state_t layer_state; # include "process_dynamic_macro.h" #endif +#ifdef DYNAMIC_KEYMAP_ENABLE +# include "dynamic_keymap.h" +#endif + +#ifdef VIA_ENABLE +# include "via.h" +#endif + // Function substitutions to ease GPIO manipulation #if defined(__AVR__) typedef uint8_t pin_t; -- cgit v1.2.3 From b89e35bdd33b3953711de8b0be64c76b64e9701b Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 13 Jan 2020 01:30:56 +0000 Subject: Relocate common backlight functionally (#7273) --- quantum/quantum.h | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 9758374f64..09550fec30 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -251,30 +251,6 @@ void register_code16(uint16_t code); void unregister_code16(uint16_t code); void tap_code16(uint16_t code); -#ifdef BACKLIGHT_ENABLE -void backlight_init_ports(void); -void backlight_task(void); -void backlight_task_internal(void); -void backlight_on(pin_t backlight_pin); -void backlight_off(pin_t backlight_pin); - -# ifdef BACKLIGHT_BREATHING -void breathing_task(void); -void breathing_enable(void); -void breathing_pulse(void); -void breathing_disable(void); -void breathing_self_disable(void); -void breathing_toggle(void); -bool is_breathing(void); - -void breathing_intensity_default(void); -void breathing_period_default(void); -void breathing_period_set(uint8_t value); -void breathing_period_inc(void); -void breathing_period_dec(void); -# endif -#endif - void send_dword(uint32_t number); void send_word(uint16_t number); void send_byte(uint8_t number); -- cgit v1.2.3 From 667045b4928badaedb38f535d885a46ff8a454fb Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 19 Jan 2020 16:30:34 +0000 Subject: Run clang-format manually to fix recently changed files (#7934) * Run clang-format manually to fix recently changed files * Run clang-format manually to fix recently changed files - revert template files * Run clang-format manually to fix recently changed files - format off for ascii_to_keycode_lut --- quantum/quantum.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 09550fec30..48887026d2 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -163,11 +163,11 @@ extern layer_state_t layer_state; #endif #ifdef DYNAMIC_KEYMAP_ENABLE -# include "dynamic_keymap.h" +# include "dynamic_keymap.h" #endif #ifdef VIA_ENABLE -# include "via.h" +# include "via.h" #endif // Function substitutions to ease GPIO manipulation -- cgit v1.2.3 From 05d6e6ca78087969d7a47862341d10b6b555c37e Mon Sep 17 00:00:00 2001 From: Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com> Date: Mon, 27 Jan 2020 05:04:39 +0100 Subject: Ensure setPinInput actually sets input high-Z (#6237) * Ensure setPinInput actually sets input high-z * Fixed _PIN_ADDRESS Macro arguments as recommended by vomindoraan * Fixed instances of setInput to use new behavour * Changed kmac matrix to use input with pullups * Update keyboards/gh60/revc/revc.h Co-Authored-By: fauxpark * Fixed input state for unselect_rows * fixed merge conflict * Updated all instances of older uses of setPinInput() * Fixed naming mistake Co-authored-by: fauxpark --- quantum/quantum.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 48887026d2..3b9eeaa6de 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -174,7 +174,7 @@ extern layer_state_t layer_state; #if defined(__AVR__) typedef uint8_t pin_t; -# define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF)) +# define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) # define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) # define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") # define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) @@ -184,6 +184,7 @@ typedef uint8_t pin_t; # define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) # define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) + #elif defined(PROTOCOL_CHIBIOS) typedef ioline_t pin_t; -- cgit v1.2.3 From 393937b43fe37a9faceb3a40e5f6fcc604659fb0 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 5 Feb 2020 02:49:10 +0000 Subject: Relocate grave keycode processing (#8082) * Relocate grave keycode processing * Tidy up code * Refactor grave -> grave_esc --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 3b9eeaa6de..fbd5e90792 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -138,6 +138,10 @@ extern layer_state_t layer_state; # include "process_magic.h" #endif +#ifdef GRAVE_ESC_ENABLE +# include "process_grave_esc.h" +#endif + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) # include "process_rgb.h" #endif -- cgit v1.2.3 From 26eef35f07698d23aafae90e1c230b52e100a334 Mon Sep 17 00:00:00 2001 From: James Young Date: Sat, 29 Feb 2020 12:00:00 -0800 Subject: 2020 February 29 Breaking Changes Update (#8064) --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index fbd5e90792..7dc14e6280 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -88,6 +88,10 @@ extern layer_state_t layer_state; # include "process_music.h" #endif +#ifdef BACKLIGHT_ENABLE +# include "process_backlight.h" +#endif + #ifdef LEADER_ENABLE # include "process_leader.h" #endif -- cgit v1.2.3 From 552f8d81b9bff8010b328ee944d50830cfcaea5c Mon Sep 17 00:00:00 2001 From: Ted M Lin Date: Mon, 2 Mar 2020 18:43:18 -0500 Subject: Reduce PROGMEM usage for sendstring LUT (#8109) * Reduce PROGMEM usage for keycode map Bit-pack the keycode bool array to gain back a small amount of flash space. The trade-off is an increase in runtime instructions when running macros. It does make the code a bit harder to read, as well as maintain. For configs that use send_string() et al, it saves ~100 bytes. * Switch to macro and common definition Rewrite the array declarations so both the unpacked (original) and packed LUT arrays can use the same value definitions. This is done by defining a macro that "knows what to do". This makes the code much easier to read and maintain. * Fix macro typos and improve perf Pack the bits in a more efficient order for extraction. And also fix the copy/paste error in the macro... * Switch fully to packed LUT Some minor reformatting. Compile tested all sendstring_xyz.h to make sure they were converted properly. Also checked that an unconverted version would generate a compile error. * Apply whitespace suggestions from code review Co-Authored-By: Ryan Co-authored-by: Ryan --- quantum/quantum.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 7dc14e6280..d03ba5942a 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -211,9 +211,21 @@ typedef ioline_t pin_t; #define SEND_STRING(string) send_string_P(PSTR(string)) #define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) -extern const bool ascii_to_shift_lut[128]; -extern const bool ascii_to_altgr_lut[128]; +// Look-Up Tables (LUTs) to convert ASCII character to keycode sequence. extern const uint8_t ascii_to_keycode_lut[128]; +extern const uint8_t ascii_to_shift_lut[16]; +extern const uint8_t ascii_to_altgr_lut[16]; +// clang-format off +#define KCLUT_ENTRY(a, b, c, d, e, f, g, h) \ + ( ((a) ? 1 : 0) << 0 \ + | ((b) ? 1 : 0) << 1 \ + | ((c) ? 1 : 0) << 2 \ + | ((d) ? 1 : 0) << 3 \ + | ((e) ? 1 : 0) << 4 \ + | ((f) ? 1 : 0) << 5 \ + | ((g) ? 1 : 0) << 6 \ + | ((h) ? 1 : 0) << 7 ) +// clang-format on void send_string(const char *str); void send_string_with_delay(const char *str, uint8_t interval); -- cgit v1.2.3 From bfb2f8e0a8f809374fdec102eb02c3bce46a14ee Mon Sep 17 00:00:00 2001 From: brickbots Date: Sun, 22 Mar 2020 06:06:16 -0700 Subject: Add Word Per Minute calculation feature (#8054) * Add Word Per Minute calculation feature * Fix copyright info * Remove header from quantum.c, setup overloadable keycode inclusion for WPM, update docs * Simplify logic for keycode filtering * Adding link from summary to wpm_feature info * Update docs/feature_wpm.md Typo in function prototype example in docs Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Add WPM transport via i2c Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index d03ba5942a..191407fabb 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -178,6 +178,10 @@ extern layer_state_t layer_state; # include "via.h" #endif +#ifdef WPM_ENABLE +# include "wpm.h" +#endif + // Function substitutions to ease GPIO manipulation #if defined(__AVR__) typedef uint8_t pin_t; -- cgit v1.2.3 From 5117dff6a26aec4eca04fb9787b4f428884739bc Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 22 Mar 2020 06:29:05 -0700 Subject: Add Post Processing to process_record (#4892) * Improve process_record system Code based on @colinta's * Rename and better handle functions * Fix incorrect function call to process_record_user * Add documentation for post_process_record * Add both get_event_keycode and get_record_keycode functions And add some comments about these functions * Update code format * Cleanup merge artifacts --- quantum/quantum.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 191407fabb..4b94ebcc05 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -257,6 +257,8 @@ 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); +void post_process_record_kb(uint16_t keycode, keyrecord_t *record); +void post_process_record_user(uint16_t keycode, keyrecord_t *record); #ifndef BOOTMAGIC_LITE_COLUMN # define BOOTMAGIC_LITE_COLUMN 0 -- cgit v1.2.3 From 23124b9fd1d667b3457410b771153361e22ae133 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 12 Apr 2020 08:27:17 -0700 Subject: Fix bug with layer caching in get_event_keycode (#8693) * Fix bug with layer caching in get_event_keycode * Improve naming --- quantum/quantum.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 4b94ebcc05..45f44f49a1 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -252,8 +252,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); +uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache); +uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache); 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); -- cgit v1.2.3 From d26a14c1699e72ca3e0ae3d4e9871b620a833080 Mon Sep 17 00:00:00 2001 From: JohSchneider Date: Wed, 29 Apr 2020 11:04:29 +0000 Subject: add 'togglePin' convenience function (#8734) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add 'togglePin' conveniance function for AVR and chibios * drop outmost parantheses Co-Authored-By: Konstantin Đorđević * toggle pin on avrs toggle a pin configured as output by writing the corresponding bit to the PIN register Co-Authored-By: Takeshi ISHII <2170248+mtei@users.noreply.github.com> * togglepin: add documentation for newly added function * Update docs/internals_gpio_control.md Co-Authored-By: Konstantin Đorđević * on AVR: use PORTD to toggle the output ... since not all MCUs support toggling through writing to PIN Co-Authored-By: Ryan Co-authored-by: Johannes Co-authored-by: Konstantin Đorđević Co-authored-by: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Co-authored-by: Ryan --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 45f44f49a1..72b0a1021f 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -197,6 +197,8 @@ typedef uint8_t pin_t; # define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) +# define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) + #elif defined(PROTOCOL_CHIBIOS) typedef ioline_t pin_t; @@ -210,6 +212,8 @@ typedef ioline_t pin_t; # define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) # define readPin(pin) palReadLine(pin) + +# define togglePin(pin) palToggleLine(pin) #endif #define SEND_STRING(string) send_string_P(PSTR(string)) -- cgit v1.2.3 From 231464c49c2b429293435570243357dcf7e53ecc Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Wed, 29 Apr 2020 11:38:51 +0000 Subject: format code according to conventions [skip ci] --- quantum/quantum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 72b0a1021f..17d1d41cc9 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -197,7 +197,7 @@ typedef uint8_t pin_t; # define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) -# define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) +# define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) #elif defined(PROTOCOL_CHIBIOS) typedef ioline_t pin_t; -- cgit v1.2.3 From 61b64bb82a93c6d1441f07655a5e20b59a15fd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Thu, 16 Jul 2020 14:27:55 +0200 Subject: Redefine IS_LAYER_ON/OFF() as aliases for existing layer functions (#6352) * Add IS_LAYER_ON_STATE()/IS_LAYER_OFF_STATE() macros * Add docs for IS_LAYER_ON/OFF(_STATE) macros * Remove IS_LAYER_ON/OFF_STATE redefinition in userspace * Run clang-format on quantum/quantum.h * Redefine IS_LAYER_ON/OFF(_STATE) as aliases of existing layer functions Also update relevant doc entries. Needs testing to check if this breaks existing IS_LAYER_ON/OFF usage in certain edge cases (namely calling the macros with 0). * Reformat layer check function docs --- quantum/quantum.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 17d1d41cc9..51deac0cd5 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -249,8 +249,11 @@ void set_single_persistent_default_layer(uint8_t default_layer); void tap_random_base64(void); -#define IS_LAYER_ON(layer) (layer_state & (1UL << (layer))) -#define IS_LAYER_OFF(layer) (~layer_state & (1UL << (layer))) +#define IS_LAYER_ON(layer) layer_state_is(layer) +#define IS_LAYER_OFF(layer) !layer_state_is(layer) + +#define IS_LAYER_ON_STATE(state, layer) layer_state_cmp(state, layer) +#define IS_LAYER_OFF_STATE(state, layer) !layer_state_cmp(state, layer) void matrix_init_kb(void); void matrix_scan_kb(void); -- cgit v1.2.3 From d4be07dad368c57669c88ead6c093c9e23086855 Mon Sep 17 00:00:00 2001 From: a-chol Date: Sat, 25 Jul 2020 14:01:15 +0200 Subject: Hid joystick interface (#4226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add support for hid gamepad interface add documentation for HID joystick Add joystick_task to read analog axes values even when no key is pressed or release. update doc Update docs/feature_joystick.md Manage pin setup and read to maintain matrix scan after analog read * Incorporates patches and changes to HID reporting There are some patches provided by @a-chol incorporated on this commit, and also some changes I made to the HID Report structure. The most interesting is the one dealing with number of buttons: Linux doesn't seem to care, but Windows requires the HID structure to be byte aligned (that's in the spec). So if one declares 8/16/32... buttons they should not have any issues, but this is what happens when you have 9 buttons: ``` bits |0|1|2|3|4|5|6|7| |*|*|*|*|*|*|*|*| axis 0 (report size 8) |*|*|*|*|*|*|*|*| ... |*|*|*|*|*|*|*|*| |*|*|*|*|*|*|*|*| |*|*|*|*|*|*|*|*| |*|*|*|*|*|*|*|*| |*|*|*|*|*|*|*|*| axis 6 |*|*|*|*|*|*|*|*| first 8 buttons (report size 1) |*| | | | | | | | last of 9 buttons, not aligned ``` So for that I added a conditonal that will add a number of reports with size 1 to make sure it aligns to the next multiple of 8. Those reports send dummy inputs that don't do anything aside from aligning the data. Tested on Linux, Windows 10 and Street Fighter (where the joystick is recognized as direct-input) * Add save and restore of each pin used in reading joystick (AVR). Allow output pin to be JS_VIRTUAL_AXIS if the axis is connected to Vcc instead of an output pin from the MCU. Fix joystick report id Fix broken v-usb hid joystick interface. Make it more resilient to unusual settings (none multiple of eight button count, 0 buttons or 0 axes) Correct adc reading for multiple axes. Piecewise range conversion for uncentered raw value range. Input, output and ground pin configuration per axis. Documentation fixes * Fix port addressing for joystick analog read * The other required set of changes As per the PR, the changes still holding it up. Add onekey for testing. Fix ARM builds. Fix device descriptor when either axes or buttons is zero. Add compile-time check for at least one axis or button. Move definition to try to fix conflict. PR review comments. qmk cformat * avoid float functions to compute range mapping for axis adc reading * Remove V-USB support for now. Updated docs accordingly. * Update tmk_core/protocol/lufa/lufa.c Co-Authored-By: Ryan * Update tmk_core/protocol/usb_descriptor.c Co-Authored-By: Ryan * Update tmk_core/protocol/usb_descriptor.c Co-Authored-By: Ryan * Update tmk_core/protocol/usb_descriptor.c Co-Authored-By: Ryan * Add support for joystick adc reading for stm32 MCUs. Fix joystick hid report sending for chibios * Fix HID joystick report sending for ChibiOS. Add one analog axis to the onekey:joystick keymap. Fix pin state save and restore during joystick analog read for STM32 MCUs. * Update tmk_core/protocol/chibios/usb_main.c Co-Authored-By: Ryan * Update tmk_core/protocol/lufa/lufa.c Co-Authored-By: Ryan * Add missing mcuconf.h and halconf.h to onekey:joystick keymap. Add suggested fixes from PR. * Switch saveState and restoreState signature to use pin_t type. onekey:joystick : add a second axis, virtual and programmatically animated. * Update docs/feature_joystick.md Co-Authored-By: Ryan * Update docs/feature_joystick.md Co-Authored-By: Ryan * Add PR corrections * Remove halconf.h and mcuconf.h from onekey keymaps * Change ADC_PIN to A0 Co-authored-by: achol Co-authored-by: José Júnior Co-authored-by: a-chol Co-authored-by: Nick Brassel Co-authored-by: Ryan --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 51deac0cd5..a2c0ec9a28 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -142,6 +142,10 @@ extern layer_state_t layer_state; # include "process_magic.h" #endif +#ifdef JOYSTICK_ENABLE +# include "process_joystick.h" +#endif + #ifdef GRAVE_ESC_ENABLE # include "process_grave_esc.h" #endif -- cgit v1.2.3 From 3afe0ea9b9f67ae33f54c1393b15d988764241a2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 26 Nov 2020 23:44:17 +1100 Subject: ST7565 tidyup (#10907) --- quantum/quantum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index a2c0ec9a28..0e452a062d 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -213,7 +213,7 @@ typedef ioline_t pin_t; # define writePinHigh(pin) palSetLine(pin) # define writePinLow(pin) palClearLine(pin) -# define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) +# define writePin(pin, level) ((level) ? (writePinHigh(pin)) : (writePinLow(pin))) # define readPin(pin) palReadLine(pin) -- cgit v1.2.3 From c66df1664497546f32662409778731143e45a552 Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 28 Nov 2020 12:02:18 -0800 Subject: 2020 November 28 Breaking Changes Update (#11053) * Branch point for 2020 November 28 Breaking Change * Remove matrix_col_t to allow MATRIX_ROWS > 32 (#10183) * Add support for soft serial to ATmega32U2 (#10204) * Change MIDI velocity implementation to allow direct control of velocity value (#9940) * Add ability to build a subset of all keyboards based on platform. * Actually use eeprom_driver_init(). * Make bootloader_jump weak for ChibiOS. (#10417) * Joystick 16-bit support (#10439) * Per-encoder resolutions (#10259) * Share button state from mousekey to pointing_device (#10179) * Add hotfix for chibios keyboards not wake (#10088) * Add advanced/efficient RGB Matrix Indicators (#8564) * Naming change. * Support for STM32 GPIOF,G,H,I,J,K (#10206) * Add milc as a dependency and remove the installed milc (#10563) * ChibiOS upgrade: early init conversions (#10214) * ChibiOS upgrade: configuration file migrator (#9952) * Haptic and solenoid cleanup (#9700) * XD75 cleanup (#10524) * OLED display update interval support (#10388) * Add definition based on currently-selected serial driver. (#10716) * New feature: Retro Tapping per key (#10622) * Allow for modification of output RGB values when using rgblight/rgb_matrix. (#10638) * Add housekeeping task callbacks so that keyboards/keymaps are capable of executing code for each main loop iteration. (#10530) * Rescale both ChibiOS and AVR backlighting. * Reduce Helix keyboard build variation (#8669) * Minor change to behavior allowing display updates to continue between task ticks (#10750) * Some GPIO manipulations in matrix.c change to atomic. (#10491) * qmk cformat (#10767) * [Keyboard] Update the Speedo firmware for v3.0 (#10657) * Maartenwut/Maarten namechange to evyd13/Evy (#10274) * [quantum] combine repeated lines of code (#10837) * Add step sequencer feature (#9703) * aeboards/ext65 refactor (#10820) * Refactor xelus/dawn60 for Rev2 later (#10584) * add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk (#10824) * [Core] Added `add_oneshot_mods` & `del_oneshot_mods` (#10549) * update chibios os usb for the otg driver (#8893) * Remove HD44780 References, Part 4 (#10735) * [Keyboard] Add Valor FRL TKL (+refactor) (#10512) * Fix cursor position bug in oled_write_raw functions (#10800) * Fixup version.h writing when using SKIP_VERSION=yes (#10972) * Allow for certain code in the codebase assuming length of string. (#10974) * Add AT90USB support for serial.c (#10706) * Auto shift: support repeats and early registration (#9826) * Rename ledmatrix.h to match .c file (#7949) * Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER (#10231) * Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840) * Merge point for 2020 Nov 28 Breaking Change --- quantum/quantum.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 0e452a062d..cb0af306ac 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -31,7 +31,7 @@ #ifdef BACKLIGHT_ENABLE # ifdef LED_MATRIX_ENABLE -# include "ledmatrix.h" +# include "led_matrix.h" # else # include "backlight.h" # endif @@ -68,6 +68,11 @@ extern layer_state_t default_layer_state; extern layer_state_t layer_state; #endif +#if defined(SEQUENCER_ENABLE) +# include "sequencer.h" +# include "process_sequencer.h" +#endif + #if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) # include "process_midi.h" #endif @@ -220,6 +225,61 @@ typedef ioline_t pin_t; # define togglePin(pin) palToggleLine(pin) #endif +// Atomic macro to help make GPIO and other controls atomic. +#ifdef IGNORE_ATOMIC_BLOCK +/* do nothing atomic macro */ +# define ATOMIC_BLOCK for (uint8_t __ToDo = 1; __ToDo; __ToDo = 0) +# define ATOMIC_BLOCK_RESTORESTATE ATOMIC_BLOCK +# define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK + +#elif defined(__AVR__) +/* atomic macro for AVR */ +# include + +# define ATOMIC_BLOCK_RESTORESTATE ATOMIC_BLOCK(ATOMIC_RESTORESTATE) +# define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK(ATOMIC_FORCEON) + +#elif defined(PROTOCOL_CHIBIOS) || defined(PROTOCOL_ARM_ATSAM) +/* atomic macro for ChibiOS / ARM ATSAM */ +# if defined(PROTOCOL_ARM_ATSAM) +# include "arm_atsam_protocol.h" +# endif + +static __inline__ uint8_t __interrupt_disable__(void) { +# if defined(PROTOCOL_CHIBIOS) + chSysLock(); +# endif +# if defined(PROTOCOL_ARM_ATSAM) + __disable_irq(); +# endif + return 1; +} + +static __inline__ void __interrupt_enable__(const uint8_t *__s) { +# if defined(PROTOCOL_CHIBIOS) + chSysUnlock(); +# endif +# if defined(PROTOCOL_ARM_ATSAM) + __enable_irq(); +# endif + __asm__ volatile("" ::: "memory"); + (void)__s; +} + +# define ATOMIC_BLOCK(type) for (type, __ToDo = __interrupt_disable__(); __ToDo; __ToDo = 0) +# define ATOMIC_FORCEON uint8_t sreg_save __attribute__((__cleanup__(__interrupt_enable__))) = 0 + +# define ATOMIC_BLOCK_RESTORESTATE _Static_assert(0, "ATOMIC_BLOCK_RESTORESTATE dose not implement") +# define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK(ATOMIC_FORCEON) + +/* Other platform */ +#else + +# define ATOMIC_BLOCK_RESTORESTATE _Static_assert(0, "ATOMIC_BLOCK_RESTORESTATE dose not implement") +# define ATOMIC_BLOCK_FORCEON _Static_assert(0, "ATOMIC_BLOCK_FORCEON dose not implement") + +#endif + #define SEND_STRING(string) send_string_P(PSTR(string)) #define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) -- cgit v1.2.3 From a8d0ec0749046b0ab89c18b1b7083b1e8674de2a Mon Sep 17 00:00:00 2001 From: XScorpion2 Date: Tue, 1 Dec 2020 12:04:42 -0600 Subject: [Split] Sync Timer feature (#10997) A timer that is kept in sync between the halves of a split keyboard --- quantum/quantum.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index cb0af306ac..59c3dd4904 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -53,6 +53,7 @@ #include "eeconfig.h" #include "bootloader.h" #include "timer.h" +#include "sync_timer.h" #include "config_common.h" #include "led.h" #include "action_util.h" -- cgit v1.2.3 From 501f2fdef115314713e94428d409e5c3b5bfc1c2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 11 Dec 2020 13:45:24 +1100 Subject: Normalise include statements in core code (#11153) * Normalise include statements in core code * Missed one --- quantum/quantum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index cb0af306ac..3e09df4f88 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -21,7 +21,7 @@ # include #endif #if defined(PROTOCOL_CHIBIOS) -# include "hal.h" +# include # include "chibios_config.h" #endif -- cgit v1.2.3 From e190872b822f247794213120e0f7a276c07c95b9 Mon Sep 17 00:00:00 2001 From: Joshua Diamond Date: Fri, 1 Jan 2021 23:54:48 -0500 Subject: Improved Language Specific Keycodes for US International and Extended Layouts (#11307) Co-authored-by: Ryan --- quantum/quantum.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 9b2b9dee6b..7e209304b7 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -288,6 +288,7 @@ static __inline__ void __interrupt_enable__(const uint8_t *__s) { extern const uint8_t ascii_to_keycode_lut[128]; extern const uint8_t ascii_to_shift_lut[16]; extern const uint8_t ascii_to_altgr_lut[16]; +extern const uint8_t ascii_to_dead_lut[16]; // clang-format off #define KCLUT_ENTRY(a, b, c, d, e, f, g, h) \ ( ((a) ? 1 : 0) << 0 \ -- cgit v1.2.3 From 810eafad121bda333c53490e2d8a29f3a83d9c19 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 4 Jan 2021 16:37:20 -0800 Subject: Fix Tap-Hold Configs (#11127) * Add proper prototypes for Tap-Hold Per Key functions * Fix handwired/tennie default keymap * Remove unneeded references * Fix tapping term per key check in space cadet * Pre-emptive fix for tap dance * Fix marksard/leftover30 * Replace hard coded tapping term with define --- quantum/quantum.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 3e09df4f88..f4df5bf155 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -56,6 +56,7 @@ #include "config_common.h" #include "led.h" #include "action_util.h" +#include "action_tapping.h" #include "print.h" #include "send_string_keycodes.h" #include "suspend.h" -- cgit v1.2.3 From 302b35c2a0ac90208e523944e8cc4b44a793d8d5 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Wed, 13 Jan 2021 10:46:22 +0900 Subject: fix matrix_io_delay() timing in quantum/matrix.c (#9603) * fix matrix_io_delay() timing in quantum/matrix.c * Updated comments explaining the need for matrix_io_delay() in quantum/matrix.c * fix matrix_io_delay() timing in quantum/split_common/matrix.c * Update quantum/matrix.c Co-authored-by: Ryan * Update quantum/split_common/matrix.c Co-authored-by: Ryan * Update quantum/matrix.c Co-authored-by: Ryan * Update quantum/split_common/matrix.c Co-authored-by: Ryan * add waitOutputPinValid() and wait_cpuclock() into quantum/quantum.h and tmk_core/common/wait.h * add matrix_output_select_delay() and matrix_output_unselect_delay() * fix quantum/matrix_common.c, tmk_core/common/matrix.h * fix tmk_core/common/wait.h * fix quantum/quantum.h, tmk_core/common/wait.h * waitOutputPinValid() rename to waitInputPinDelay() in quantum/quantum.h. * waitOutputPinValid() rename to waitInputPinDelay() in quantum/matrix_common.c * update tmk_core/common/wait.h * update comment in quantum/matrix.c, quantum/split_common/matrix.c * update quantum/quantum.h: Make more margin in the GPIO_INPUT_PIN_DELAY default value. Co-authored-by: Ryan --- quantum/quantum.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 83694c8324..d234e6ea0d 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -210,6 +210,13 @@ typedef uint8_t pin_t; # define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) +/* The AVR series GPIOs have a one clock read delay for changes in the digital input signal. + * But here's more margin to make it two clocks. */ +# if !defined(GPIO_INPUT_PIN_DELAY) +# define GPIO_INPUT_PIN_DELAY 2 +# endif +# define waitInputPinDelay() wait_cpuclock(GPIO_INPUT_PIN_DELAY) + #elif defined(PROTOCOL_CHIBIOS) typedef ioline_t pin_t; @@ -225,6 +232,28 @@ typedef ioline_t pin_t; # define readPin(pin) palReadLine(pin) # define togglePin(pin) palToggleLine(pin) + +#endif + +#if defined(__ARMEL__) || defined(__ARMEB__) +/* For GPIOs on ARM-based MCUs, the input pins are sampled by the clock of the bus + * to which the GPIO is connected. + * The connected buses differ depending on the various series of MCUs. + * And since the instruction execution clock of the CPU and the bus clock of GPIO are different, + * there is a delay of several clocks to read the change of the input signal. + * + * Define this delay with the GPIO_INPUT_PIN_DELAY macro. + * If the GPIO_INPUT_PIN_DELAY macro is not defined, the following default values will be used. + * (A fairly large value of 0.25 microseconds is set.) + */ +# if !defined(GPIO_INPUT_PIN_DELAY) +# if defined(STM32_SYSCLK) +# define GPIO_INPUT_PIN_DELAY (STM32_SYSCLK/1000000L / 4) +# elif defined(KINETIS_SYSCLK_FREQUENCY) +# define GPIO_INPUT_PIN_DELAY (KINETIS_SYSCLK_FREQUENCY/1000000L / 4) +# endif +# endif +# define waitInputPinDelay() wait_cpuclock(GPIO_INPUT_PIN_DELAY) #endif // Atomic macro to help make GPIO and other controls atomic. -- cgit v1.2.3 From 31c57aab35e6fd49c4c8336f449419afe7630e93 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Mon, 18 Jan 2021 05:12:15 +1100 Subject: `qmk cformat` --- quantum/quantum.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index d234e6ea0d..370a65fe04 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -248,9 +248,9 @@ typedef ioline_t pin_t; */ # if !defined(GPIO_INPUT_PIN_DELAY) # if defined(STM32_SYSCLK) -# define GPIO_INPUT_PIN_DELAY (STM32_SYSCLK/1000000L / 4) +# define GPIO_INPUT_PIN_DELAY (STM32_SYSCLK / 1000000L / 4) # elif defined(KINETIS_SYSCLK_FREQUENCY) -# define GPIO_INPUT_PIN_DELAY (KINETIS_SYSCLK_FREQUENCY/1000000L / 4) +# define GPIO_INPUT_PIN_DELAY (KINETIS_SYSCLK_FREQUENCY / 1000000L / 4) # endif # endif # define waitInputPinDelay() wait_cpuclock(GPIO_INPUT_PIN_DELAY) -- cgit v1.2.3 From de8caf708c1a9a80527a04be620ed3969262e50b Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 14 Feb 2021 00:51:06 +0000 Subject: Split gpio and atomic to platform (#11792) --- quantum/quantum.h | 91 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 89 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index f4df5bf155..dd2a6dd53a 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -54,6 +54,8 @@ #include "bootloader.h" #include "timer.h" #include "config_common.h" +#include "gpio.h" +#include "atomic_util.h" #include "led.h" #include "action_util.h" #include "action_tapping.h" @@ -192,95 +194,6 @@ extern layer_state_t layer_state; # include "wpm.h" #endif -// Function substitutions to ease GPIO manipulation -#if defined(__AVR__) -typedef uint8_t pin_t; - -# define setPinInput(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) -# define setPinInputHigh(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) -# define setPinInputLow(pin) _Static_assert(0, "AVR processors cannot implement an input as pull low") -# define setPinOutput(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) - -# define writePinHigh(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) -# define writePinLow(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) -# define writePin(pin, level) ((level) ? writePinHigh(pin) : writePinLow(pin)) - -# define readPin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) - -# define togglePin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) - -#elif defined(PROTOCOL_CHIBIOS) -typedef ioline_t pin_t; - -# define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) -# define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) -# define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) -# define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) - -# define writePinHigh(pin) palSetLine(pin) -# define writePinLow(pin) palClearLine(pin) -# define writePin(pin, level) ((level) ? (writePinHigh(pin)) : (writePinLow(pin))) - -# define readPin(pin) palReadLine(pin) - -# define togglePin(pin) palToggleLine(pin) -#endif - -// Atomic macro to help make GPIO and other controls atomic. -#ifdef IGNORE_ATOMIC_BLOCK -/* do nothing atomic macro */ -# define ATOMIC_BLOCK for (uint8_t __ToDo = 1; __ToDo; __ToDo = 0) -# define ATOMIC_BLOCK_RESTORESTATE ATOMIC_BLOCK -# define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK - -#elif defined(__AVR__) -/* atomic macro for AVR */ -# include - -# define ATOMIC_BLOCK_RESTORESTATE ATOMIC_BLOCK(ATOMIC_RESTORESTATE) -# define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK(ATOMIC_FORCEON) - -#elif defined(PROTOCOL_CHIBIOS) || defined(PROTOCOL_ARM_ATSAM) -/* atomic macro for ChibiOS / ARM ATSAM */ -# if defined(PROTOCOL_ARM_ATSAM) -# include "arm_atsam_protocol.h" -# endif - -static __inline__ uint8_t __interrupt_disable__(void) { -# if defined(PROTOCOL_CHIBIOS) - chSysLock(); -# endif -# if defined(PROTOCOL_ARM_ATSAM) - __disable_irq(); -# endif - return 1; -} - -static __inline__ void __interrupt_enable__(const uint8_t *__s) { -# if defined(PROTOCOL_CHIBIOS) - chSysUnlock(); -# endif -# if defined(PROTOCOL_ARM_ATSAM) - __enable_irq(); -# endif - __asm__ volatile("" ::: "memory"); - (void)__s; -} - -# define ATOMIC_BLOCK(type) for (type, __ToDo = __interrupt_disable__(); __ToDo; __ToDo = 0) -# define ATOMIC_FORCEON uint8_t sreg_save __attribute__((__cleanup__(__interrupt_enable__))) = 0 - -# define ATOMIC_BLOCK_RESTORESTATE _Static_assert(0, "ATOMIC_BLOCK_RESTORESTATE dose not implement") -# define ATOMIC_BLOCK_FORCEON ATOMIC_BLOCK(ATOMIC_FORCEON) - -/* Other platform */ -#else - -# define ATOMIC_BLOCK_RESTORESTATE _Static_assert(0, "ATOMIC_BLOCK_RESTORESTATE dose not implement") -# define ATOMIC_BLOCK_FORCEON _Static_assert(0, "ATOMIC_BLOCK_FORCEON dose not implement") - -#endif - #define SEND_STRING(string) send_string_P(PSTR(string)) #define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) -- cgit v1.2.3 From f53e41ac81662a560a299a23c7863dd2f618a1f8 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Mon, 15 Feb 2021 08:56:13 +1100 Subject: Add support for analog USBPD on STM32G4xx. (#11824) * Add support for analog USBPD on STM32G4xx. * Split up to a list of driver types, allow for custom. --- quantum/quantum.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 370a65fe04..b7bf5be312 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -193,6 +193,10 @@ extern layer_state_t layer_state; # include "wpm.h" #endif +#ifdef USBPD_ENABLE +# include "usbpd.h" +#endif + // Function substitutions to ease GPIO manipulation #if defined(__AVR__) typedef uint8_t pin_t; -- cgit v1.2.3 From 1a7f2c8f453d4da6ed8622e52d5b788bc6dad480 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 1 Mar 2021 07:11:39 +1100 Subject: Extract sendstring into its own compilation unit (#12060) * Extract sendstring into its own compilation unit * License headers? * Put this include in the header --- quantum/quantum.h | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index 36a983d575..b1600dd724 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -61,7 +61,7 @@ #include "action_util.h" #include "action_tapping.h" #include "print.h" -#include "send_string_keycodes.h" +#include "send_string.h" #include "suspend.h" #include #include @@ -231,31 +231,6 @@ extern layer_state_t layer_state; # define waitInputPinDelay() wait_cpuclock(GPIO_INPUT_PIN_DELAY) #endif -#define SEND_STRING(string) send_string_P(PSTR(string)) -#define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval) - -// Look-Up Tables (LUTs) to convert ASCII character to keycode sequence. -extern const uint8_t ascii_to_keycode_lut[128]; -extern const uint8_t ascii_to_shift_lut[16]; -extern const uint8_t ascii_to_altgr_lut[16]; -extern const uint8_t ascii_to_dead_lut[16]; -// clang-format off -#define KCLUT_ENTRY(a, b, c, d, e, f, g, h) \ - ( ((a) ? 1 : 0) << 0 \ - | ((b) ? 1 : 0) << 1 \ - | ((c) ? 1 : 0) << 2 \ - | ((d) ? 1 : 0) << 3 \ - | ((e) ? 1 : 0) << 4 \ - | ((f) ? 1 : 0) << 5 \ - | ((g) ? 1 : 0) << 6 \ - | ((h) ? 1 : 0) << 7 ) -// clang-format on - -void send_string(const char *str); -void send_string_with_delay(const char *str, uint8_t interval); -void send_string_P(const char *str); -void send_string_with_delay_P(const char *str, uint8_t interval); -void send_char(char ascii_code); // For tri-layer void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); -- cgit v1.2.3 From 88dce243750d9e80948cd7262566182018d7bbdf Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 12 Mar 2021 18:03:44 +1100 Subject: Remove hex_to_keycode and move tap_random_base64 to send_string.c (#12079) --- quantum/quantum.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'quantum/quantum.h') diff --git a/quantum/quantum.h b/quantum/quantum.h index b1600dd724..e24a4c43a3 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -238,8 +238,6 @@ layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_ void set_single_persistent_default_layer(uint8_t default_layer); -void tap_random_base64(void); - #define IS_LAYER_ON(layer) layer_state_is(layer) #define IS_LAYER_OFF(layer) !layer_state_is(layer) @@ -276,12 +274,6 @@ void register_code16(uint16_t code); void unregister_code16(uint16_t code); void tap_code16(uint16_t code); -void send_dword(uint32_t number); -void send_word(uint16_t number); -void send_byte(uint8_t number); -void send_nibble(uint8_t number); -uint16_t hex_to_keycode(uint8_t hex); - void led_set_user(uint8_t usb_led); void led_set_kb(uint8_t usb_led); bool led_update_user(led_t led_state); -- cgit v1.2.3