From ce604e1629cf9efd2d7751ff60e927ad0a09b35a Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 2 Mar 2020 00:22:21 +1100 Subject: [PATCH 001/106] Remove duplicate BRTG case (#8277) --- quantum/quantum.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 7c19a3bbb6c..a8d3305a654 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -314,11 +314,6 @@ bool process_record_quantum(keyrecord_t *record) { case OUT_BT: set_output(OUTPUT_BLUETOOTH); return false; -#endif -#if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_BREATHING) - case BL_BRTG: - backlight_toggle_breathing(); - return false; #endif } } From 1ec8a7205f1719496e043776edcc972125fc57e3 Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Sun, 1 Mar 2020 13:54:25 +0000 Subject: [PATCH 002/106] format code according to conventions [skip ci] --- quantum/quantum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index a8d3305a654..633492f905a 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -643,7 +643,7 @@ void matrix_scan_quantum() { // void send_dword(uint32_t number) { // this might not actually work - uint16_t word = (number >> 16); + uint16_tword = (number >> 16); send_word(word); send_word(number & 0xFFFFUL); } From 629950e51bb0f3f12d84520426f93449e0e4e9b7 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 1 Mar 2020 17:55:43 +0000 Subject: [PATCH 003/106] Fix recent clang-format breaking quantum.c (#8282) --- quantum/quantum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 633492f905a..37c374ece98 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -642,8 +642,8 @@ void matrix_scan_quantum() { // Functions for spitting out values // -void send_dword(uint32_t number) { // this might not actually work - uint16_tword = (number >> 16); +void send_dword(uint32_t number) { + uint16_t word = (number >> 16); send_word(word); send_word(number & 0xFFFFUL); } From e7fb873ee281d93dbf96f369bd3a0a50e766eda3 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 1 Mar 2020 18:46:40 +0000 Subject: [PATCH 004/106] Short term fix for conflicting types for 'tfp_printf' (#8157) --- tmk_core/common/chibios/printf.c | 14 +++++++++----- tmk_core/common/chibios/printf.h | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tmk_core/common/chibios/printf.c b/tmk_core/common/chibios/printf.c index 3a81acd3126..17c1e634166 100644 --- a/tmk_core/common/chibios/printf.c +++ b/tmk_core/common/chibios/printf.c @@ -96,8 +96,8 @@ static int a2d(char ch) { return -1; } -static char a2i(char ch, char** src, int base, int* nump) { - char* p = *src; +static char a2i(char ch, const char** src, int base, int* nump) { + const char* p = *src; int num = 0; int digit; while ((digit = a2d(ch)) >= 0) { @@ -119,7 +119,7 @@ static void putchw(void* putp, putcf putf, int n, char z, char* bf) { while ((ch = *bf++)) putf(putp, ch); } -void tfp_format(void* putp, putcf putf, char* fmt, va_list va) { +void tfp_format(void* putp, putcf putf, const char* fmt, va_list va) { // This used to handle max of 12, but binary support jumps this to at least 32 char bf[36]; @@ -211,19 +211,23 @@ void init_printf(void* putp, void (*putf)(void*, char)) { stdout_putp = putp; } -void tfp_printf(char* fmt, ...) { +int tfp_printf(const char* fmt, ...) { va_list va; va_start(va, fmt); tfp_format(stdout_putp, stdout_putf, fmt, va); va_end(va); + + return 1; } static void putcp(void* p, char c) { *(*((char**)p))++ = c; } -void tfp_sprintf(char* s, char* fmt, ...) { +int tfp_sprintf(char* s, const char* fmt, ...) { va_list va; va_start(va, fmt); tfp_format(&s, putcp, fmt, va); putcp(&s, 0); va_end(va); + + return 1; } diff --git a/tmk_core/common/chibios/printf.h b/tmk_core/common/chibios/printf.h index 2cdf55ed904..775459e1e8a 100644 --- a/tmk_core/common/chibios/printf.h +++ b/tmk_core/common/chibios/printf.h @@ -99,10 +99,10 @@ regs Kusti, 23.10.2004 void init_printf(void* putp, void (*putf)(void*, char)); -void tfp_printf(char* fmt, ...); -void tfp_sprintf(char* s, char* fmt, ...); +int tfp_printf(const char* fmt, ...); +int tfp_sprintf(char* s, const char* fmt, ...); -void tfp_format(void* putp, void (*putf)(void*, char), char* fmt, va_list va); +void tfp_format(void* putp, void (*putf)(void*, char), const char* fmt, va_list va); #define printf tfp_printf #define sprintf tfp_sprintf From 95124bf9331e67a7373ed4e3fc4d14f23e18a85b Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Sun, 1 Mar 2020 19:20:09 +0000 Subject: [PATCH 005/106] format code according to conventions [skip ci] --- tmk_core/common/chibios/printf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmk_core/common/chibios/printf.c b/tmk_core/common/chibios/printf.c index 17c1e634166..a99752bb3d4 100644 --- a/tmk_core/common/chibios/printf.c +++ b/tmk_core/common/chibios/printf.c @@ -98,8 +98,8 @@ static int a2d(char ch) { static char a2i(char ch, const char** src, int base, int* nump) { const char* p = *src; - int num = 0; - int digit; + int num = 0; + int digit; while ((digit = a2d(ch)) >= 0) { if (digit > base) break; num = num * base + digit; From 3dc061ac783df2222d284696a974c3faab8715f9 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Sun, 1 Mar 2020 15:16:43 -0500 Subject: [PATCH 006/106] Make a fix to savage65 and tmov2 for via (#8286) --- keyboards/cannonkeys/savage65/keymaps/via/rules.mk | 3 +-- keyboards/cannonkeys/tmov2/keymaps/via/rules.mk | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/keyboards/cannonkeys/savage65/keymaps/via/rules.mk b/keyboards/cannonkeys/savage65/keymaps/via/rules.mk index d12497792d5..925eb95d6b2 100644 --- a/keyboards/cannonkeys/savage65/keymaps/via/rules.mk +++ b/keyboards/cannonkeys/savage65/keymaps/via/rules.mk @@ -1,5 +1,4 @@ # rules.mk overrides to enable VIA -RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes +VIA_ENABLE = yes diff --git a/keyboards/cannonkeys/tmov2/keymaps/via/rules.mk b/keyboards/cannonkeys/tmov2/keymaps/via/rules.mk index d12497792d5..925eb95d6b2 100644 --- a/keyboards/cannonkeys/tmov2/keymaps/via/rules.mk +++ b/keyboards/cannonkeys/tmov2/keymaps/via/rules.mk @@ -1,5 +1,4 @@ # rules.mk overrides to enable VIA -RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes +VIA_ENABLE = yes From 88356c85c412253ba239e855b7ab0b2431547fab Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 1 Mar 2020 20:22:13 +0000 Subject: [PATCH 007/106] Prune out pure software pwm && custom driver && remove wrapping BACKLIGHT_PIN (#8041) --- quantum/backlight/backlight_avr.c | 521 ++++++++++++++---------------- 1 file changed, 239 insertions(+), 282 deletions(-) diff --git a/quantum/backlight/backlight_avr.c b/quantum/backlight/backlight_avr.c index 519c0c2cf27..ce6611fb5ac 100644 --- a/quantum/backlight/backlight_avr.c +++ b/quantum/backlight/backlight_avr.c @@ -2,7 +2,9 @@ #include "backlight.h" #include "debug.h" -#if defined(BACKLIGHT_ENABLE) && (defined(BACKLIGHT_PIN) || defined(BACKLIGHT_PINS)) +#if !defined(BACKLIGHT_PIN) && !defined(BACKLIGHT_PINS) +# error "Backlight pin/pins not defined. Please configure." +#endif // This logic is a bit complex, we support 3 setups: // @@ -12,262 +14,223 @@ // depends on the Audio setup (Audio wins over Backlight). // 3. Full software PWM, driven by the matrix scan, if both timers are used by Audio. -# if (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) && (BACKLIGHT_PIN == B5 || BACKLIGHT_PIN == B6 || BACKLIGHT_PIN == B7) -# define HARDWARE_PWM -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_OVF_vect TIMER1_OVF_vect -# define TIMSKx TIMSK1 -# define TOIEx TOIE1 +#if (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) && (BACKLIGHT_PIN == B5 || BACKLIGHT_PIN == B6 || BACKLIGHT_PIN == B7) +# define HARDWARE_PWM +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TIMSKx TIMSK1 +# define TOIEx TOIE1 -# if BACKLIGHT_PIN == B5 -# define COMxx0 COM1A0 -# define COMxx1 COM1A1 -# define OCRxx OCR1A -# elif BACKLIGHT_PIN == B6 -# define COMxx0 COM1B0 -# define COMxx1 COM1B1 -# define OCRxx OCR1B -# elif BACKLIGHT_PIN == B7 -# define COMxx0 COM1C0 -# define COMxx1 COM1C1 -# define OCRxx OCR1C -# endif -# elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) && (BACKLIGHT_PIN == C4 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6) -# define HARDWARE_PWM -# define ICRx ICR3 -# define TCCRxA TCCR3A -# define TCCRxB TCCR3B -# define TIMERx_OVF_vect TIMER3_OVF_vect -# define TIMSKx TIMSK3 -# define TOIEx TOIE3 +# if BACKLIGHT_PIN == B5 +# define COMxx0 COM1A0 +# define COMxx1 COM1A1 +# define OCRxx OCR1A +# elif BACKLIGHT_PIN == B6 +# define COMxx0 COM1B0 +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# elif BACKLIGHT_PIN == B7 +# define COMxx0 COM1C0 +# define COMxx1 COM1C1 +# define OCRxx OCR1C +# endif +#elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) && (BACKLIGHT_PIN == C4 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6) +# define HARDWARE_PWM +# define ICRx ICR3 +# define TCCRxA TCCR3A +# define TCCRxB TCCR3B +# define TIMERx_OVF_vect TIMER3_OVF_vect +# define TIMSKx TIMSK3 +# define TOIEx TOIE3 -# if BACKLIGHT_PIN == C4 -# if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) -# error This MCU has no C4 pin! -# else -# define COMxx0 COM3C0 -# define COMxx1 COM3C1 -# define OCRxx OCR3C -# endif -# elif BACKLIGHT_PIN == C5 -# if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) -# error This MCU has no C5 pin! -# else -# define COMxx0 COM3B0 -# define COMxx1 COM3B1 -# define OCRxx OCR3B -# endif -# elif BACKLIGHT_PIN == C6 -# define COMxx0 COM3A0 -# define COMxx1 COM3A1 -# define OCRxx OCR3A -# endif -# elif (defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__)) && (BACKLIGHT_PIN == B7 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6) -# define HARDWARE_PWM -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_OVF_vect TIMER1_OVF_vect -# define TIMSKx TIMSK1 -# define TOIEx TOIE1 - -# if BACKLIGHT_PIN == B7 -# define COMxx0 COM1C0 -# define COMxx1 COM1C1 -# define OCRxx OCR1C -# elif BACKLIGHT_PIN == C5 -# define COMxx0 COM1B0 -# define COMxx1 COM1B1 -# define OCRxx OCR1B -# elif BACKLIGHT_PIN == C6 -# define COMxx0 COM1A0 -# define COMxx1 COM1A1 -# define OCRxx OCR1A -# endif -# elif defined(__AVR_ATmega32A__) && (BACKLIGHT_PIN == D4 || BACKLIGHT_PIN == D5) -# define HARDWARE_PWM -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_OVF_vect TIMER1_OVF_vect -# define TIMSKx TIMSK -# define TOIEx TOIE1 - -# if BACKLIGHT_PIN == D4 -# define COMxx0 COM1B0 -# define COMxx1 COM1B1 -# define OCRxx OCR1B -# elif BACKLIGHT_PIN == D5 -# define COMxx0 COM1A0 -# define COMxx1 COM1A1 -# define OCRxx OCR1A -# endif -# elif defined(__AVR_ATmega328P__) && (BACKLIGHT_PIN == B1 || BACKLIGHT_PIN == B2) -# define HARDWARE_PWM -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_OVF_vect TIMER1_OVF_vect -# define TIMSKx TIMSK1 -# define TOIEx TOIE1 - -# if BACKLIGHT_PIN == B1 -# define COMxx0 COM1A0 -# define COMxx1 COM1A1 -# define OCRxx OCR1A -# elif BACKLIGHT_PIN == B2 -# define COMxx0 COM1B0 -# define COMxx1 COM1B1 -# define OCRxx OCR1B -# endif -# else -# if !defined(BACKLIGHT_CUSTOM_DRIVER) -# if !defined(B5_AUDIO) && !defined(B6_AUDIO) && !defined(B7_AUDIO) -// Timer 1 is not in use by Audio feature, Backlight can use it -# pragma message "Using hardware timer 1 with software PWM" -# define HARDWARE_PWM -# define BACKLIGHT_PWM_TIMER -# define ICRx ICR1 -# define TCCRxA TCCR1A -# define TCCRxB TCCR1B -# define TIMERx_COMPA_vect TIMER1_COMPA_vect -# define TIMERx_OVF_vect TIMER1_OVF_vect -# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register -# define TIMSKx TIMSK -# else -# define TIMSKx TIMSK1 -# endif -# define TOIEx TOIE1 - -# define OCIExA OCIE1A -# define OCRxx OCR1A -# elif !defined(C6_AUDIO) && !defined(C5_AUDIO) && !defined(C4_AUDIO) -# pragma message "Using hardware timer 3 with software PWM" -// Timer 3 is not in use by Audio feature, Backlight can use it -# define HARDWARE_PWM -# define BACKLIGHT_PWM_TIMER -# define ICRx ICR1 -# define TCCRxA TCCR3A -# define TCCRxB TCCR3B -# define TIMERx_COMPA_vect TIMER3_COMPA_vect -# define TIMERx_OVF_vect TIMER3_OVF_vect -# define TIMSKx TIMSK3 -# define TOIEx TOIE3 - -# define OCIExA OCIE3A -# define OCRxx OCR3A -# else -# pragma message "Audio in use - using pure software PWM" -# define NO_HARDWARE_PWM -# endif +# if BACKLIGHT_PIN == C4 +# if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) +# error This MCU has no C4 pin! # else -# pragma message "Custom driver defined - using pure software PWM" -# define NO_HARDWARE_PWM +# define COMxx0 COM3C0 +# define COMxx1 COM3C1 +# define OCRxx OCR3C # endif +# elif BACKLIGHT_PIN == C5 +# if (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)) +# error This MCU has no C5 pin! +# else +# define COMxx0 COM3B0 +# define COMxx1 COM3B1 +# define OCRxx OCR3B +# endif +# elif BACKLIGHT_PIN == C6 +# define COMxx0 COM3A0 +# define COMxx1 COM3A1 +# define OCRxx OCR3A # endif +#elif (defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__)) && (BACKLIGHT_PIN == B7 || BACKLIGHT_PIN == C5 || BACKLIGHT_PIN == C6) +# define HARDWARE_PWM +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TIMSKx TIMSK1 +# define TOIEx TOIE1 -# ifndef BACKLIGHT_ON_STATE -# define BACKLIGHT_ON_STATE 1 +# if BACKLIGHT_PIN == B7 +# define COMxx0 COM1C0 +# define COMxx1 COM1C1 +# define OCRxx OCR1C +# elif BACKLIGHT_PIN == C5 +# define COMxx0 COM1B0 +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# elif BACKLIGHT_PIN == C6 +# define COMxx0 COM1A0 +# define COMxx1 COM1A1 +# define OCRxx OCR1A # endif +#elif defined(__AVR_ATmega32A__) && (BACKLIGHT_PIN == D4 || BACKLIGHT_PIN == D5) +# define HARDWARE_PWM +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TIMSKx TIMSK +# define TOIEx TOIE1 + +# if BACKLIGHT_PIN == D4 +# define COMxx0 COM1B0 +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# elif BACKLIGHT_PIN == D5 +# define COMxx0 COM1A0 +# define COMxx1 COM1A1 +# define OCRxx OCR1A +# endif +#elif defined(__AVR_ATmega328P__) && (BACKLIGHT_PIN == B1 || BACKLIGHT_PIN == B2) +# define HARDWARE_PWM +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_OVF_vect TIMER1_OVF_vect +# define TIMSKx TIMSK1 +# define TOIEx TOIE1 + +# if BACKLIGHT_PIN == B1 +# define COMxx0 COM1A0 +# define COMxx1 COM1A1 +# define OCRxx OCR1A +# elif BACKLIGHT_PIN == B2 +# define COMxx0 COM1B0 +# define COMxx1 COM1B1 +# define OCRxx OCR1B +# endif +#elif !defined(B5_AUDIO) && !defined(B6_AUDIO) && !defined(B7_AUDIO) +// Timer 1 is not in use by Audio feature, Backlight can use it +# pragma message "Using hardware timer 1 with software PWM" +# define HARDWARE_PWM +# define BACKLIGHT_PWM_TIMER +# define ICRx ICR1 +# define TCCRxA TCCR1A +# define TCCRxB TCCR1B +# define TIMERx_COMPA_vect TIMER1_COMPA_vect +# define TIMERx_OVF_vect TIMER1_OVF_vect +# if defined(__AVR_ATmega32A__) // This MCU has only one TIMSK register +# define TIMSKx TIMSK +# else +# define TIMSKx TIMSK1 +# endif +# define TOIEx TOIE1 + +# define OCIExA OCIE1A +# define OCRxx OCR1A +#elif !defined(C6_AUDIO) && !defined(C5_AUDIO) && !defined(C4_AUDIO) +# pragma message "Using hardware timer 3 with software PWM" +// Timer 3 is not in use by Audio feature, Backlight can use it +# define HARDWARE_PWM +# define BACKLIGHT_PWM_TIMER +# define ICRx ICR1 +# define TCCRxA TCCR3A +# define TCCRxB TCCR3B +# define TIMERx_COMPA_vect TIMER3_COMPA_vect +# define TIMERx_OVF_vect TIMER3_OVF_vect +# define TIMSKx TIMSK3 +# define TOIEx TOIE3 + +# define OCIExA OCIE3A +# define OCRxx OCR3A +#elif defined(BACKLIGHT_CUSTOM_DRIVER) +error("Please set 'BACKLIGHT_DRIVER = custom' within rules.mk") +#else +error("Please set 'BACKLIGHT_DRIVER = software' within rules.mk") +#endif + +#ifndef BACKLIGHT_ON_STATE +# define BACKLIGHT_ON_STATE 1 +#endif void backlight_on(pin_t backlight_pin) { -# if BACKLIGHT_ON_STATE == 1 +#if BACKLIGHT_ON_STATE == 1 writePinHigh(backlight_pin); -# else +#else writePinLow(backlight_pin); -# endif +#endif } void backlight_off(pin_t backlight_pin) { -# if BACKLIGHT_ON_STATE == 1 +#if BACKLIGHT_ON_STATE == 1 writePinLow(backlight_pin); -# else +#else writePinHigh(backlight_pin); -# endif +#endif } -# if defined(NO_HARDWARE_PWM) || defined(BACKLIGHT_PWM_TIMER) // pwm through software +#ifdef BACKLIGHT_PWM_TIMER // pwm through software // we support multiple backlight pins -# ifndef BACKLIGHT_LED_COUNT -# define BACKLIGHT_LED_COUNT 1 -# endif +# ifndef BACKLIGHT_LED_COUNT +# define BACKLIGHT_LED_COUNT 1 +# endif -# if BACKLIGHT_LED_COUNT == 1 -# define BACKLIGHT_PIN_INIT \ - { BACKLIGHT_PIN } -# else -# define BACKLIGHT_PIN_INIT BACKLIGHT_PINS -# endif +# if BACKLIGHT_LED_COUNT == 1 +# define BACKLIGHT_PIN_INIT \ + { BACKLIGHT_PIN } +# else +# define BACKLIGHT_PIN_INIT BACKLIGHT_PINS +# endif -# define FOR_EACH_LED(x) \ - for (uint8_t i = 0; i < BACKLIGHT_LED_COUNT; i++) { \ - pin_t backlight_pin = backlight_pins[i]; \ - { x } \ - } +# define FOR_EACH_LED(x) \ + for (uint8_t i = 0; i < BACKLIGHT_LED_COUNT; i++) { \ + pin_t backlight_pin = backlight_pins[i]; \ + { x } \ + } static const pin_t backlight_pins[BACKLIGHT_LED_COUNT] = BACKLIGHT_PIN_INIT; -# else // full hardware PWM +#else // full hardware PWM static inline void enable_pwm(void) { -# if BACKLIGHT_ON_STATE == 1 +# if BACKLIGHT_ON_STATE == 1 TCCRxA |= _BV(COMxx1); -# else +# else TCCRxA |= _BV(COMxx1) | _BV(COMxx0); -# endif +# endif } static inline void disable_pwm(void) { -# if BACKLIGHT_ON_STATE == 1 +# if BACKLIGHT_ON_STATE == 1 TCCRxA &= ~(_BV(COMxx1)); -# else +# else TCCRxA &= ~(_BV(COMxx1) | _BV(COMxx0)); -# endif +# endif } // we support only one backlight pin static const pin_t backlight_pin = BACKLIGHT_PIN; -# define FOR_EACH_LED(x) x +# define FOR_EACH_LED(x) x -# endif +#endif -# ifdef NO_HARDWARE_PWM -void backlight_init_ports(void) { - // Setup backlight pin as output and output to on state. - FOR_EACH_LED(setPinOutput(backlight_pin); backlight_on(backlight_pin);) - -# ifdef BACKLIGHT_BREATHING - if (is_backlight_breathing()) { - breathing_enable(); - } -# endif -} - -uint8_t backlight_tick = 0; - -# ifndef BACKLIGHT_CUSTOM_DRIVER -void backlight_task(void) { - if ((0xFFFF >> ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2))) & (1 << backlight_tick)) { - FOR_EACH_LED(backlight_on(backlight_pin);) - } else { - FOR_EACH_LED(backlight_off(backlight_pin);) - } - backlight_tick = (backlight_tick + 1) % 16; -} -# endif - -# ifdef BACKLIGHT_BREATHING -# ifndef BACKLIGHT_CUSTOM_DRIVER -# error "Backlight breathing only available with hardware PWM. Please disable." -# endif -# endif - -# else // hardware pwm through timer - -# ifdef BACKLIGHT_PWM_TIMER +#ifdef BACKLIGHT_PWM_TIMER // The idea of software PWM assisted by hardware timers is the following // we use the hardware timer in fast PWM mode like for hardware PWM, but @@ -288,11 +251,11 @@ ISR(TIMERx_COMPA_vect) { FOR_EACH_LED(backlight_off(backlight_pin);) } // Triggered when the counter reaches the TOP value // this one triggers at F_CPU/65536 =~ 244 Hz ISR(TIMERx_OVF_vect) { -# ifdef BACKLIGHT_BREATHING +# ifdef BACKLIGHT_BREATHING if (is_breathing()) { breathing_task(); } -# endif +# endif // for very small values of OCRxx (or backlight level) // we can't guarantee this whole code won't execute // at the same time as the compare match interrupt @@ -306,9 +269,9 @@ ISR(TIMERx_OVF_vect) { } } -# endif +#endif -# define TIMER_TOP 0xFFFFU +#define TIMER_TOP 0xFFFFU // See http://jared.geek.nz/2013/feb/linear-led-pwm static uint16_t cie_lightness(uint16_t v) { @@ -329,88 +292,86 @@ static uint16_t cie_lightness(uint16_t v) { // range for val is [0..TIMER_TOP]. PWM pin is high while the timer count is below val. static inline void set_pwm(uint16_t val) { OCRxx = val; } -# ifndef BACKLIGHT_CUSTOM_DRIVER void backlight_set(uint8_t level) { if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS; if (level == 0) { -# ifdef BACKLIGHT_PWM_TIMER +#ifdef BACKLIGHT_PWM_TIMER if (OCRxx) { TIMSKx &= ~(_BV(OCIExA)); TIMSKx &= ~(_BV(TOIEx)); } -# else +#else // Turn off PWM control on backlight pin disable_pwm(); -# endif +#endif FOR_EACH_LED(backlight_off(backlight_pin);) } else { -# ifdef BACKLIGHT_PWM_TIMER +#ifdef BACKLIGHT_PWM_TIMER if (!OCRxx) { TIMSKx |= _BV(OCIExA); TIMSKx |= _BV(TOIEx); } -# else +#else // Turn on PWM control of backlight pin enable_pwm(); -# endif +#endif } // Set the brightness set_pwm(cie_lightness(TIMER_TOP * (uint32_t)level / BACKLIGHT_LEVELS)); } void backlight_task(void) {} -# endif // BACKLIGHT_CUSTOM_DRIVER -# ifdef BACKLIGHT_BREATHING +#ifdef BACKLIGHT_BREATHING -# define BREATHING_NO_HALT 0 -# define BREATHING_HALT_OFF 1 -# define BREATHING_HALT_ON 2 -# define BREATHING_STEPS 128 +# define BREATHING_NO_HALT 0 +# define BREATHING_HALT_OFF 1 +# define BREATHING_HALT_ON 2 +# define BREATHING_STEPS 128 -static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint8_t breathing_halt = BREATHING_NO_HALT; static uint16_t breathing_counter = 0; -# ifdef BACKLIGHT_PWM_TIMER +# ifdef BACKLIGHT_PWM_TIMER static bool breathing = false; bool is_breathing(void) { return breathing; } -# define breathing_interrupt_enable() \ - do { \ - breathing = true; \ - } while (0) -# define breathing_interrupt_disable() \ - do { \ - breathing = false; \ - } while (0) -# else +# define breathing_interrupt_enable() \ + do { \ + breathing = true; \ + } while (0) +# define breathing_interrupt_disable() \ + do { \ + breathing = false; \ + } while (0) +# else bool is_breathing(void) { return !!(TIMSKx & _BV(TOIEx)); } -# define breathing_interrupt_enable() \ - do { \ - TIMSKx |= _BV(TOIEx); \ - } while (0) -# define breathing_interrupt_disable() \ - do { \ - TIMSKx &= ~_BV(TOIEx); \ - } while (0) -# endif +# define breathing_interrupt_enable() \ + do { \ + TIMSKx |= _BV(TOIEx); \ + } while (0) +# define breathing_interrupt_disable() \ + do { \ + TIMSKx &= ~_BV(TOIEx); \ + } while (0) +# endif -# define breathing_min() \ - do { \ - breathing_counter = 0; \ - } while (0) -# define breathing_max() \ - do { \ - breathing_counter = get_breathing_period() * 244 / 2; \ - } while (0) +# define breathing_min() \ + do { \ + breathing_counter = 0; \ + } while (0) +# define breathing_max() \ + do { \ + breathing_counter = get_breathing_period() * 244 / 2; \ + } while (0) void breathing_enable(void) { breathing_counter = 0; - breathing_halt = BREATHING_NO_HALT; + breathing_halt = BREATHING_NO_HALT; breathing_interrupt_enable(); } @@ -451,20 +412,20 @@ static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, // Use this before the cie_lightness function. static inline uint16_t scale_backlight(uint16_t v) { return v / BACKLIGHT_LEVELS * get_backlight_level(); } -# ifdef BACKLIGHT_PWM_TIMER +# ifdef BACKLIGHT_PWM_TIMER void breathing_task(void) -# else +# else /* Assuming a 16MHz CPU clock and a timer that resets at 64k (ICR1), the following interrupt handler will run * about 244 times per second. */ ISR(TIMERx_OVF_vect) -# endif +# endif { - uint8_t breathing_period = get_breathing_period(); - uint16_t interval = (uint16_t)breathing_period * 244 / BREATHING_STEPS; + uint8_t breathing_period = get_breathing_period(); + uint16_t interval = (uint16_t)breathing_period * 244 / BREATHING_STEPS; // resetting after one period to prevent ugly reset at overflow. breathing_counter = (breathing_counter + 1) % (breathing_period * 244); - uint8_t index = breathing_counter / interval % BREATHING_STEPS; + uint8_t index = breathing_counter / interval % BREATHING_STEPS; if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) { breathing_interrupt_disable(); @@ -473,7 +434,7 @@ ISR(TIMERx_OVF_vect) set_pwm(cie_lightness(scale_backlight((uint16_t)pgm_read_byte(&breathing_table[index]) * 0x0101U))); } -# endif // BACKLIGHT_BREATHING +#endif // BACKLIGHT_BREATHING void backlight_init_ports(void) { // Setup backlight pin as output and output to on state. @@ -483,12 +444,12 @@ void backlight_init_ports(void) { // Go read the ATmega32u4 datasheet. // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on -# ifdef BACKLIGHT_PWM_TIMER +#ifdef BACKLIGHT_PWM_TIMER // TimerX setup, Fast PWM mode count to TOP set in ICRx TCCRxA = _BV(WGM11); // = 0b00000010; // clock select clk/1 TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; -# else // hardware PWM +#else // hardware PWM // Pin PB7 = OCR1C (Timer 1, Channel C) // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 // (i.e. start high, go low when counter matches.) @@ -500,25 +461,21 @@ void backlight_init_ports(void) { "In fast PWM mode, the compare units allow generation of PWM waveforms on the OCnx pins. Setting the COMnx1:0 bits to two will produce a non-inverted PWM [..]." "In fast PWM mode the counter is incremented until the counter value matches either one of the fixed values 0x00FF, 0x01FF, or 0x03FF (WGMn3:0 = 5, 6, or 7), the value in ICRn (WGMn3:0 = 14), or the value in OCRnA (WGMn3:0 = 15)." */ -# if BACKLIGHT_ON_STATE == 1 +# if BACKLIGHT_ON_STATE == 1 TCCRxA = _BV(COMxx1) | _BV(WGM11); -# else +# else TCCRxA = _BV(COMxx1) | _BV(COMxx0) | _BV(WGM11); -# endif +# endif TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); -# endif +#endif // Use full 16-bit resolution. Counter counts to ICR1 before reset to 0. ICRx = TIMER_TOP; backlight_init(); -# ifdef BACKLIGHT_BREATHING +#ifdef BACKLIGHT_BREATHING if (is_backlight_breathing()) { breathing_enable(); } -# endif +#endif } - -# endif // hardware backlight - -#endif // backlight From c543ccf07c9b3fa7ce64d19e7d54dc9404591c44 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Sun, 1 Mar 2020 16:30:01 -0500 Subject: [PATCH 008/106] Get the direction right on the S75 encoder (#8287) --- keyboards/cannonkeys/satisfaction75/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/cannonkeys/satisfaction75/config.h b/keyboards/cannonkeys/satisfaction75/config.h index 49ed407b3ba..3639a3eaa2f 100644 --- a/keyboards/cannonkeys/satisfaction75/config.h +++ b/keyboards/cannonkeys/satisfaction75/config.h @@ -35,8 +35,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { B3, B4, A0, A2, A4, A3 } #define DIODE_DIRECTION COL2ROW -#define ENCODERS_PAD_A { B8 } -#define ENCODERS_PAD_B { B9 } +#define ENCODERS_PAD_A { B9 } +#define ENCODERS_PAD_B { B8 } #define ENCODER_RESOLUTION 2 From 78069d482634b3b727e5d09b526fa24c227cc4e2 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Mon, 2 Mar 2020 09:36:17 +1100 Subject: [PATCH 009/106] Add onekey keymap for testing reset to bootloader. (#8288) --- keyboards/handwired/onekey/keymaps/reset/keymap.c | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 keyboards/handwired/onekey/keymaps/reset/keymap.c diff --git a/keyboards/handwired/onekey/keymaps/reset/keymap.c b/keyboards/handwired/onekey/keymaps/reset/keymap.c new file mode 100644 index 00000000000..6a68fda8188 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/reset/keymap.c @@ -0,0 +1,5 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT( RESET ) +}; From b72a1aa3fec986bfa7e439b68d6b7546ab1e280b Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Sun, 1 Mar 2020 21:17:09 -0800 Subject: [PATCH 010/106] Rewrite the Bathroom Epiphanies Frosty Flake matrix and LED handling (#8243) * Keyboard: revamp frosty-flake leds This commit transitions bpiphany/frosty_flake to led_update_{kb,user} and rewrites the AVR bit twiddling logic to use the standard QMK GPIO API. * Keyboard: rewrite frosty_flake's matrix reader to be a lite custom matrix This commit replaces frosty_flake's custom matrix and debounce logic with a "lite" custom matrix. In addition to being somewhat clearer, this allows a consumer of the flake board to choose their own debouncing algorithm. The one closest to the implementation originally in use is sym_g, but this opens us up to supporting eager_pk and eager_pr. The original matrix code was 18 columns for 8 rows, but using a single row read and unpacking the bits into individual columns. To simplify, I've changed the key layout to be 8C 18R instead of 18C 8R: this lets us use a single read directly into the matrix _and_ drop down to a uint8_t instead of a uint32_t for matrix_row_t. Since we're no longer implementing our own debouncing and row unpacking, we save ~400 bytes on the final firmware image. Fully tested against a CM Storm QFR hosting the flake -- this commit message was written using the new matrix code. Firmware Sizes (assuming stock configuration as of 42d6270f2) Matrix+Debounce Size (bytes) --------------- ------------ original 17740 new + sym_g 17284 new + eager_pr 18106 new + eager_pk 18204 I expect that there are some scanning speed benefits as well. * Keyboard: update frosty_flake's UNUSED_PINS * Keyboard: Remove meaningless weak redefinitions from frosty These are not necessary (and all of them already live somewhere in Quantum). --- keyboards/bpiphany/frosty_flake/config.h | 6 +- .../bpiphany/frosty_flake/frosty_flake.c | 73 +++--------- .../bpiphany/frosty_flake/frosty_flake.h | 58 ++++++---- keyboards/bpiphany/frosty_flake/matrix.c | 106 +++--------------- keyboards/bpiphany/frosty_flake/rules.mk | 2 +- 5 files changed, 77 insertions(+), 168 deletions(-) diff --git a/keyboards/bpiphany/frosty_flake/config.h b/keyboards/bpiphany/frosty_flake/config.h index 250a1b775b2..79bc31aec69 100644 --- a/keyboards/bpiphany/frosty_flake/config.h +++ b/keyboards/bpiphany/frosty_flake/config.h @@ -36,13 +36,13 @@ along with this program. If not, see . */ /* key matrix size */ -#define MATRIX_ROWS 8 // Row0 - Row7 in the schematic -#define MATRIX_COLS 18 // ColA - ColR in the schematic +#define MATRIX_ROWS 18 // ColA - ColR in the schematic +#define MATRIX_COLS 8 // Row0 - Row7 in the schematic /* * Keyboard Matrix Assignments */ -#define UNUSED_PINS { B0, C4, D3 } +#define UNUSED_PINS { C0, C1, C2, C3, C4, D2, D7 } /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 diff --git a/keyboards/bpiphany/frosty_flake/frosty_flake.c b/keyboards/bpiphany/frosty_flake/frosty_flake.c index 1cd47603893..be4e1a31248 100644 --- a/keyboards/bpiphany/frosty_flake/frosty_flake.c +++ b/keyboards/bpiphany/frosty_flake/frosty_flake.c @@ -1,63 +1,24 @@ #include "frosty_flake.h" -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up +void keyboard_pre_init_kb() { + setPinOutput(B7); // num lock + writePinHigh(B7); + setPinOutput(C5); // caps lock + writePinHigh(C7); + setPinOutput(C6); // scroll lock + writePinHigh(C6); - matrix_init_user(); + keyboard_pre_init_user(); } -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) +bool led_update_kb(led_t usb_led) { + // user requests no further processing + if (!led_update_user(usb_led)) + return true; - matrix_scan_user(); + writePin(C5, !usb_led.caps_lock); + writePin(B7, !usb_led.num_lock); + writePin(C6, !usb_led.scroll_lock); + + return true; } - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - DDRB |= (1<<7); - DDRC |= (1<<5) | (1<<6); - - print_dec(usb_led); - - if (usb_led & (1<. */ -#include -#include -#include #include -#include "print.h" -#include "debug.h" -#include "util.h" #include "matrix.h" -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -__attribute__ ((weak)) -void matrix_init_kb(void) { - matrix_init_user(); -} - -__attribute__ ((weak)) -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - static matrix_row_t scan_col(void) { + // Each of the 8 columns is read off pins as below + // 7 6 5 4 3 2 1 0 + // ,--,--,--,--,--,--,--,--, + // |B0|B3|B2|B1|B6|B4|B5|C7| + // `--`--`--`--`--`--`--`--` return ( (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) | (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<1)) | @@ -63,8 +36,8 @@ static matrix_row_t scan_col(void) { ); } -static void select_col(uint8_t col) { - switch (col) { +static void select_row(uint8_t row) { + switch (row) { case 0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break; case 1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break; case 2: PORTD = (PORTD & ~0b01111011) | 0b01101010; break; @@ -86,7 +59,7 @@ static void select_col(uint8_t col) { } } -void matrix_init(void) { +void matrix_init_custom(void) { /* Row output pins */ DDRD |= 0b01111011; /* Column input pins */ @@ -94,62 +67,19 @@ void matrix_init(void) { DDRB &= ~0b01111111; PORTC |= 0b10000000; PORTB |= 0b01111111; - - for (uint8_t i=0; i < MATRIX_ROWS; i++) - matrix[i] = matrix_debouncing[i] = 0; - - matrix_init_quantum(); } -uint8_t matrix_scan(void) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - select_col(col); - _delay_us(3); - matrix_row_t col_scan = scan_col(); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< Date: Sun, 1 Mar 2020 22:29:26 -0800 Subject: [PATCH 011/106] [Docs] Update ISP Flashing guide (#8149) * [Docs] Update ISP Flashing guide * Apply suggestions from code review AKA why you shouldn't write docs at 2am Co-Authored-By: fauxpark Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Update workding for planck-qmk-dfu Co-authored-by: Ryan Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> --- docs/isp_flashing_guide.md | 153 ++++++++++++++++++++++++++++++++----- 1 file changed, 133 insertions(+), 20 deletions(-) diff --git a/docs/isp_flashing_guide.md b/docs/isp_flashing_guide.md index 0f786c5141b..944dd346222 100644 --- a/docs/isp_flashing_guide.md +++ b/docs/isp_flashing_guide.md @@ -1,6 +1,14 @@ # ISP Flashing Guide -If you're having trouble flashing/erasing your board, and running into cryptic error messages like any of the following: +ISP flashing (also known as ICSP flashing) is the process of programming a microcontroller directly. This allows you to replace the bootloader, or change the "fuses" on the controller, which control a number of hardware- and software-related functions, such as the speed of the controller, how it boots, and other options. + +The main use of ISP flashing for QMK is flashing or replacing the bootloader on your AVR-based controller (Pro Micros, or V-USB chips). + +?> This is only for programming AVR based boards, such as the Pro Micro or other ATmega controllers. It is not for Arm controllers, such as the Proton C. + +## Dealing with Corrupted Bootloaders + +If you're having trouble flashing/erasing your board, and running into cryptic error messages like any of the following for a DFU based controller: libusb: warning [darwin_transfer_status] transfer error: timed out dfu.c:844: -ETIMEDOUT: Transfer timed out, NAK 0xffffffc4 (-60) @@ -19,16 +27,60 @@ If you're having trouble flashing/erasing your board, and running into cryptic e Memory write error, use debug for more info. commands.c:360: Error writing memory data. (err -4) -You're likely going to need to ISP flash your board/device to get it working again. Luckily, this process is pretty straight-forward, provided you have any extra programmable keyboard, Pro Micro, or Teensy 2.0/Teensy 2.0++. There are also dedicated ISP flashers available for this, but most cost >$15, and it's assumed that if you are googling this error, this is the first you've heard about ISP flashing, and don't have one readily available (whereas you might have some other AVR board). __We'll be using a Teensy 2.0 or Pro Micro with Windows 10 in this guide__ - if you are comfortable doing this on another system, please consider editing this guide and contributing those instructions! +Or, if you see this sort of message for a Pro Micro based controller: + + avrdude: butterfly_recv(): programmer is not responding + avrdude: butterfly_recv(): programmer is not responding + avrdude: verification error, first mismatch at byte 0x002a + 0x2b != 0x75 + avrdude: verification error; content mismatch + avrdude: verification error; content mismatch + + +You're likely going to need to ISP flash your board/device to get it working again. + +## Hardware Needed + +You'll need one of the following to actually perform the ISP flashing (followed by the protocol they use): + +* [SparkFun PocketAVR](https://www.sparkfun.com/products/9825) - (USB Tiny) +* [USBtinyISP AVR Programmer Kit](https://www.adafruit.com/product/46) - (USB Tiny) +* [Teensy 2.0](https://www.pjrc.com/store/teensy.html) - (avrisp) +* [Pro Micro](https://www.sparkfun.com/products/12640) - (avrisp) +* [Bus Pirate](https://www.adafruit.com/product/237) - (buspirate) + +There are other devices that can be used to ISP flash, but these are the main ones. Also, all product links are to the official versions. You can source them elsewhere. + +You'll also need something to wire your "ISP Programmer" to the device that you're programming. Some PCBs may have ISP headers that you can use directly, but this often isn't the case, so you'll likely need to solder to the controller itself or to different switches or other components. + +### The ISP Firmware + +The Teensy and Pro Micro controllers will need you to flash the ISP firmware to the controllers before you can use them as an ISP programmer. The rest of the hardware should come preprogrammed. So, for these controllers, download the correct hex file, and flash it first. + +* Teensy 2.0: [`util/teensy_2.0_ISP_B0.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/teensy_2.0_ISP_B0.hex) (`B0`) +* Pro Micro: [`util/pro_micro_ISP_B6_10.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/pro_micro_ISP_B6_10.hex) (`10/B6`) + +Once you've flashed your controller, you won't need this hex file anymore. ## Software Needed -* [Teensy Loader](https://www.pjrc.com/teensy/loader.html) (if using a Teensy) -* QMK Toolbox (flash as usual - be sure to select the correct MCU) or `avrdude` via [WinAVR](http://www.ladyada.net/learn/avr/setup-win.html) (for Teensy & Pro Micro) +The QMK Toolbox can be used for most (all) of this. + +However, you can grab the [Teensy Loader](https://www.pjrc.com/teensy/loader.html) to flash your Teensy 2.0 board, if you are using that. Or you can use `avrdude` (installed as part of `qmk_install.sh`), or [AVRDUDESS](https://blog.zakkemble.net/avrdudess-a-gui-for-avrdude/) (for Windows) to flash the Pro Micro, and the ISP flashing. + ## Wiring -This is pretty straight-forward - we'll be connecting like-things to like-things in the following manner: +This is pretty straight-forward - we'll be connecting like-things to like-things in the following manner. + +### SparkFun Pocket AVR + + PocketAVR RST <-> Keyboard RESET + PocketAVR SCLK <-> Keyboard B1 (SCLK) + PocketAVR MOSI <-> Keyboard B2 (MOSI) + PocketAVR MISO <-> Keyboard B3 (MISO) + PocketAVR VCC <-> Keyboard VCC + PocketAVR GND <-> Keyboard GND ### Teensy 2.0 @@ -39,6 +91,8 @@ This is pretty straight-forward - we'll be connecting like-things to like-things Teensy VCC <-> Keyboard VCC Teensy GND <-> Keyboard GND +!> Note that the B0 pin on the Teensy is wired to the RESET/RST pin on the keyboard's controller. ***DO NOT*** wire the RESET pin on the Teensy to the RESET on the keyboard. + ### Pro Micro Pro Micro 10 (B6) <-> Keyboard RESET @@ -48,45 +102,61 @@ This is pretty straight-forward - we'll be connecting like-things to like-things Pro Micro VCC <-> Keyboard VCC Pro Micro GND <-> Keyboard GND -## The ISP Firmware (now pre-compiled) +!> Note that the 10/B6 pin on the Pro Micro is wired to the RESET/RST pin on the keyboard's controller. ***DO NOT*** wire the RESET pin on the Pro Micro to the RESET on the keyboard. -The only difference between the .hex files below is which pin is connected to RESET. You can use them on other boards as well, as long as you're aware of the pins being used. If for some reason neither of these pins are available, [create an issue](https://github.com/qmk/qmk_firmware/issues/new), and we can generate one for you! -* Teensy 2.0: [`util/teensy_2.0_ISP_B0.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/teensy_2.0_ISP_B0.hex) (`B0`) -* Pro Micro: [`util/pro_micro_ISP_B6_10.hex`](https://github.com/qmk/qmk_firmware/blob/master/util/pro_micro_ISP_B6_10.hex) (`B6/10`) +## Flashing Your Keyboard -**Flash your Teenys/Pro Micro with one of these and continue - you won't need the file after flashing your ISP device.** +After you have your ISP programmer set up, and wired to your keyboard, it's time to flash your keyboard. -## Just the Bootloader File +### The Bootloader File -If you just want to get things back to normal, you can flash only a bootloader from [`util/` folder](https://github.com/qmk/qmk_firmware/tree/master/util), and use your normal process to flash the firmware afterwards. Be sure to flash the correct bootloader for your chip: +The simplest and quickest way to get things back to normal is to flash only a bootloader to the keyboard. Once this is done, you can connect the keyboard normally and flash the keyboard like you normally would. + +You can find the stock bootloaders in the [`util/` folder](https://github.com/qmk/qmk_firmware/tree/master/util). Be sure to flash the correct bootloader for your chip: * [`atmega32u4`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) - Most keyboards, Planck Rev 1-5, Preonic Rev 1-2 +* [`Pro Micro`](https://github.com/sparkfun/Arduino_Boards/blob/master/sparkfun/avr/bootloaders/caterina/Caterina-promicro16.hex) - The default bootloader for Pro Micro controllers * [`at90usb1286`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_at90usb128x_1_0_1.hex) - Planck Light Rev 1 -* [`atmega32a`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32a_1_0_0.hex) - jj40 +* [`atmega32a`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32a_1_0_0.hex) - jj40, and other V-USB/ps2avrGB keyboards If you're not sure what your board uses, look in the `rules.mk` file for the keyboard in QMK. The `MCU =` line will have the value you need. It may differ between different versions of the board. -### Advanced/Production Techniques +### Production Techniques -If you'd like to flash both the bootloader **and** the regular firmware at the same time, you need to combine the files. +If you'd like to flash both the bootloader **and** the regular firmware at the same time, there are two options to do so. Manually, or with the `:production` target when compiling. + +To do this manually: 1. Open the original firmware .hex file in a text editor 2. Remove the last line (which should be `:00000001FF` - this is an EOF message) 3. Copy the entire bootloader's contents onto a new line (with no empty lines between) and paste it at the end of the original file 4. Save it as a new file by naming it `__production.hex` -It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to use ISP again to write new firmware to your keyboard. +?> It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to use ISP again to write new firmware to your keyboard. + +To do this the easy way, you can flash the board using the `:production` target when compiling. This compiles the firmware, then compiles the QMK DFU bootloader, and then creates a combined image. Once this is done, you'll see three files: +* `_.hex` +* `__bootloader.hex` +* `__production.hex` + +The QMK DFU bootloader has only really been tested on `atmega32u4` controllers (such as the AVR based Planck boards, and the Pro Micro), and hasn't been tested on other controllers. However, it will definitely not work on V-USB controllers, such as the `atmega32a` or `atmega328p`. + +You can flash either the bootloader or the production firmware file. The production firmware file will take a lot longer to flash, since it's flashing a lot more data. + +?> Note: You should stay with the same bootloader. If you're using DFU already, switching to QMK DFU is fine. But flashing QMK DFU onto a Pro Micro, for instance, has additional steps needed. ## Flashing Your Bootloader/Production File -Make sure your keyboard is unplugged from any device, and plug in your Teensy. +Make sure your keyboard is unplugged from any device, and plug in your ISP Programmer. + +If you want to change bootloader types, You'll need to use the command line. ### QMK Toolbox -1. `AVRISP device connected` will show up in yellow +1. `AVRISP device connected` or `USB Tiny device connected` will show up in yellow 2. Select the correct bootloader/production .hex file with the `Open` dialog (spaces can't be in the path) -3. Be sure the correct `Microcontroller` option is selected +3. Be sure the correct `Microcontroller` option for the keyboard you're flashing (not the ISP programmer) is selected 4. Hit `Flash` 5. Wait, as nothing will output for a while, especially with production files @@ -94,7 +164,7 @@ If the verification and fuse checks are ok, you're done! Your board may restart ### Command Line -Open `cmd` and navigate to your where your modified .hex file is. We'll pretend this file is called `main.hex`, and that your Teensy 2.0 is on the `COM3` port - if you're unsure, you can open your Device Manager, and look for `Ports > USB Serial Device`. Use that COM port here. You can confirm it's the right port with: +Open a terminal (`cmd` on Windows, for instance) and navigate to your where your modified .hex file is. We'll pretend this file is called `main.hex`, and that your Teensy 2.0 is on the `COM3` port - if you're unsure, you can open your Device Manager, and look for `Ports > USB Serial Device`. Use that COM port here. You can confirm it's the right port with: avrdude -c avrisp -P COM3 -p atmega32u4 @@ -129,4 +199,47 @@ You should see a couple of progress bars, then you should see: Which means everything should be ok! Your board may restart automatically, otherwise, unplug your Teensy and plug in your keyboard - you can leave your Teensy wired to your keyboard while testing things, but it's recommended that you desolder it/remove the wiring once you're sure everything works. +If you're using a SparkFun PocketAVR Programmer, or another USB Tiny based ISP programmer, you will want to use something like this: + + avrdude -c usbtiny -P usb -p atmega32u4 + +#### Advanced: Changing Fuses + +If you're switching bootloaders, such as flashing QMK DFU on a Pro Micro, you will need to change the fuses, in additional to flashing the bootloader hex file. This is because `caterina` (the Pro Micro bootloader) and `dfu` handle the startup routines differently, and that behavior is controlled by the fuses. + +!> This is one area that it is very important to be careful, as changing fuses is one of the ways that you can permanently brick your controller. + +For this, we are assuming the 5V 16MHz versions of the `atmega32u4` (such as the 5V Pro Micro). + +For DFU on the `atmega32u4`, these are the fuse settings that you want: + +| Fuse | Setting | +|----------|------------------| +| Low | `0x5E` | +| High | `0xD9` or `0x99` | +| Extended | `0xC3` | + +The High fuse can be 0xD9 or 0x99. The difference is that 0xD9 disables JTAG, which QMK Firmware disables via software as well, while 0x99 doesn't disable JTAG. + +To set this add `-U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m` to your command. So the final command should look something like: + + avrdude -c avrisp -P COM3 -p atmega32u4 -U flash:w:main.hex:i -U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m + +For Caterina on the `atmega32u4`, these are the fuse settings that you want: + +| Fuse | Setting| +|----------|--------| +| Low | `0xFF` | +| High | `0xD9` | +| Extended | `0xC3` | + +To set this add `-U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xC3:m` to your command. So the final command should look something like: + + avrdude -c avrisp -P COM3 -p atmega32u4 -U flash:w:main.hex:i -U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xC3:m + + +If you are using a different controller or want different configuration, you can use [this AVR Fuse Calculator](http://www.engbedded.com/fusecalc/) to find a better value for you. + +## Help + If you have any questions/problems, feel free to [open an issue](https://github.com/qmk/qmk_firmware/issues/new)! From 552f8d81b9bff8010b328ee944d50830cfcaea5c Mon Sep 17 00:00:00 2001 From: Ted M Lin Date: Mon, 2 Mar 2020 18:43:18 -0500 Subject: [PATCH 012/106] 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/keymap_extras/sendstring_belgian.h | 69 +++++----- quantum/keymap_extras/sendstring_bepo.h | 69 +++++----- quantum/keymap_extras/sendstring_danish.h | 69 +++++----- quantum/keymap_extras/sendstring_french.h | 69 +++++----- quantum/keymap_extras/sendstring_german.h | 69 +++++----- quantum/keymap_extras/sendstring_jis.h | 35 ++--- quantum/keymap_extras/sendstring_spanish.h | 69 +++++----- quantum/keymap_extras/sendstring_turkish_f.h | 69 +++++----- quantum/keymap_extras/sendstring_turkish_q.h | 69 +++++----- quantum/keymap_extras/sendstring_uk.h | 35 ++--- quantum/quantum.c | 131 +++++++++++++------ quantum/quantum.h | 16 ++- 12 files changed, 419 insertions(+), 350 deletions(-) diff --git a/quantum/keymap_extras/sendstring_belgian.h b/quantum/keymap_extras/sendstring_belgian.h index ca0edfb683c..ef5a2f049d9 100644 --- a/quantum/keymap_extras/sendstring_belgian.h +++ b/quantum/keymap_extras/sendstring_belgian.h @@ -19,47 +19,48 @@ #pragma once #include "keymap_belgian.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 1, 1, 0, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 0, 0, 0, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + KCLUT_ENTRY(0, 0, 0, 0, 0, 1, 0, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 0, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 0, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), }; -const bool ascii_to_altgr_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 0, 0, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_bepo.h b/quantum/keymap_extras/sendstring_bepo.h index ca5f73d7ec3..f0cc88bd223 100644 --- a/quantum/keymap_extras/sendstring_bepo.h +++ b/quantum/keymap_extras/sendstring_bepo.h @@ -19,47 +19,48 @@ #pragma once #include "keymap_bepo.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 1, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 0, 0, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + KCLUT_ENTRY(0, 1, 0, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 0, 0, 0, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), }; -const bool ascii_to_altgr_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 1, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 1, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_danish.h b/quantum/keymap_extras/sendstring_danish.h index 3505a076bd3..43b6a56cf85 100644 --- a/quantum/keymap_extras/sendstring_danish.h +++ b/quantum/keymap_extras/sendstring_danish.h @@ -19,47 +19,48 @@ #pragma once #include "keymap_danish.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 1, 1, 1, 0, 1, 1, 0, - 1, 1, 1, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + KCLUT_ENTRY(0, 1, 1, 1, 0, 1, 1, 0), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), }; -const bool ascii_to_altgr_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_french.h b/quantum/keymap_extras/sendstring_french.h index 966685ccca5..04b65ee919d 100644 --- a/quantum/keymap_extras/sendstring_french.h +++ b/quantum/keymap_extras/sendstring_french.h @@ -19,47 +19,48 @@ #pragma once #include "keymap_french.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 0, 0, 0, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + KCLUT_ENTRY(0, 0, 0, 0, 0, 1, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 0, 0, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 0, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), }; -const bool ascii_to_altgr_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 0, 0, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_german.h b/quantum/keymap_extras/sendstring_german.h index 3f27a9b2cab..1bbdcce2ca8 100644 --- a/quantum/keymap_extras/sendstring_german.h +++ b/quantum/keymap_extras/sendstring_german.h @@ -19,47 +19,48 @@ #pragma once #include "keymap_german.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 1, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + KCLUT_ENTRY(0, 1, 1, 0, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), }; -const bool ascii_to_altgr_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_jis.h b/quantum/keymap_extras/sendstring_jis.h index 421ceb0438e..8b0dc99561c 100644 --- a/quantum/keymap_extras/sendstring_jis.h +++ b/quantum/keymap_extras/sendstring_jis.h @@ -19,27 +19,28 @@ #pragma once #include "keymap_jp.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 1, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 1, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_spanish.h b/quantum/keymap_extras/sendstring_spanish.h index 92bada269a0..70e67165396 100644 --- a/quantum/keymap_extras/sendstring_spanish.h +++ b/quantum/keymap_extras/sendstring_spanish.h @@ -19,47 +19,48 @@ #pragma once #include "keymap_spanish.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + KCLUT_ENTRY(0, 1, 1, 0, 1, 1, 1, 0), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), }; -const bool ascii_to_altgr_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 0, 0, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_turkish_f.h b/quantum/keymap_extras/sendstring_turkish_f.h index 82dbbdbcb44..5eec73bdedb 100644 --- a/quantum/keymap_extras/sendstring_turkish_f.h +++ b/quantum/keymap_extras/sendstring_turkish_f.h @@ -19,47 +19,48 @@ #pragma once #include "keymap_turkish_f.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + KCLUT_ENTRY(0, 1, 1, 0, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), }; -const bool ascii_to_altgr_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 0, 0, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_turkish_q.h b/quantum/keymap_extras/sendstring_turkish_q.h index 58505b84966..97c990c12aa 100644 --- a/quantum/keymap_extras/sendstring_turkish_q.h +++ b/quantum/keymap_extras/sendstring_turkish_q.h @@ -19,47 +19,48 @@ #pragma once #include "keymap_turkish_q.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 1, 0, 0, 0, 1, 1, 1, - 1, 1, 0, 1, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 0, 1, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 + KCLUT_ENTRY(0, 1, 0, 0, 0, 1, 1, 1), + KCLUT_ENTRY(1, 1, 0, 1, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), }; -const bool ascii_to_altgr_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 0, 0, 1, 1, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/keymap_extras/sendstring_uk.h b/quantum/keymap_extras/sendstring_uk.h index 982456e40ae..733c5f8600e 100644 --- a/quantum/keymap_extras/sendstring_uk.h +++ b/quantum/keymap_extras/sendstring_uk.h @@ -19,27 +19,28 @@ #pragma once #include "keymap_uk.h" +#include "quantum.h" // clang-format off -const bool ascii_to_shift_lut[128] PROGMEM = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), - 0, 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 1, 1, 0 + KCLUT_ENTRY(0, 1, 1, 0, 1, 1, 1, 0), + KCLUT_ENTRY(1, 1, 1, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 0, 1, 0, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), }; const uint8_t ascii_to_keycode_lut[128] PROGMEM = { diff --git a/quantum/quantum.c b/quantum/quantum.c index 37c374ece98..e06448d9e4a 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -321,50 +321,97 @@ bool process_record_quantum(keyrecord_t *record) { return process_action_kb(record); } -__attribute__((weak)) const bool ascii_to_shift_lut[128] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0}; - -__attribute__((weak)) const bool ascii_to_altgr_lut[128] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - // clang-format off -__attribute__((weak)) const uint8_t ascii_to_keycode_lut[128] PROGMEM = {// NUL SOH STX ETX EOT ENQ ACK BEL - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - // BS TAB LF VT FF CR SO SI - KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - // DLE DC1 DC2 DC3 DC4 NAK SYN ETB - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - // CAN EM SUB ESC FS GS RS US - XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - // ! " # $ % & ' - KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, - // ( ) * + , - . / - KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, - // 0 1 2 3 4 5 6 7 - KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, - // 8 9 : ; < = > ? - KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, - // @ A B C D E F G - KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - // H I J K L M N O - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - // P Q R S T U V W - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - // X Y Z [ \ ] ^ _ - KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, - // ` a b c d e f g - KC_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, - // h i j k l m n o - KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, - // p q r s t u v w - KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, - // x y z { | } ~ DEL - KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL}; +/* Bit-Packed look-up table to convert an ASCII character to whether + * [Shift] needs to be sent with the keycode. + */ +__attribute__((weak)) const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 0), + KCLUT_ENTRY(1, 1, 1, 1, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 0, 1, 0, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), +}; + +/* Bit-Packed look-up table to convert an ASCII character to whether + * [AltGr] needs to be sent with the keycode. + */ +__attribute__((weak)) const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), +}; + +/* Look-up table to convert an ASCII character to a keycode. + */ +__attribute__((weak)) const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, + // ( ) * + , - . / + KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH, + // 0 1 2 3 4 5 6 7 + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + // 8 9 : ; < = > ? + KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH, + // @ A B C D E F G + KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // H I J K L M N O + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + // P Q R S T U V W + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + // X Y Z [ \ ] ^ _ + KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS, + // ` a b c d e f g + KC_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + // h i j k l m n o + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + // p q r s t u v w + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + // x y z { | } ~ DEL + KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL +}; + // clang-format on +// Note: we bit-pack in "reverse" order to optimize loading +#define PGM_LOADBIT(mem, pos) ((pgm_read_byte(&((mem)[(pos) / 8])) >> ((pos) % 8)) & 0x01) + void send_string(const char *str) { send_string_with_delay(str, 0); } void send_string_P(const char *str) { send_string_with_delay_P(str, 0); } @@ -462,8 +509,8 @@ void send_char(char ascii_code) { #endif uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); - bool is_shifted = pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code]); - bool is_altgred = pgm_read_byte(&ascii_to_altgr_lut[(uint8_t)ascii_code]); + bool is_shifted = PGM_LOADBIT(ascii_to_shift_lut, (uint8_t)ascii_code); + bool is_altgred = PGM_LOADBIT(ascii_to_altgr_lut, (uint8_t)ascii_code); if (is_shifted) { register_code(KC_LSFT); diff --git a/quantum/quantum.h b/quantum/quantum.h index 7dc14e62807..d03ba5942a0 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); From ce30cd2a010b7cad383b34432cc28d808a45266d Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 2 Mar 2020 18:55:57 -0500 Subject: [PATCH 013/106] Update encoder functions for Iris VIA keymap (#8295) --- keyboards/keebio/iris/keymaps/via/keymap.c | 7 +++++++ keyboards/keebio/iris/rev4/rev4.h | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/keyboards/keebio/iris/keymaps/via/keymap.c b/keyboards/keebio/iris/keymaps/via/keymap.c index c861ae845fe..05eb42ae0bf 100644 --- a/keyboards/keebio/iris/keymaps/via/keymap.c +++ b/keyboards/keebio/iris/keymaps/via/keymap.c @@ -68,6 +68,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void encoder_update_user(uint8_t index, bool clockwise) { if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } + else if (index == 1) { if (clockwise) { tap_code(KC_PGDN); } else { diff --git a/keyboards/keebio/iris/rev4/rev4.h b/keyboards/keebio/iris/rev4/rev4.h index d8623348e4e..06e515ebc69 100644 --- a/keyboards/keebio/iris/rev4/rev4.h +++ b/keyboards/keebio/iris/rev4/rev4.h @@ -3,7 +3,6 @@ #include "iris.h" #include "quantum.h" - #ifdef USE_I2C #include #ifdef __AVR__ From bff56aa46c7c89d0e5363e3bbcae78341c069c14 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 3 Mar 2020 10:56:46 +1100 Subject: [PATCH 014/106] Remove "ugly hack in usb_main.c" comments (#8296) --- keyboards/at_at/660m/config.h | 2 -- keyboards/cannonkeys/an_c/config.h | 2 -- keyboards/cannonkeys/chimera65/config.h | 2 -- keyboards/cannonkeys/instant60/config.h | 2 -- keyboards/cannonkeys/iron165/config.h | 2 -- keyboards/cannonkeys/ortho48/config.h | 2 -- keyboards/cannonkeys/ortho60/config.h | 2 -- keyboards/cannonkeys/ortho75/config.h | 2 -- keyboards/cannonkeys/practice60/config.h | 2 -- keyboards/cannonkeys/practice65/config.h | 2 -- keyboards/cannonkeys/satisfaction75/config.h | 2 -- keyboards/cannonkeys/savage65/config.h | 2 -- keyboards/cannonkeys/tmov2/config.h | 2 -- keyboards/handwired/bluepill/bluepill70/config.h | 6 +----- keyboards/handwired/ck4x4/config.h | 2 -- keyboards/hid_liber/config.h | 2 -- keyboards/jm60/config.h | 2 -- keyboards/k_type/config.h | 2 -- keyboards/projectkb/alice/config.h | 2 -- keyboards/wete/config.h | 2 -- keyboards/xiaomi/mk02/config.h | 2 -- 21 files changed, 1 insertion(+), 45 deletions(-) diff --git a/keyboards/at_at/660m/config.h b/keyboards/at_at/660m/config.h index f9b19c01817..93b58b30afb 100644 --- a/keyboards/at_at/660m/config.h +++ b/keyboards/at_at/660m/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xA22A #define PRODUCT_ID 0x6600 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER AT-AT #define PRODUCT 660M #define DESCRIPTION 660M Keyboard diff --git a/keyboards/cannonkeys/an_c/config.h b/keyboards/cannonkeys/an_c/config.h index 6390e078971..7f8d7e8ff6d 100644 --- a/keyboards/cannonkeys/an_c/config.h +++ b/keyboards/cannonkeys/an_c/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xCA04 #define PRODUCT_ID 0xA00C #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER CannonKeys #define PRODUCT AN-C #define DESCRIPTION AN-C Keyboard diff --git a/keyboards/cannonkeys/chimera65/config.h b/keyboards/cannonkeys/chimera65/config.h index c76fd6c1c5b..663d9cca9a5 100644 --- a/keyboards/cannonkeys/chimera65/config.h +++ b/keyboards/cannonkeys/chimera65/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xCA04 #define PRODUCT_ID 0xC024 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER CannonKeys #define PRODUCT Chimera65 #define DESCRIPTION Chimera65 Keyboard diff --git a/keyboards/cannonkeys/instant60/config.h b/keyboards/cannonkeys/instant60/config.h index 4fa76cb8837..6f8f6bd011d 100644 --- a/keyboards/cannonkeys/instant60/config.h +++ b/keyboards/cannonkeys/instant60/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xCA04 #define PRODUCT_ID 0x1600 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER CannonKeys #define PRODUCT Instant60 #define DESCRIPTION Instant 60 Keyboard diff --git a/keyboards/cannonkeys/iron165/config.h b/keyboards/cannonkeys/iron165/config.h index 6350514d75c..c8be89da950 100644 --- a/keyboards/cannonkeys/iron165/config.h +++ b/keyboards/cannonkeys/iron165/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0x5A12 #define PRODUCT_ID 0x5165 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER SmithAndRune #define PRODUCT Iron165 #define DESCRIPTION Iron165 Keyboard diff --git a/keyboards/cannonkeys/ortho48/config.h b/keyboards/cannonkeys/ortho48/config.h index 497e08bcf5e..094be01388f 100644 --- a/keyboards/cannonkeys/ortho48/config.h +++ b/keyboards/cannonkeys/ortho48/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xCA04 #define PRODUCT_ID 0x0248 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER QMK #define PRODUCT Ortho48 #define DESCRIPTION Ortho48 diff --git a/keyboards/cannonkeys/ortho60/config.h b/keyboards/cannonkeys/ortho60/config.h index 9b85952d789..412f0df4931 100644 --- a/keyboards/cannonkeys/ortho60/config.h +++ b/keyboards/cannonkeys/ortho60/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6464 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER QMK #define PRODUCT Ortho60 #define DESCRIPTION Ortho60 diff --git a/keyboards/cannonkeys/ortho75/config.h b/keyboards/cannonkeys/ortho75/config.h index 588e2b9215f..95bb0145204 100644 --- a/keyboards/cannonkeys/ortho75/config.h +++ b/keyboards/cannonkeys/ortho75/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6464 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER CannonKeys #define PRODUCT Ortho75 #define DESCRIPTION Ortho75 diff --git a/keyboards/cannonkeys/practice60/config.h b/keyboards/cannonkeys/practice60/config.h index c015bb74652..af23eff322b 100644 --- a/keyboards/cannonkeys/practice60/config.h +++ b/keyboards/cannonkeys/practice60/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6464 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER QMK #define PRODUCT Practice 60 #define DESCRIPTION Practice 60 diff --git a/keyboards/cannonkeys/practice65/config.h b/keyboards/cannonkeys/practice65/config.h index d09b521bfab..7ebac8d8e1c 100644 --- a/keyboards/cannonkeys/practice65/config.h +++ b/keyboards/cannonkeys/practice65/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xCA04 #define PRODUCT_ID 0x6565 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER CannonKeys #define PRODUCT Practice 65 #define DESCRIPTION Practice 65 diff --git a/keyboards/cannonkeys/satisfaction75/config.h b/keyboards/cannonkeys/satisfaction75/config.h index 3639a3eaa2f..ff31e37c4b0 100644 --- a/keyboards/cannonkeys/satisfaction75/config.h +++ b/keyboards/cannonkeys/satisfaction75/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xCA04 #define PRODUCT_ID 0x57F5 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER CannonKeys #define PRODUCT Satisfaction75 #define DESCRIPTION Satisfaction 75 Keyboard diff --git a/keyboards/cannonkeys/savage65/config.h b/keyboards/cannonkeys/savage65/config.h index 98ec1067a8d..0839c0111ee 100644 --- a/keyboards/cannonkeys/savage65/config.h +++ b/keyboards/cannonkeys/savage65/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xCA04 #define PRODUCT_ID 0x5A65 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER CannonKeys #define PRODUCT Savage65 #define DESCRIPTION Savage65 Keyboard diff --git a/keyboards/cannonkeys/tmov2/config.h b/keyboards/cannonkeys/tmov2/config.h index e6d2afbbf53..d8d95ae5524 100644 --- a/keyboards/cannonkeys/tmov2/config.h +++ b/keyboards/cannonkeys/tmov2/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xCA04 #define PRODUCT_ID 0x70F2 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER CannonKeys #define PRODUCT TMOv2 #define DESCRIPTION TMOv2 Keyboard diff --git a/keyboards/handwired/bluepill/bluepill70/config.h b/keyboards/handwired/bluepill/bluepill70/config.h index 87fd74633f8..ae00a470aa2 100644 --- a/keyboards/handwired/bluepill/bluepill70/config.h +++ b/keyboards/handwired/bluepill/bluepill70/config.h @@ -4,14 +4,10 @@ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6464 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c works */ // Modified by Xydane #define MANUFACTURER "QMK" -#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' #define PRODUCT "BluePill70" -#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00' #define DESCRIPTION "QMK keyboard firmware with ChibiOS" /* key matrix size */ @@ -22,4 +18,4 @@ // Iso fix for Space Cadet, comment for ANSI layouts #define LSPO_KEY KC_8 -#define RSPC_KEY KC_9 \ No newline at end of file +#define RSPC_KEY KC_9 diff --git a/keyboards/handwired/ck4x4/config.h b/keyboards/handwired/ck4x4/config.h index 4ee5e8f4a83..3f353affb88 100644 --- a/keyboards/handwired/ck4x4/config.h +++ b/keyboards/handwired/ck4x4/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6464 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER QMK #define PRODUCT CK4x4 #define DESCRIPTION Cannon Keys 4x4 MacroPad diff --git a/keyboards/hid_liber/config.h b/keyboards/hid_liber/config.h index c21307e1a2c..a94daff2944 100755 --- a/keyboards/hid_liber/config.h +++ b/keyboards/hid_liber/config.h @@ -25,9 +25,7 @@ #define PRODUCT_ID 0xB919 #define DEVICE_VER 0x0001 #define MANUFACTURER "bpiphany" -#define USBSTR_MANUFACTURER 'b', '\x00', 'p', '\x00', 'i', '\x00', 'p', '\x00', 'h', '\x00', 'a', '\x00', 'n', '\x00', 'y', '\x00' #define PRODUCT "HIDLiberation" -#define USBSTR_PRODUCT 'H', '\x00', 'I', '\x00', 'D', '\x00', ' ', '\x00', 'L', '\x00', 'i', '\x00', 'b', '\x00', 'e', '\x00', 'r', '\x00', 'a', '\x00', 't', '\x00', 'i', '\x00', 'o', '\x00', 'n', '\x00' #define DESCRIPTION "HID Liberation powered by QMK" /* key matrix size */ diff --git a/keyboards/jm60/config.h b/keyboards/jm60/config.h index 0d2d0730e79..f490037f6ed 100644 --- a/keyboards/jm60/config.h +++ b/keyboards/jm60/config.h @@ -22,8 +22,6 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6464 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER JMWS #define PRODUCT JM60 RGB Keyboard(QMK) #define DESCRIPTION QMK keyboard firmware for JM60 RGB Keyboard diff --git a/keyboards/k_type/config.h b/keyboards/k_type/config.h index a841a571073..86b08769d1d 100644 --- a/keyboards/k_type/config.h +++ b/keyboards/k_type/config.h @@ -22,8 +22,6 @@ along with this program. If not, see . #define VENDOR_ID 0x1c11 #define PRODUCT_ID 0xb04d #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER Input Club #define PRODUCT K-Type/QMK /* key matrix size */ diff --git a/keyboards/projectkb/alice/config.h b/keyboards/projectkb/alice/config.h index 94c1fd16d6a..ed54af23945 100644 --- a/keyboards/projectkb/alice/config.h +++ b/keyboards/projectkb/alice/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0x0159 #define PRODUCT_ID 0xA71C #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER ProjectKB #define PRODUCT Alice #define DESCRIPTION ProjectKB Alice diff --git a/keyboards/wete/config.h b/keyboards/wete/config.h index c8d66b7a6ee..2440d147f5e 100644 --- a/keyboards/wete/config.h +++ b/keyboards/wete/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xB16B #define PRODUCT_ID 0x00B5 #define DEVICE_VER 0x0012 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER Ramon Imbao #define PRODUCT Wete #define DESCRIPTION Southpaw Full-sized Keyboard diff --git a/keyboards/xiaomi/mk02/config.h b/keyboards/xiaomi/mk02/config.h index 14ce3875b14..785f44097fa 100644 --- a/keyboards/xiaomi/mk02/config.h +++ b/keyboards/xiaomi/mk02/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0B91 #define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ #define MANUFACTURER Xiaomi #define PRODUCT MK02 #define DESCRIPTION Yuemi Pro MK02 From 53ac4d214f2c153e745cfe3d64f3e8d2ff1422e9 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 3 Mar 2020 11:55:42 +1100 Subject: [PATCH 015/106] Update Hungarian keymap and add sendstring LUT (#8220) --- quantum/keymap_extras/keymap_hungarian.h | 280 +++++++++++-------- quantum/keymap_extras/sendstring_hungarian.h | 100 +++++++ 2 files changed, 267 insertions(+), 113 deletions(-) create mode 100644 quantum/keymap_extras/sendstring_hungarian.h diff --git a/quantum/keymap_extras/keymap_hungarian.h b/quantum/keymap_extras/keymap_hungarian.h index e92d1a3b181..d5c915d1583 100644 --- a/quantum/keymap_extras/keymap_hungarian.h +++ b/quantum/keymap_extras/keymap_hungarian.h @@ -14,123 +14,177 @@ * along with this program. If not, see . */ -#ifndef KEYMAP_HUNGARIAN -#define KEYMAP_HUNGARIAN +#pragma once #include "keymap.h" -// basic letters -#define HU_Z KC_Y -#define HU_Y KC_Z +// clang-format off -#define HU_A KC_A -#define HU_B KC_B -#define HU_C KC_C -#define HU_D KC_D -#define HU_E KC_E -#define HU_F KC_F -#define HU_G KC_G -#define HU_H KC_H -#define HU_I KC_I -#define HU_J KC_J -#define HU_K KC_K -#define HU_L KC_L -#define HU_M KC_M -#define HU_N KC_N -#define HU_O KC_O -#define HU_P KC_P -#define HU_Q KC_Q -#define HU_R KC_R -#define HU_S KC_S -#define HU_T KC_T -#define HU_U KC_U -#define HU_V KC_V -#define HU_W KC_W -#define HU_X KC_X +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ Ö │ Ü │ Ó │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Ő │ Ú │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │ A │ S │ D │ F │ G │ H │ J │ K │ L │ É │ Á │ Ű │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ Í │ Y │ X │ C │ V │ B │ N │ M │ , │ . │ - │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define HU_0 KC_GRV // 0 +#define HU_1 KC_1 // 1 +#define HU_2 KC_2 // 2 +#define HU_3 KC_3 // 3 +#define HU_4 KC_4 // 4 +#define HU_5 KC_5 // 5 +#define HU_6 KC_6 // 6 +#define HU_7 KC_7 // 7 +#define HU_8 KC_8 // 8 +#define HU_9 KC_9 // 9 +#define HU_ODIA KC_0 // Ö +#define HU_UDIA KC_MINS // Ü +#define HU_OACU KC_EQL // Ó +// Row 2 +#define HU_Q KC_Q // Q +#define HU_W KC_W // W +#define HU_E KC_E // E +#define HU_R KC_R // R +#define HU_T KC_T // T +#define HU_Z KC_Y // Z +#define HU_U KC_U // U +#define HU_I KC_I // I +#define HU_O KC_O // O +#define HU_P KC_P // P +#define HU_ODAC KC_LBRC // Ő +#define HU_UACU KC_RBRC // Ú +// Row 3 +#define HU_A KC_A // A +#define HU_S KC_S // S +#define HU_D KC_D // D +#define HU_F KC_F // F +#define HU_G KC_G // G +#define HU_H KC_H // H +#define HU_J KC_J // J +#define HU_K KC_K // K +#define HU_L KC_L // L +#define HU_EACU KC_SCLN // É +#define HU_AACU KC_QUOT // Á +#define HU_UDAC KC_NUHS // Ű +// Row 4 +#define HU_IACU KC_NUBS // Í +#define HU_Y KC_Z // Y +#define HU_X KC_X // X +#define HU_C KC_C // C +#define HU_V KC_V // V +#define HU_B KC_B // B +#define HU_N KC_N // N +#define HU_M KC_M // M +#define HU_COMM KC_COMM // , +#define HU_DOT KC_DOT // . +#define HU_MINS KC_SLSH // - -// num row -#define HU_0 KC_GRV -#define HU_1 KC_1 -#define HU_2 KC_2 -#define HU_3 KC_3 -#define HU_4 KC_4 -#define HU_5 KC_5 -#define HU_6 KC_6 -#define HU_7 KC_7 -#define HU_8 KC_8 -#define HU_9 KC_9 -#define HU_OE KC_0 +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ § │ ' │ " │ + │ ! │ % │ / │ = │ ( │ ) │   │   │   │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │   │   │   │   │   │   │   │   │   │   │   │   │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │   │   │   │   │   │   │   │   │   │   │   │   │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │   │   │   │   │   │   │   │   │ ? │ : │ _ │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define HU_SECT S(HU_0) // § +#define HU_QUOT S(HU_1) // ' +#define HU_DQUO S(HU_2) // " +#define HU_PLUS S(HU_3) // + +#define HU_EXLM S(HU_4) // ! +#define HU_PERC S(HU_5) // % +#define HU_SLSH S(HU_6) // / +#define HU_EQL S(HU_7) // = +#define HU_LPRN S(HU_8) // ( +#define HU_RPRN S(HU_9) // ) +// Row 4 +#define HU_QUES S(HU_COMM) // ? +#define HU_COLN S(HU_DOT) // : +#define HU_UNDS S(HU_MINS) // _ -#define HU_UE KC_MINS -#define HU_OO KC_EQL +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │   │ ~ │ ˇ │ ^ │ ˘ │ ° │ ˛ │ ` │ ˙ │ ´ │ ˝ │ ¨ │ ¸ │       │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │     │ \ │ | │ Ä │   │   │   │ € │   │   │   │ ÷ │ × │     │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐    │ + * │      │ ä │ đ │ Đ │ [ │ ] │   │   │ ł │ Ł │ $ │ ß │ ¤ │    │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │    │ < │ > │ # │ & │ @ │ { │ } │   │ ; │   │ * │          │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │    │    │    │                        │    │    │    │    │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define HU_TILD ALGR(HU_1) // ~ +#define HU_CARN ALGR(HU_2) // ˇ (dead) +#define HU_CIRC ALGR(HU_3) // ^ (dead) +#define HU_BREV ALGR(HU_4) // ˘ (dead) +#define HU_RNGA ALGR(HU_5) // ° (dead) +#define HU_OGON ALGR(HU_6) // ˛ (dead) +#define HU_GRV ALGR(HU_7) // ` +#define HU_DOTA ALGR(HU_8) // ˙ (dead) +#define HU_ACUT ALGR(HU_9) // ´ (dead) +#define HU_DACU ALGR(HU_ODIA) // ˝ (dead) +#define HU_DIAE ALGR(HU_UDIA) // ¨ (dead) +#define HU_CEDL ALGR(HU_OACU) // ¸ (dead) +// Row 2 +#define HU_BSLS ALGR(HU_Q) // (backslash) +#define HU_PIPE ALGR(HU_W) // | +#define HU_CADI ALGR(HU_E) // Ä +#define HU_EURO ALGR(HU_U) // € +#define HU_DIV ALGR(HU_ODAC) // ÷ +#define HU_MUL ALGR(HU_UACU) // × +// Row 3 +#define HU_LADI ALGR(HU_A) // ä +#define HU_LDST ALGR(HU_S) // đ +#define HU_CDST ALGR(HU_D) // Đ +#define HU_LBRC ALGR(HU_F) // [ +#define HU_RBRC ALGR(HU_G) // ] +#define HU_LLST ALGR(HU_K) // ł +#define HU_CLST ALGR(HU_L) // Ł +#define HU_DLR ALGR(HU_EACU) // $ +#define HU_SS ALGR(HU_AACU) // ß +#define HU_CURR ALGR(HU_UDAC) // ¤ +// Row 4 +#define HU_LABK ALGR(HU_IACU) // < +#define HU_RABK ALGR(HU_Y) // > +#define HU_HASH ALGR(HU_X) // # +#define HU_AMPR ALGR(HU_C) // & +#define HU_AT ALGR(HU_V) // @ +#define HU_LCBR ALGR(HU_B) // { +#define HU_RCBR ALGR(HU_N) // } +#define HU_SCLN ALGR(HU_COMM) // ; +#define HU_ASTR ALGR(HU_MINS) // * -// q row -#define HU_OEE KC_LBRC -#define HU_UU KC_RBRC - -// a row -#define HU_EE KC_SCLN -#define HU_AA KC_QUOT -#define HU_UEE KC_NUHS - -#define HU_MINS KC_SLSH // - - -#define HU_DOT KC_DOT -#define HU_COMM KC_COMM - -// shifted characters -// num row -#define HU_PARA LSFT(HU_0) // § -#define HU_QUOT LSFT(HU_1) // ' -#define HU_DQOT LSFT(HU_2) // " -#define HU_PLUS LSFT(HU_3) // + -#define HU_EXLM LSFT(HU_4) // ! -#define HU_PERC LSFT(HU_5) // % -#define HU_SLSH LSFT(HU_6) // / -#define HU_EQL LSFT(HU_7) // = -#define HU_LPRN LSFT(HU_8) // ( -#define HU_RPRN LSFT(HU_9) // ) - -// í,y row -#define HU_II KC_NUBS -#define HU_QST LSFT(HU_COMM) // ? -#define HU_COLN LSFT(HU_DOT) // : -#define HU_UNDS LSFT(HU_MINS) // _ - -// Alt Gr'd characters -// num row -#define HU_TILD ALGR(HU_1) // ~ -//#define HU_?? ALGR(HU_2) // ˇ (proper name?) -#define HU_CIRC ALGR(HU_3) // ^ -#define HU_BRV ALGR(HU_4) // ˘ -#define HU_RING ALGR(HU_5) // ° -//#define HU_?? ALGR(HU_6) // ˛ (proper name?) -#define HU_GRV ALGR(HU_7) // ` -//#define HU_?? ALGR(HU_8) // ˙ (proper name?) -#define HU_ACUT ALGR(HU_9) // ´ - -// q row -#define HU_BSLS ALGR(HU_Q) // \ backslash -#define HU_PIPE ALGR(HU_W) // | -#define HU_DIV ALGR(HU_OEE) // ÷ -#define HU_CRSS ALGR(HU_UU) // × -#define HU_EURO ALGR(HU_U) // € - -// a row -#define HU_LBRC ALGR(HU_F) // [ -#define HU_RBRC ALGR(HU_G) // ] -#define HU_DLR ALGR(HU_EE) // $ -#define HU_SS ALGR(HU_AA) // ß - -// í,y row -#define HU_LESS ALGR(KC_NUBS) // < -#define HU_MORE ALGR(HU_Y) // > -#define HU_HASH ALGR(HU_X) // # -#define HU_AMPR ALGR(HU_C) // & -#define HU_AT ALGR(HU_V) // @ -#define HU_LCBR ALGR(HU_B) // { -#define HU_RCBR ALGR(HU_N) // } -#define HU_SCLN ALGR(HU_COMM) // ; -#define HU_ASTR ALGR(HU_MINS) // * - -#endif +// DEPRECATED +#define HU_OE HU_ODIA +#define HU_UE HU_UDIA +#define HU_OO HU_OACU +#define HU_OEE HU_ODAC +#define HU_UU HU_UACU +#define HU_EE HU_EACU +#define HU_AA HU_AACU +#define HU_UEE HU_UDAC +#define HU_II HU_IACU +#define HU_PARA HU_SECT +#define HU_DQOT HU_DQUO +#define HU_QST HU_QUES +#define HU_BRV HU_BREV +#define HU_RING HU_RNGA +#define HU_CRSS HU_MUL +#define HU_LESS HU_LABK +#define HU_MORE HU_RABK diff --git a/quantum/keymap_extras/sendstring_hungarian.h b/quantum/keymap_extras/sendstring_hungarian.h new file mode 100644 index 00000000000..29dc3ccb8c0 --- /dev/null +++ b/quantum/keymap_extras/sendstring_hungarian.h @@ -0,0 +1,100 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Sendstring lookup tables for Hungarian layouts + +#pragma once + +#include "keymap_hungarian.h" +#include "quantum.h" + +// clang-format off + +const uint8_t ascii_to_shift_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 1, 1, 0, 0, 1, 0, 1), + KCLUT_ENTRY(1, 1, 0, 1, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 1, 0, 0, 1, 0, 1), + KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1), + KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0) +}; + +const uint8_t ascii_to_altgr_lut[16] PROGMEM = { + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + + KCLUT_ENTRY(0, 0, 0, 1, 1, 0, 1, 0), + KCLUT_ENTRY(0, 0, 1, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 0, 1, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0), + KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0), + KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0) +}; + +const uint8_t ascii_to_keycode_lut[128] PROGMEM = { + // NUL SOH STX ETX EOT ENQ ACK BEL + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // BS TAB LF VT FF CR SO SI + KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // DLE DC1 DC2 DC3 DC4 NAK SYN ETB + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + // CAN EM SUB ESC FS GS RS US + XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // ! " # $ % & ' + KC_SPC, HU_4, HU_2, HU_X, HU_EACU, HU_5, HU_C, HU_1, + // ( ) * + , - . / + HU_8, HU_9, HU_MINS, HU_3, HU_COMM, HU_MINS, HU_DOT, HU_6, + // 0 1 2 3 4 5 6 7 + HU_0, HU_1, HU_2, HU_3, HU_4, HU_5, HU_6, HU_7, + // 8 9 : ; < = > ? + HU_8, HU_9, HU_DOT, HU_COMM, HU_M, HU_7, HU_DOT, HU_COMM, + // @ A B C D E F G + HU_V, HU_A, HU_B, HU_C, HU_D, HU_E, HU_F, HU_G, + // H I J K L M N O + HU_H, HU_I, HU_J, HU_K, HU_L, HU_M, HU_N, HU_O, + // P Q R S T U V W + HU_P, HU_Q, HU_R, HU_S, HU_T, HU_U, HU_V, HU_W, + // X Y Z [ \ ] ^ _ + HU_X, HU_Y, HU_Z, HU_F, HU_Q, HU_G, HU_3, HU_MINS, + // ` a b c d e f g + HU_7, HU_A, HU_B, HU_C, HU_D, HU_E, HU_F, HU_G, + // h i j k l m n o + HU_H, HU_I, HU_J, HU_K, HU_L, HU_M, HU_N, HU_O, + // p q r s t u v w + HU_P, HU_Q, HU_R, HU_S, HU_T, HU_U, HU_V, HU_W, + // x y z { | } ~ DEL + HU_X, HU_Y, HU_Z, HU_B, HU_W, HU_N, HU_1, KC_DEL +}; From acaecb4f94e3f1dc45cce53b10d1b89052b25ca7 Mon Sep 17 00:00:00 2001 From: shela Date: Wed, 4 Mar 2020 00:00:34 +0900 Subject: [PATCH 016/106] Fix bootloader definition for namecard2x4 (#8301) BOOTLOADER needs to be defined as caterina because namecard2x4 uses avrdude for flasher. --- keyboards/namecard2x4/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/namecard2x4/rules.mk b/keyboards/namecard2x4/rules.mk index 1b9e03d9712..8912698e584 100644 --- a/keyboards/namecard2x4/rules.mk +++ b/keyboards/namecard2x4/rules.mk @@ -9,7 +9,7 @@ MCU = atmega32u4 # QMK DFU qmk-dfu # ATmega32A bootloadHID # ATmega328P USBasp -BOOTLOADER = atmel-dfu +BOOTLOADER = caterina # Build Options # change yes to no to disable From ed6586e25bd854f445193566150439b25853f831 Mon Sep 17 00:00:00 2001 From: Alfred Maler Date: Tue, 3 Mar 2020 13:13:42 -0500 Subject: [PATCH 017/106] [Keymap] Feature/alfrdmalr/keymap update (#8174) * WIP do not merge * first pass at custom preonic layout * add auto shift and reset via leader key * Update readme * update copyright notice * formatting changes * fix: use MO instead of process_record_user * added backslash and moved grave position * remove extraneous 'j' characer in NUMPAD template * update template formatting * remove process_record_user * swap "!" with "@" * fix readme formatting * update readme layout image * restore settings layer * add windows minimize sequence * fix: switch to correct seq function for three-key sequence * fix: missing semicolon * refactor: move keymap to userspace and generic 5x12 layout * add numlock to numpad layer * add readme * update readme formatting * remove unused wrappers from layout keymap * update readme title to reflect new location * remove alfrdmalr directory from preonic/keymaps * add ortho 4x12 support * add 'trilayer' settings and update keymap * update SYMBOLS layer to SYMBOL * remove minimize sequence * clean up user config * add brightness controls * update settings ascii * moved some symbols around to make vim/linux smoother --- .../community/ortho_4x12/alfrdmalr/config.h | 5 + .../community/ortho_4x12/alfrdmalr/keymap.c | 44 +++++++++ .../community/ortho_4x12/alfrdmalr/rules.mk | 0 .../community/ortho_5x12/alfrdmalr/keymap.c | 4 +- users/alfrdmalr/alfrdmalr.c | 59 ++++++++++- users/alfrdmalr/alfrdmalr.h | 98 ++++++++++--------- users/alfrdmalr/readme.md | 23 +++-- 7 files changed, 171 insertions(+), 62 deletions(-) create mode 100644 layouts/community/ortho_4x12/alfrdmalr/config.h create mode 100644 layouts/community/ortho_4x12/alfrdmalr/keymap.c create mode 100644 layouts/community/ortho_4x12/alfrdmalr/rules.mk diff --git a/layouts/community/ortho_4x12/alfrdmalr/config.h b/layouts/community/ortho_4x12/alfrdmalr/config.h new file mode 100644 index 00000000000..58c9d57abc6 --- /dev/null +++ b/layouts/community/ortho_4x12/alfrdmalr/config.h @@ -0,0 +1,5 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(NO_SOUND) +#endif \ No newline at end of file diff --git a/layouts/community/ortho_4x12/alfrdmalr/keymap.c b/layouts/community/ortho_4x12/alfrdmalr/keymap.c new file mode 100644 index 00000000000..14b76339654 --- /dev/null +++ b/layouts/community/ortho_4x12/alfrdmalr/keymap.c @@ -0,0 +1,44 @@ +#include "alfrdmalr.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// QWERTY +[_QWERTY] = LAYOUT_ortho_4x12_wrapper( + K10, ____QWERTY_L1____, ____QWERTY_R1____, K1B, + K20, ____QWERTY_L2____, ____QWERTY_R2____, K2B, + K30, ____QWERTY_L3____, ____QWERTY_R3____, K3B, + K40, _____BASE_L4_____, _____BASE_R4_____, K4B +), + +// SYMBOL +[_SYMBOL] = LAYOUT_ortho_4x12_wrapper( + K10_SYM, ____SYMBOL_L1____, ____SYMBOL_R1____, K1B_SYM, + K20_SYM, ____SYMBOL_L2____, ____SYMBOL_R2____, K2B_SYM, + K30_SYM, ____SYMBOL_L3____, ____SYMBOL_R3____, K3B_SYM, + K40_SYM, ____SYMBOL_L4____, ____SYMBOL_R4____, K4B_SYM +), + +// NAVIGATION +[_NAVIGATION] = LAYOUT_ortho_4x12_wrapper( + K10_NAV, __NAVIGATION_L1__, __NAVIGATION_R1__, K1B_NAV, + K20_NAV, __NAVIGATION_L2__, __NAVIGATION_R2__, K2B_NAV, + K30_NAV, __NAVIGATION_L3__, __NAVIGATION_R3__, K3B_NAV, + K40_NAV, __NAVIGATION_L4__, __NAVIGATION_R4__, K4B_NAV +), + +// NUMPAD +[_NUMPAD] = LAYOUT_ortho_4x12_wrapper( + K10_NUM, ____NUMPAD_L1____, ____NUMPAD_R1____, K1B_NUM, + K20_NUM, ____NUMPAD_L2____, ____NUMPAD_R2____, K2B_NUM, + K30_NUM, ____NUMPAD_L3____, ____NUMPAD_R3____, K3B_NUM, + K40_NUM, ____NUMPAD_L4____, ____NUMPAD_R4____, K4B_NUM +), + +// SETTINGS +[_SETTINGS] = LAYOUT_ortho_4x12_wrapper( + K10_SET, ___SETTINGS_L1___, ___SETTINGS_R1___, K1B_SET, + K20_SET, ___SETTINGS_L2___, ___SETTINGS_R2___, K2B_SET, + K30_SET, ___SETTINGS_L3___, ___SETTINGS_R3___, K3B_SET, + K40_SET, ___SETTINGS_L4___, ___SETTINGS_R4___, K4B_SET +) +}; \ No newline at end of file diff --git a/layouts/community/ortho_4x12/alfrdmalr/rules.mk b/layouts/community/ortho_4x12/alfrdmalr/rules.mk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/layouts/community/ortho_5x12/alfrdmalr/keymap.c b/layouts/community/ortho_5x12/alfrdmalr/keymap.c index c140128d80d..2cd5105b217 100644 --- a/layouts/community/ortho_5x12/alfrdmalr/keymap.c +++ b/layouts/community/ortho_5x12/alfrdmalr/keymap.c @@ -11,8 +11,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { K40, _____BASE_L4_____, _____BASE_R4_____, K4B ), -// SYMBOLS -[_SYMBOLS] = LAYOUT_ortho_5x12_wrapper( +// SYMBOL +[_SYMBOL] = LAYOUT_ortho_5x12_wrapper( K00_SYM, ____NUMROW_L0____, ____NUMROW_R0____, K0B_SYM, K10_SYM, ____SYMBOL_L1____, ____SYMBOL_R1____, K1B_SYM, K20_SYM, ____SYMBOL_L2____, ____SYMBOL_R2____, K2B_SYM, diff --git a/users/alfrdmalr/alfrdmalr.c b/users/alfrdmalr/alfrdmalr.c index 39d2b62e003..18ce8bad7cb 100644 --- a/users/alfrdmalr/alfrdmalr.c +++ b/users/alfrdmalr/alfrdmalr.c @@ -35,10 +35,61 @@ void matrix_scan_user(void) { SEQ_FIVE_KEYS(KC_R, KC_E, KC_S, KC_E, KC_T) { reset_keyboard(); } - // minimize window (Windows) - SEQ_THREE_KEYS(KC_M, KC_I, KC_N) { - SEND_STRING(SS_LALT(" ")"n"); - } leader_end(); } +} + +bool syml_pressed = false; +bool symr_pressed = false; +bool settings_active = false; +bool symbols_active = false; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case SYML: + if (record->event.pressed) { + syml_pressed = true; + } else { + syml_pressed = false; + } + break; + case SYMR: + if (record->event.pressed) { + symr_pressed = true; + } else { + symr_pressed = false; + } + break; + } + + // trilayer-esque behavior. If both SYMBOL layer keys are held, then the + // settings layer is open. If only one is held, SYMBOL is active. + if (syml_pressed && symr_pressed) { + layer_on(_SETTINGS); + settings_active = true; + } else if (syml_pressed || symr_pressed) { + if (settings_active) { + layer_off(_SETTINGS); + settings_active = false; + } + layer_on(_SYMBOL); + symbols_active = true; + } else { + if (symbols_active) { + layer_off(_SYMBOL); + symbols_active = false; + } + } + + return true; +} + +// allow access to the settings layer to turn music mode back off +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case SYML: + case SYMR: + return false; + default: + return true; + } } \ No newline at end of file diff --git a/users/alfrdmalr/alfrdmalr.h b/users/alfrdmalr/alfrdmalr.h index 922b7ca4067..1989fb11a02 100644 --- a/users/alfrdmalr/alfrdmalr.h +++ b/users/alfrdmalr/alfrdmalr.h @@ -20,16 +20,24 @@ along with this program. If not, see . enum shared_layers { _QWERTY, - _SETTINGS, - _SYMBOLS, + _SYMBOL, _NAVIGATION, - _NUMPAD + _NUMPAD, + _SETTINGS }; // KEYCODES ============================================================================ + +// the SYML and SYMR keycodes are just used to activate the symbols layer. +// they're distinct so that I can hit both of them to activate a trilayer +enum alfrdmalr_keycodes { + SYML = SAFE_RANGE, + SYMR +}; + #define NUMSPACE LT(_NUMPAD, KC_SPC) #define NAVLAYER MO(_NAVIGATION) -#define SYMLAYER MO(_SYMBOLS) +#define SYMLAYER MO(_SYMBOL) #define SETLAYER MO(_SETTINGS) #define CTRLSHFT C(KC_LSFT) #define WINUNDO C(KC_Z) @@ -42,10 +50,12 @@ enum shared_layers { #define K41 CTRLSHFT #define K42 KC_LGUI #define K43 KC_LALT -#define K44 SYMLAYER +// #define K44 SYMLAYER +#define K44 SYML #define K45 NUMSPACE #define K46 NUMSPACE -#define K47 SYMLAYER +// #define K47 SYMLAYER +#define K47 SYMR #define K48 KC_RALT #define K49 SETLAYER #define K4A MU_TOG @@ -86,7 +96,7 @@ enum shared_layers { * ,-----------------------------------------------------------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TAB | Q | W | E | R | T | Y | U | I | O | P | DEL | + * | TAB | Q | W | E | R | T | Y | U | I | O | P | BKSP | * |------+------+------+------+------+------+------+------+------+------+------+------| * | NAV | A | S | D | F | G | H | J | K | L | ; | " | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -110,13 +120,13 @@ enum shared_layers { /* NUMPAD ============================================================================== * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | TRNS | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | F9 | F10 | F11 | F12 | | NLCK | 7 | 8 | 9 | - | DEL | + * | TRNS | F9 | F10 | F11 | F12 | | NLCK | 7 | 8 | 9 | - | TRNS | * |------+------+------+------+------+------+------+------+------+------+------+------| * | ESC | F5 | F6 | F7 | F8 | SPC | SPC | 4 | 5 | 6 | + | ENTR | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | F1 | F2 | F3 | F4 | ALT | CAPS | 1 | 2 | 3 | / | TRNS | + * | TRNS | F1 | F2 | F3 | F4 | ALT | | 1 | 2 | 3 | / | TRNS | * |------+------+------+------+------+------+------+------+------+------+------+------| * | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | 0 | , | . | * | TRNS | * `-----------------------------------------------------------------------------------' @@ -140,7 +150,7 @@ enum shared_layers { // - CORE #define ____NUMPAD_R1____ KC_NLCK, KC_7, KC_8, KC_9, KC_MINS #define ____NUMPAD_R2____ KC_SPC, KC_4, KC_5, KC_6, KC_PLUS -#define ____NUMPAD_R3____ KC_CAPS, KC_1, KC_2, KC_3, KC_SLSH +#define ____NUMPAD_R3____ KC_NO, KC_1, KC_2, KC_3, KC_SLSH // - MODS #define ____NUMPAD_R4____ KC_TRNS, KC_0, KC_COMM, KC_DOT, KC_ASTR @@ -150,15 +160,15 @@ enum shared_layers { #define K3B_NUM KC_TRNS #define K4B_NUM KC_TRNS -/* SYMBOLS ============================================================================= +/* SYMBOL ============================================================================== * ,-----------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP | + * | TRNS | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | TRNS | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | # | $ | { | } | | | ^ | * | | | ~ | TRNS | + * | TRNS | ! | @ | { | } | | | ^ | $ | & | | | DEL | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | < | > | ( | ) | | | - | + | & | \ | ` | + * | TRNS | < | > | ( | ) | | | - | + | = | \ | ` | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | ! | @ | [ | ] | | | _ | = | % | / | SHFT | + * | TRNS | ~ | # | [ | ] | | | _ | * | % | / | TRNS | * |------+------+------+------+------+------+------+------+------+------+------+------| * | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | * `-----------------------------------------------------------------------------------' @@ -166,9 +176,9 @@ enum shared_layers { // LEFT // - CORE -#define ____SYMBOL_L1____ KC_HASH, KC_DOLLAR, KC_LCBR, KC_RCBR, KC_NO -#define ____SYMBOL_L2____ KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_NO -#define ____SYMBOL_L3____ KC_EXCLAIM, KC_AT, KC_LBRC, KC_RBRC, KC_NO +#define ____SYMBOL_L1____ KC_EXCLAIM, KC_AT, KC_LCBR, KC_RCBR, KC_NO +#define ____SYMBOL_L2____ KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_NO +#define ____SYMBOL_L3____ KC_TILD, KC_HASH, KC_LBRC, KC_RBRC, KC_NO // - MODS #define ____SYMBOL_L4____ ______TRANS______ @@ -180,27 +190,27 @@ enum shared_layers { // RIGHT // - CORE -#define ____SYMBOL_R1____ KC_NO, KC_CIRC, KC_ASTR, KC_PIPE, KC_TILD -#define ____SYMBOL_R2____ KC_NO, KC_MINS, KC_PLUS, KC_AMPR, KC_BSLS -#define ____SYMBOL_R3____ KC_NO, KC_UNDS, KC_EQL, KC_PERC, KC_SLSH +#define ____SYMBOL_R1____ KC_NO, KC_CIRC, KC_DOLLAR, KC_AMPR, KC_PIPE +#define ____SYMBOL_R2____ KC_NO, KC_MINS, KC_PLUS, KC_EQL, KC_BSLS +#define ____SYMBOL_R3____ KC_NO, KC_UNDS, KC_ASTR, KC_PERC, KC_SLSH // - MODS #define ____SYMBOL_R4____ ______TRANS______ #define K0B_SYM KC_TRNS -#define K1B_SYM KC_TRNS +#define K1B_SYM KC_DEL #define K2B_SYM KC_GRV #define K3B_SYM KC_TRNS #define K4B_SYM KC_TRNS /* NAVIGATION ========================================================================== * ,-----------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP | + * | TRNS | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | TRNS | * |------+------+------+------+------+------+------+------+------+------+------+------| * | TRNS | | | SPC | F5 | | INS | HOME | END | TAB | DEL | TRNS | * |------+------+------+------+------+------+------+------+------+------+------+------| * | TRNS | SHFT | CTRl | ALT | GUI | | LEFT | DOWN | UP | RGHT | | ENTR | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | TRNS | UNDO | CUT | COPY | PSTE | | SPC | PGDO | PGUP | | | TRNS | + * | TRNS | UNDO | CUT | COPY | PSTE | | | PGDO | PGUP | CAPS | | TRNS | * |------+------+------+------+------+------+------+------+------+------+------+------| * | TRNS | TRNS | TRNS | TRNS | TRNS | ESC | TRNS | TRNS | TRNS | TRNS | TRNS | * `-----------------------------------------------------------------------------------' @@ -213,7 +223,7 @@ enum shared_layers { #define __NAVIGATION_L3__ WINUNDO, WINCUT, WINCOPY, WINPASTE, KC_NO // - MODS -#define __NAVIGATION_L4__ _______, _______, _______, _______, KC_ESC +#define __NAVIGATION_L4__ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_ESC #define K00_NAV KC_TRNS #define K10_NAV KC_TRNS #define K20_NAV KC_TRNS @@ -224,10 +234,10 @@ enum shared_layers { // - CORE #define __NAVIGATION_R1__ KC_INS, KC_HOME, KC_END, KC_TAB, KC_DEL #define __NAVIGATION_R2__ KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO -#define __NAVIGATION_R3__ KC_SPC, KC_PGDN, KC_PGUP, KC_NO, KC_NO +#define __NAVIGATION_R3__ KC_NO, KC_PGDN, KC_PGUP, KC_CAPS, KC_NO // - MODS -#define __NAVIGATION_R4__ KC_ESC, _______, _______, _______, _______ +#define __NAVIGATION_R4__ KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS #define K0B_NAV KC_TRNS #define K1B_NAV KC_TRNS #define K2B_NAV KC_ENT @@ -236,41 +246,41 @@ enum shared_layers { /* SETTINGS ============================================================================ * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | BRID | BRIU | | + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | DBUG | | | | | | | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|AudOff|AGnorm|AGswap| | | | | | + * | | | | | | | MPRV | MPLY | MUTE | MNXT | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | ASTG |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * | ASTG | MUTO | AUOF | AUON | | | | VOLD | VOLU | | | ASTG | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | + * | | | | | TRNS | | TRNS | | | | | * `-----------------------------------------------------------------------------------' */ // LEFT // - CORE -#define ___SETTINGS_L1___ _______, DEBUG, _______, _______, _______ -#define ___SETTINGS_L2___ _______, MU_MOD, AU_ON, AU_OFF, AG_NORM -#define ___SETTINGS_L3___ MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON +#define ___SETTINGS_L1___ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define ___SETTINGS_L2___ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define ___SETTINGS_L3___ MU_TOG, AU_OFF, AU_ON, KC_NO, KC_NO // - MODS -#define ___SETTINGS_L4___ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define ___SETTINGS_L4___ KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO #define K00_SET KC_NO #define K10_SET KC_NO #define K20_SET KC_NO #define K30_SET KC_ASTG #define K40_SET KC_NO -// RIGHT +// RIGHT // - CORE -#define ___SETTINGS_R1___ TERM_ON, TERM_OFF, _______, _______, _______ -#define ___SETTINGS_R2___ _______, _______, _______, _______, _______ -#define ___SETTINGS_R3___ _______, _______, _______, _______, _______ +#define ___SETTINGS_R1___ KC_NO, KC_NO, KC_NO, KC_BRID, KC_BRIU +#define ___SETTINGS_R2___ KC_MPRV, KC_MPLY, KC_MUTE, KC_MNXT, KC_NO +#define ___SETTINGS_R3___ KC_NO, KC_VOLD, KC_VOLU, KC_NO, KC_NO // - MODS -#define ___SETTINGS_R4___ KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO +#define ___SETTINGS_R4___ KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO #define K0B_SET KC_NO #define K1B_SET KC_NO #define K2B_SET KC_NO -#define K3B_SET KC_NO -#define K4B_SET KC_NO \ No newline at end of file +#define K3B_SET KC_ASTG +#define K4B_SET KC_NO diff --git a/users/alfrdmalr/readme.md b/users/alfrdmalr/readme.md index d462a5baf17..9e5f962bbb6 100644 --- a/users/alfrdmalr/readme.md +++ b/users/alfrdmalr/readme.md @@ -1,6 +1,6 @@ # alfrdmalr's userspace ## Overview -The alphanumeric characters and symbols are spread between three main 'typing' layers: REGULAR, NUMPAD, and SYMBOLS. +The alphanumeric characters and symbols are spread between three main 'typing' layers: REGULAR, NUMPAD, and SYMBOL. A fourth layer, NAVIGATION, contains useful modifiers, shortcuts, and navigation functions like the arrow keys and page up/down. This layer also provides access to the `ENTER` and `ESC` keys. @@ -22,26 +22,25 @@ The NUMPAD layer puts a numpad under the right hand, surrounding the home row po This layer also holds the first twelve function keys. -#### SYMBOLS -This layer holds all the symbols that are not accessible from the REGULAR layer. There is some redundancy (for instance, `/` exists in both the REGULAR and SYMBOLS layer; its position, however, remains consistent) but with the exception of single and double quotes, all symbols are available from this layer. +#### SYMBOL +This layer holds all the symbols that are not accessible from the REGULAR layer. There is some redundancy (for instance, `/` exists in both the REGULAR and SYMBOL layer; its position, however, remains consistent) but with the exception of single and double quotes, all symbols are available from this layer. #### NAVIGATION -The primary function of this layer is to provide arrow keys under hjkl. The surrounding keys contain similar functionality - for instance, the keys directly below `DOWN` and `UP` are `PAGEDOWN` and `PAGEUP`, respectively. `HOME` and `END` are inverted from this convention, simply because I kept hitting the wrong key when trying to jump to the beginning/end of lines when editing text. +Over time, this layer has become a general utility layer, though its primary function of is still to provide arrow keys under hjkl. The surrounding keys contain similar functionality - for instance, the keys directly below `DOWN` and `UP` are `PAGEDOWN` and `PAGEUP`, respectively. `HOME` and `END` are inverted from this convention, simply because I kept hitting the wrong key when trying to jump to the beginning/end of lines when editing text. To the immediate right of the NAVIGATION layer key are the following modifiers: `SHIFT`, `CONTROL`, `ALT`, `GUI`. All modifiers are the "left" variants. The idea is to use the left hand to hold different modifiers as necessary while using the right hand to navigate and format. -`ESCAPE` is located on the spacebar from this layer, and `DELETE` is placed next to `BACKSPACE`, for convenience when formatting text. There are also four Windows shortcuts for undo, cut, copy, and paste, located in the same position as the relevant keys on the base layer (undo, for example, is in the same place as the `Z` key). +`ESCAPE` is located on the spacebar from this layer, and `DELETE` is placed next to `BACKSPACE`, for convenience when formatting text. There are also four Windows shortcuts for undo, cut, copy, and paste, located in the same position as the relevant keys on the base layer (undo, for example, is in the same place as the `Z` key). Again, this is for convenience when formatting text. #### SETTINGS -Right now, this is pretty similar to the default settings layer (the planck's ADJUST layer). +The SETTINGS layer can be accessed by pressing both SYMBOL layer keys at once. This is functionally the same as a trilayer, though because both keys are activating the same layer it doesn't actually use the trilayer feature. -Primary differences are the inclusion of an autoshift toggle and the removal of the reset button. The bootloader functionality has been moved to a leader key sequence: LEAD - R - E - S - E - T. +This layer contains things like feature toggles, media controls, and other infrequently-used options. ### Leader Key Sequences -A complete list of leader sequences can be found below: +A complete list of leader sequences can be found below. The LEAD key that begins each sequence has been omitted. -#### Reset -LEAD - R - E - S - E - T -#### Minimize (Windows) -LEAD - M - I - N +| Sequence | Function | +| :------: | -------------------------------- | +| R-E-S-E-T | Reset the keyboard into DFU mode | From ad96e995afc6a8132a054ccab2b08e3501719159 Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Tue, 3 Mar 2020 12:45:19 -0800 Subject: [PATCH 018/106] [Keymap] Add crd's equinox keymap (#8251) --- keyboards/ai03/equinox/keymaps/crd/keymap.c | 47 ++++++++++++++++++++ keyboards/ai03/equinox/keymaps/crd/readme.md | 3 ++ 2 files changed, 50 insertions(+) create mode 100644 keyboards/ai03/equinox/keymaps/crd/keymap.c create mode 100644 keyboards/ai03/equinox/keymaps/crd/readme.md diff --git a/keyboards/ai03/equinox/keymaps/crd/keymap.c b/keyboards/ai03/equinox/keymaps/crd/keymap.c new file mode 100644 index 00000000000..108a00d9d45 --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/crd/keymap.c @@ -0,0 +1,47 @@ +/* Copyright 2019 Ryota Goto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H +/* + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K304, K306, K308, K309, K310, K311 \ +*/ + +#define KC_CTES RCTL_T(KC_ESC) +#define KC_BSM1 LT(1, KC_BSPC) +#define KC_SPM1 LT(1, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_all( /* Base */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_GRV, + KC_CTES, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT, + KC_LSFT, KC_SLSH, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, + KC_LCTL, XXXXXXX, KC_RGUI, KC_BSM1, MO(2), KC_SPM1, KC_RALT, XXXXXXX, KC_RCTL + ), + [1] = LAYOUT_all( /* Extra Keys */ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, + _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT_all( /* Num and FN */ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_MINS, KC_EQL, _______, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, KC_SCLN, KC_QUOT, XXXXXXX, _______, + _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, + _______, XXXXXXX, _______, _______, _______, _______, _______, XXXXXXX, _______ + ) +}; diff --git a/keyboards/ai03/equinox/keymaps/crd/readme.md b/keyboards/ai03/equinox/keymaps/crd/readme.md new file mode 100644 index 00000000000..c1f50e5ebfb --- /dev/null +++ b/keyboards/ai03/equinox/keymaps/crd/readme.md @@ -0,0 +1,3 @@ +# crd's keymap for equinox + +[KLE](http://www.keyboard-layout-editor.com/#/gists/0be9c4a916dba80ebb5533cd00c5304c) From 910d603c657e4ad81a4e7a4c86a74e2e79aa1eaa Mon Sep 17 00:00:00 2001 From: Ibnu Daru Aji Date: Wed, 4 Mar 2020 04:46:11 +0700 Subject: [PATCH 019/106] [Keymap] new userspace for ibnuda (#8221) * to ease the maintenance for some boards ibnuda has. * followed ridingqwerty's suggestion on 8821. * folloing drashna's suggestion on qmk's 8221. * following drashn's suggestion on qmk's 8211 --- keyboards/atreus/keymaps/ibnuda/keymap.c | 283 +++--------------- keyboards/atreus/keymaps/ibnuda/rules.mk | 7 - .../4x5/keymaps/ibnuda/config.h | 32 ++ .../4x5/keymaps/ibnuda/keymap.c | 61 ++++ users/ibnuda/combo.c | 1 + users/ibnuda/combo.h | 61 ++++ .../atreus/keymaps => users}/ibnuda/config.h | 8 +- users/ibnuda/ibnuda.c | 1 + users/ibnuda/ibnuda.h | 55 ++++ users/ibnuda/readme.md | 14 + users/ibnuda/rules.mk | 14 + users/ibnuda/tapdance.c | 83 +++++ users/ibnuda/tapdance.h | 23 ++ users/ibnuda/wrapper.h | 46 +++ 14 files changed, 433 insertions(+), 256 deletions(-) delete mode 100644 keyboards/atreus/keymaps/ibnuda/rules.mk create mode 100644 keyboards/handwired/dactyl_manuform/4x5/keymaps/ibnuda/config.h create mode 100644 keyboards/handwired/dactyl_manuform/4x5/keymaps/ibnuda/keymap.c create mode 100644 users/ibnuda/combo.c create mode 100644 users/ibnuda/combo.h rename {keyboards/atreus/keymaps => users}/ibnuda/config.h (50%) create mode 100644 users/ibnuda/ibnuda.c create mode 100644 users/ibnuda/ibnuda.h create mode 100644 users/ibnuda/readme.md create mode 100644 users/ibnuda/rules.mk create mode 100644 users/ibnuda/tapdance.c create mode 100644 users/ibnuda/tapdance.h create mode 100644 users/ibnuda/wrapper.h diff --git a/keyboards/atreus/keymaps/ibnuda/keymap.c b/keyboards/atreus/keymaps/ibnuda/keymap.c index 3c1c0f45034..3bdfccad980 100644 --- a/keyboards/atreus/keymaps/ibnuda/keymap.c +++ b/keyboards/atreus/keymaps/ibnuda/keymap.c @@ -1,258 +1,47 @@ #include QMK_KEYBOARD_H -typedef enum { - SINGLE_TAP, - SINGLE_HOLD, - DOUBLE_TAP, -} td_state_t; +#include "ibnuda.h" -static td_state_t td_state; - -int current_dance(qk_tap_dance_state_t *state); - -void dance_tmb_finished(qk_tap_dance_state_t *state, void *user_data); -void dance_tmb_reset(qk_tap_dance_state_t *state, void *user_data); - -// enum for tap dances. -enum { - TD_DLT_CTLDLT = 0, - TD_SCLN_CLN, - TD_LEFT_THUMB, -}; - -// enum for combos. -enum combos { - // left hand combinations. - COLON_COMMA, - COMMA_DOT, - DOT_P, - Q_J, - J_K, - - // right hand combinations. - L_R, - R_C, - C_G, - V_W, - W_M, - - // both hands combinations. - DOT_C, - J_W, - P_G, - U_H, - K_M, -}; - -enum { - _BASE, - _LOWER, - _RAISE, - _ADJUST, - _MUIS -}; - -// thumb keys. -#define ALT_ENT ALT_T(KC_ENT) -#define SFT_ESC SFT_T(KC_ESC) - -// home row mods. -#define CT_O RCTL_T(KC_O) -#define CT_N RCTL_T(KC_N) -#define SH_A RSFT_T(KC_A) -#define SH_S RSFT_T(KC_S) -#define AL_E RALT_T(KC_E) -#define AL_T RALT_T(KC_T) -#define GU_I RGUI_T(KC_I) -#define GU_D RGUI_T(KC_D) - -// layer toggle. -#define LW_BSPC LT(_LOWER, KC_BSPC) -#define RS_SPC LT(_RAISE, KC_SPC) -#define RS_D LT(_RAISE, KC_D) -#define LW_I LT(_LOWER, KC_I) -#define MU_QUOT LT(_MUIS, KC_QUOT) -#define MU_Z LT(_MUIS, KC_Z) - -// idk, man. not used, i guess. -#define RAISE MO(_RAISE) -#define LOWER MO(_LOWER) -#define ADDDD MO(_ADJUST) -#define MUIS MO(_MUIS) - -// common shortcuts for windows and linux that i use. -#define NXTTAB LCTL(KC_PGDN) -#define PRVTAB LCTL(KC_PGUP) -#define UPTAB LCTL(LSFT(KC_PGUP)) -#define DNTAB LCTL(LSFT(KC_PGDN)) -#define NXTWIN LALT(KC_TAB) -#define PRVWIN LALT(LSFT(KC_TAB)) -#define CALDL LCTL(LALT(KC_DELT)) -#define TSKMGR LCTL(LSFT(KC_ESC)) -#define EXPLR LGUI(KC_E) -#define LCKGUI LGUI(KC_L) -#define CONPST LSFT(KC_INS) -#define CLSGUI LALT(KC_F4) - -// tap dances -#define CTL_DLT TD(TD_DLT_CTLDLT) -#define SM_CLN TD(TD_SCLN_CLN) -#define LFT_TMB TD(TD_LEFT_THUMB) - -// left hand combinations. -const uint16_t PROGMEM colon_comma_combo[] = {KC_SCLN, KC_COMM, COMBO_END}; -const uint16_t PROGMEM comma_dot_combo[] = {KC_COMM, KC_DOT, COMBO_END}; -const uint16_t PROGMEM dot_p_combo[] = {KC_DOT, KC_P, COMBO_END}; -const uint16_t PROGMEM q_j_combo[] = {KC_Q, KC_J, COMBO_END}; -const uint16_t PROGMEM j_k_combo[] = {KC_J, KC_K, COMBO_END}; - -// right hand combinations. -const uint16_t PROGMEM l_r_combo[] = {KC_L, KC_R, COMBO_END}; -const uint16_t PROGMEM r_c_combo[] = {KC_R, KC_C, COMBO_END}; -const uint16_t PROGMEM c_g_combo[] = {KC_C, KC_G, COMBO_END}; -const uint16_t PROGMEM v_w_combo[] = {KC_V, KC_W, COMBO_END}; -const uint16_t PROGMEM w_m_combo[] = {KC_W, KC_M, COMBO_END}; - -// both hand combinations. -const uint16_t PROGMEM dot_c_combo[] = {KC_DOT, KC_C, COMBO_END}; -const uint16_t PROGMEM j_w_combo[] = {KC_J, KC_W, COMBO_END}; -const uint16_t PROGMEM u_h_combo[] = {KC_U, KC_H, COMBO_END}; -const uint16_t PROGMEM p_g_combo[] = {KC_P, KC_G, COMBO_END}; -const uint16_t PROGMEM k_m_combo[] = {KC_K, KC_M, COMBO_END}; - -combo_t key_combos[COMBO_COUNT] = { - // left hand combinations. - [COLON_COMMA] = COMBO(colon_comma_combo, KC_TAB), - [COMMA_DOT] = COMBO(comma_dot_combo, KC_QUES), - [DOT_P] = COMBO(dot_p_combo, KC_UNDS), - [Q_J] = COMBO(q_j_combo, LCTL(KC_W)), - [J_K] = COMBO(j_k_combo, KC_DELT), - - // right hand combinations. - [L_R] = COMBO(l_r_combo, KC_BSPC), - [R_C] = COMBO(r_c_combo, KC_SLSH), - [C_G] = COMBO(c_g_combo, KC_MINS), - [V_W] = COMBO(v_w_combo, KC_APP), - [W_M] = COMBO(w_m_combo, KC_DELT), - - // both hand combinations. - [DOT_C] = COMBO(dot_c_combo, KC_PGUP), - [J_W] = COMBO(j_w_combo, KC_PGDN), - [U_H] = COMBO(u_h_combo, KC_ENT), - [P_G] = COMBO(p_g_combo, KC_HOME), - [K_M] = COMBO(k_m_combo, KC_END), -}; - -void dance_dlt_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code16(KC_DELT); - } else { - register_code16(C(KC_DELT)); - } -} - -void dance_dlt_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code16(KC_DELT); - } else { - unregister_code16(C(KC_DELT)); - } -} - -void dance_cln_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code(KC_LSFT); - } - register_code(KC_SCLN); -} - -void dance_cln_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code(KC_LSFT); - } - unregister_code(KC_SCLN); -} - -int current_dance(qk_tap_dance_state_t *state) { - if (state->count == 1) { - if (state->interrupted || !state->pressed) { - return SINGLE_TAP; - } else { - return SINGLE_HOLD; - } - } - if (state->count == 2) { - return DOUBLE_TAP; - } else { - return 3; - } -} - -void dance_tmb_finished(qk_tap_dance_state_t *state, void *user_data) { - td_state = current_dance(state); - switch (td_state) { - case SINGLE_TAP: - register_code16(KC_ESC); - break; - case SINGLE_HOLD: - register_mods(MOD_BIT(KC_LSFT)); - break; - case DOUBLE_TAP: - register_code16(KC_DELT); - break; - } -} - -void dance_tmb_reset(qk_tap_dance_state_t *state, void *user_data) { - switch (td_state) { - case SINGLE_TAP: - unregister_code16(KC_ESC); - break; - case SINGLE_HOLD: - unregister_mods(MOD_BIT(KC_LSFT)); - break; - case DOUBLE_TAP: - unregister_code16(KC_DELT); - break; - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_DLT_CTLDLT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_dlt_finished, dance_dlt_reset), - [TD_SCLN_CLN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, dance_cln_reset), - [TD_LEFT_THUMB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_tmb_finished, dance_tmb_reset), -}; +// clang-format off +#define LAYOUT_atreus_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + KTA, KTB, KTC, KTD \ + ) \ + LAYOUT_wrapper( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + ___, ___, ___, ___, KTA, KTB, KTC, KTD, ___, ___, ___, ___ \ + ) +#define LAYOUT_atreus_base_wrapper(...) LAYOUT_atreus_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_BASE] = LAYOUT( - SM_CLN, KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, - SH_A, CT_O, AL_E, KC_U, GU_I, GU_D, KC_H, AL_T, CT_N, SH_S, - MU_QUOT,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, MU_Z, - _______,_______,_______,_______,LW_BSPC,SFT_ESC, ALT_ENT,RS_SPC, _______,_______,_______,_______ +[_BASE] = LAYOUT_atreus_base_wrapper( + ________________DVORAK_L1_______________, ________________DVORAK_R1_______________, + ________________DVORAK_L2_______________, ________________DVORAK_R2_______________, + ________________DVORAK_L3_______________, ________________DVORAK_R3_______________, + LW_BSPC,SFT_ESC, ALT_ENT,RS_SPC ), -[_RAISE] = LAYOUT( - KC_EXLM,KC_AT, KC_UP, KC_LCBR,KC_RCBR, KC_BSLS,KC_7, KC_8, KC_9, KC_ASTR , - KC_HASH,KC_LEFT,KC_DOWN,KC_RGHT,KC_DLR, KC_EQL, KC_4, KC_5, KC_6, KC_TILD , - KC_LBRC,KC_RBRC,KC_LPRN,KC_RPRN,KC_AMPR, KC_GRV, KC_1, KC_2, KC_3, KC_PLUS , - _______,_______,_______,_______,ADDDD, _______, ALT_ENT,RS_SPC, _______,KC_0, _______,_______ +[_RAISE] = LAYOUT_atreus_base_wrapper( + ________________RAISE_L1________________, ________________RAISE_R1________________, + ________________RAISE_L2________________, ________________RAISE_R2________________, + ________________RAISE_L3________________, ________________RAISE_R3________________, + ADDDD, _______, _______,_______ ), -[_LOWER] = LAYOUT( - KC_ESC, KC_QUES,KC_UNDS,KC_F1, KC_F2, KC_F3, KC_F4, KC_MINS,KC_SLSH,KC_BSPC , - KC_LSFT,KC_TAB, KC_PGUP,KC_F5, KC_F6, KC_F7, KC_F8, KC_HOME,KC_LALT,KC_ENT , - KC_CLCK,KC_SLCK,KC_PGDN,KC_F9, KC_F10, KC_F11, KC_F12, KC_END, KC_INS, KC_SLSH , - _______,_______,_______,_______,ADDDD, _______, KC_DELT,ADDDD, _______,_______,_______,_______ +[_LOWER] = LAYOUT_atreus_base_wrapper( + ________________LOWER_L1________________, ________________LOWER_R1________________, + ________________LOWER_L2________________, ________________LOWER_R2________________, + ________________LOWER_L3________________, ________________LOWER_R3________________, + _______,_______, _______,ADDDD ), -[_ADJUST] = LAYOUT( - _______,EXPLR, KC_UP, PRVTAB, PRVWIN, NXTWIN, NXTTAB, _______,_______,LCKGUI, - TSKMGR, KC_LEFT,KC_DOWN,KC_RGHT,UPTAB, DNTAB, KC_ENT, KC_LGUI,_______,CALDL, - _______,CLSGUI, _______,CONPST, RESET, _______,_______,_______,_______,_______, - _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______ -), -[_MUIS] = LAYOUT( - _______,KC_BTN2,KC_MS_U,KC_BTN1,_______, _______,KC_BTN1,KC_MS_U,KC_BTN2,_______, - _______,KC_MS_L,KC_MS_D,KC_MS_R,_______, _______,KC_MS_L,KC_MS_D,KC_MS_R,_______, - _______,_______,KC_WH_D,KC_WH_U,_______, _______,KC_WH_U,KC_WH_D,_______,_______, - _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______ +[_ADJUST] = LAYOUT_atreus_base_wrapper( + ________________ADJUST_L1_______________, ________________ADJUST_R1_______________, + ________________ADJUST_L2_______________, ________________ADJUST_R2_______________, + ________________ADJUST_L3_______________, ________________ADJUST_R3_______________, + _______,_______, _______,_______ ), }; +// clang-format on diff --git a/keyboards/atreus/keymaps/ibnuda/rules.mk b/keyboards/atreus/keymaps/ibnuda/rules.mk deleted file mode 100644 index ce80219d1a5..00000000000 --- a/keyboards/atreus/keymaps/ibnuda/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Build Options -# change yes to no to disable -# - -MOUSEKEY_ENABLE = yes -COMBO_ENABLE = yes -TAP_DANCE_ENABLE = yes diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/ibnuda/config.h b/keyboards/handwired/dactyl_manuform/4x5/keymaps/ibnuda/config.h new file mode 100644 index 00000000000..07a1323db26 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/ibnuda/config.h @@ -0,0 +1,32 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/ibnuda/keymap.c b/keyboards/handwired/dactyl_manuform/4x5/keymaps/ibnuda/keymap.c new file mode 100644 index 00000000000..58a8c63aaf2 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/ibnuda/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +#include "ibnuda.h" + +#define TAB KC_TAB +#define GUI KC_LGUI +#define MIN KC_MINS +#define SLS KC_SLSH +#define CTL KC_LCTL +#define DEL KC_DELT +#define QUE KC_QUES +#define ___ KC_NO + +// clang-format off +#define LAYOUT_dm_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + KTA, KTB, KTC, KTD \ + ) \ + LAYOUT_wrapper( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + TAB, GUI, MIN, SLS, \ + KTA, KTB, KTC, KTD, \ + CTL, DEL, QUE, CTL, \ + ___, ___, ___, ___ \ + ) + +#define LAYOUT_dm_base_wrapper(...) LAYOUT_dm_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_BASE] = LAYOUT_dm_base_wrapper( + ________________DVORAK_L1_______________, ________________DVORAK_R1_______________, + ________________DVORAK_L2_______________, ________________DVORAK_R2_______________, + ________________DVORAK_L3_______________, ________________DVORAK_R3_______________, + LW_BSPC,SFT_ESC, ALT_ENT,RS_SPC +), + +[_RAISE] = LAYOUT_dm_base_wrapper( + ________________RAISE_L1________________, ________________RAISE_R1________________, + ________________RAISE_L2________________, ________________RAISE_R2________________, + ________________RAISE_L3________________, ________________RAISE_R3________________, + ADDDD, _______, _______,_______ +), +[_LOWER] = LAYOUT_dm_base_wrapper( + ________________LOWER_L1________________, ________________LOWER_R1________________, + ________________LOWER_L2________________, ________________LOWER_R2________________, + ________________LOWER_L3________________, ________________LOWER_R3________________, + _______,_______, _______,ADDDD +), +[_ADJUST] = LAYOUT_dm_base_wrapper( + ________________ADJUST_L1_______________, ________________ADJUST_R1_______________, + ________________ADJUST_L2_______________, ________________ADJUST_R2_______________, + ________________ADJUST_L3_______________, ________________ADJUST_R3_______________, + _______,_______, _______,_______ +), +}; +// clang-format on + diff --git a/users/ibnuda/combo.c b/users/ibnuda/combo.c new file mode 100644 index 00000000000..a48b0aae372 --- /dev/null +++ b/users/ibnuda/combo.c @@ -0,0 +1 @@ +#include "combo.h" diff --git a/users/ibnuda/combo.h b/users/ibnuda/combo.h new file mode 100644 index 00000000000..a9fa69d222c --- /dev/null +++ b/users/ibnuda/combo.h @@ -0,0 +1,61 @@ +#pragma once +#include "quantum.h" + +// enum for combos. +enum combos { + // left hand combinations. + COLON_COMMA, + COMMA_DOT, + DOT_P, + QUOT_Q, + Q_J, + J_K, + + // right hand combinations. + L_R, + R_C, + C_G, + V_W, + W_M, + + // both hands combinations. + J_W, +}; + +// left hand combinations. +const uint16_t PROGMEM colon_comma_combo[] = {KC_SCLN, KC_COMM, COMBO_END}; +const uint16_t PROGMEM comma_dot_combo[] = {KC_COMM, KC_DOT, COMBO_END}; +const uint16_t PROGMEM dot_p_combo[] = {KC_DOT, KC_P, COMBO_END}; +const uint16_t PROGMEM quot_q_combo[] = {KC_QUOT, KC_Q, COMBO_END}; +const uint16_t PROGMEM q_j_combo[] = {KC_Q, KC_J, COMBO_END}; +const uint16_t PROGMEM j_k_combo[] = {KC_J, KC_K, COMBO_END}; + +// right hand combinations. +const uint16_t PROGMEM l_r_combo[] = {KC_L, KC_R, COMBO_END}; +const uint16_t PROGMEM r_c_combo[] = {KC_R, KC_C, COMBO_END}; +const uint16_t PROGMEM c_g_combo[] = {KC_C, KC_G, COMBO_END}; +const uint16_t PROGMEM v_w_combo[] = {KC_V, KC_W, COMBO_END}; +const uint16_t PROGMEM w_m_combo[] = {KC_W, KC_M, COMBO_END}; + +// both hand combinations. +const uint16_t PROGMEM j_w_combo[] = {KC_J, KC_W, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + // left hand combinations. + [COLON_COMMA] = COMBO(colon_comma_combo, KC_TAB), + [COMMA_DOT] = COMBO(comma_dot_combo, KC_QUES), + [DOT_P] = COMBO(dot_p_combo, KC_UNDS), + [QUOT_Q] = COMBO(quot_q_combo, KC_ENT), + [Q_J] = COMBO(q_j_combo, LCTL(KC_W)), + [J_K] = COMBO(j_k_combo, KC_DELT), + + // right hand combinations. + [L_R] = COMBO(l_r_combo, KC_BSPC), + [R_C] = COMBO(r_c_combo, KC_SLSH), + [C_G] = COMBO(c_g_combo, KC_MINS), + [V_W] = COMBO(v_w_combo, KC_APP), + [W_M] = COMBO(w_m_combo, KC_DELT), + + // both hand combinations. + [J_W] = COMBO(j_w_combo, KC_ENT), +}; diff --git a/keyboards/atreus/keymaps/ibnuda/config.h b/users/ibnuda/config.h similarity index 50% rename from keyboards/atreus/keymaps/ibnuda/config.h rename to users/ibnuda/config.h index 625abe488fc..b43679a66ea 100644 --- a/keyboards/atreus/keymaps/ibnuda/config.h +++ b/users/ibnuda/config.h @@ -1,5 +1,9 @@ #pragma once -#define TAPPING_TERM 200 +#define COMBO_COUNT 18 +#define COMBO_TERM 100 + #define IGNORE_MOD_TAP_INTERRUPT -#define COMBO_COUNT 15 +#define PERMISSIVE_HOLD + +#define TAPPING_TERM 200 diff --git a/users/ibnuda/ibnuda.c b/users/ibnuda/ibnuda.c new file mode 100644 index 00000000000..8d5bd04ba03 --- /dev/null +++ b/users/ibnuda/ibnuda.c @@ -0,0 +1 @@ +#include "ibnuda.h" diff --git a/users/ibnuda/ibnuda.h b/users/ibnuda/ibnuda.h new file mode 100644 index 00000000000..f50949df564 --- /dev/null +++ b/users/ibnuda/ibnuda.h @@ -0,0 +1,55 @@ +#pragma once +#include "quantum.h" + +#include "tapdance.h" +#include "wrapper.h" +//#include "combo.h" + +enum { + _BASE, + _LOWER, + _RAISE, + _ADJUST, +}; + +// thumb keys. +#define ALT_ENT ALT_T(KC_ENT) +#define SFT_ESC SFT_T(KC_ESC) + +// home row mods. +#define CT_O LCTL_T(KC_O) +#define CT_N RCTL_T(KC_N) +#define SH_A LSFT_T(KC_A) +#define SH_S RSFT_T(KC_S) +#define AL_E LALT_T(KC_E) +#define AL_T RALT_T(KC_T) +#define GU_I LGUI_T(KC_I) +#define GU_D RGUI_T(KC_D) + +// layer toggle. +#define LW_I LT(_LOWER, KC_I) +#define LW_BSPC LT(_LOWER, KC_BSPC) +#define RS_SPC LT(_RAISE, KC_SPC) +#define RS_D LT(_RAISE, KC_D) + +// idk, man. not used, i guess. +#define ADDDD MO(_ADJUST) + +// common shortcuts for windows and linux that i use. +#define NXTTAB LCTL(KC_PGDN) +#define PRVTAB LCTL(KC_PGUP) +#define UPTAB LCTL(LSFT(KC_PGUP)) +#define DNTAB LCTL(LSFT(KC_PGDN)) +#define NXTWIN LALT(KC_TAB) +#define PRVWIN LALT(LSFT(KC_TAB)) +#define CALDL LCTL(LALT(KC_DELT)) +#define TSKMGR LCTL(LSFT(KC_ESC)) +#define EXPLR LGUI(KC_E) +#define LCKGUI LGUI(KC_L) +#define CONPST LSFT(KC_INS) +#define CLSGUI LALT(KC_F4) + +// tap dances +#define CTL_DLT TD(TD_DLT_CTLDLT) +#define SM_CLN TD(TD_SCLN_CLN) +#define LFT_TMB TD(TD_LEFT_THUMB) diff --git a/users/ibnuda/readme.md b/users/ibnuda/readme.md new file mode 100644 index 00000000000..24b8d6ba347 --- /dev/null +++ b/users/ibnuda/readme.md @@ -0,0 +1,14 @@ +Copyright 2020 Ibnu D. Aji @ibnuda + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . diff --git a/users/ibnuda/rules.mk b/users/ibnuda/rules.mk new file mode 100644 index 00000000000..1cf315ebe9b --- /dev/null +++ b/users/ibnuda/rules.mk @@ -0,0 +1,14 @@ +COMBO_ENABLE = yes +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +TAP_DANCE_ENABLE = yes + +SRC += ibnuda.c + +ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) + SRC += tapdance.c +endif + +ifeq ($(strip $(COMBO_ENABLE)), yes) + SRC += combo.c +endif diff --git a/users/ibnuda/tapdance.c b/users/ibnuda/tapdance.c new file mode 100644 index 00000000000..c0d2192587a --- /dev/null +++ b/users/ibnuda/tapdance.c @@ -0,0 +1,83 @@ +#include "tapdance.h" + +static td_state_t td_state; + +void dance_dlt_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code16(KC_DELT); + } else { + register_code16(C(KC_DELT)); + } +} + +void dance_dlt_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code16(KC_DELT); + } else { + unregister_code16(C(KC_DELT)); + } +} + +void dance_cln_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code(KC_LSFT); + } + register_code(KC_SCLN); +} + +void dance_cln_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code(KC_LSFT); + } + unregister_code(KC_SCLN); +} + +int current_dance(qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { + return SINGLE_TAP; + } else { + return SINGLE_HOLD; + } + } + if (state->count == 2) { + return DOUBLE_TAP; + } else { + return 3; + } +} + +void dance_tmb_finished(qk_tap_dance_state_t *state, void *user_data) { + td_state = current_dance(state); + switch (td_state) { + case SINGLE_TAP: + register_code16(KC_ESC); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_LSFT)); + break; + case DOUBLE_TAP: + register_code16(KC_DELT); + break; + } +} + +void dance_tmb_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + unregister_code16(KC_ESC); + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_LSFT)); + break; + case DOUBLE_TAP: + unregister_code16(KC_DELT); + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_DLT_CTLDLT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_dlt_finished, dance_dlt_reset), + [TD_SCLN_CLN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, dance_cln_reset), + [TD_LEFT_THUMB] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_tmb_finished, dance_tmb_reset), +}; diff --git a/users/ibnuda/tapdance.h b/users/ibnuda/tapdance.h new file mode 100644 index 00000000000..258321d4ca5 --- /dev/null +++ b/users/ibnuda/tapdance.h @@ -0,0 +1,23 @@ +#pragma once +#include "ibnuda.h" + +#ifdef TAP_DANCE_ENABLE +typedef enum { + SINGLE_TAP, + SINGLE_HOLD, + DOUBLE_TAP, +} td_state_t; + +int current_dance(qk_tap_dance_state_t *state); + +void dance_tmb_finished(qk_tap_dance_state_t *state, void *user_data); +void dance_tmb_reset(qk_tap_dance_state_t *state, void *user_data); + +// enum for tap dances. +enum { + TD_DLT_CTLDLT = 0, + TD_SCLN_CLN, + TD_LEFT_THUMB, +}; + +#endif // TAP_DANCE_ENABLE diff --git a/users/ibnuda/wrapper.h b/users/ibnuda/wrapper.h new file mode 100644 index 00000000000..34350cf3691 --- /dev/null +++ b/users/ibnuda/wrapper.h @@ -0,0 +1,46 @@ +#pragma once +#include "ibnuda.h" + +/* +Since our quirky block definitions are basically a list of comma separated +arguments, we need a wrapper in order for these definitions to be +expanded before being used as arguments to the LAYOUT_xxx macro. +*/ +#if (!defined(LAYOUT) && defined(KEYMAP)) +# define LAYOUT KEYMAP +#endif + +#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) + +#define ________________DVORAK_L1_______________ KC_SCLN,KC_COMM,KC_DOT, KC_P, KC_Y +#define ________________DVORAK_L2_______________ SH_A, CT_O, AL_E, KC_U, GU_I +#define ________________DVORAK_L3_______________ KC_QUOT,KC_Q, KC_J, KC_K, KC_X + +#define ________________DVORAK_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L +#define ________________DVORAK_R2_______________ GU_D, KC_H, AL_T, CT_N, SH_S +#define ________________DVORAK_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z + +#define ________________RAISE_L1________________ KC_EXLM,KC_AT, KC_UP, KC_LCBR,KC_RCBR +#define ________________RAISE_L2________________ KC_HASH,KC_LEFT,KC_DOWN,KC_RGHT,KC_DLR +#define ________________RAISE_L3________________ KC_LBRC,KC_RBRC,KC_LPRN,KC_RPRN,KC_AMPR + +#define ________________RAISE_R1________________ KC_BSLS,KC_7, KC_8, KC_9, KC_ASTR +#define ________________RAISE_R2________________ KC_EQL, KC_4, KC_5, KC_6, KC_0 +#define ________________RAISE_R3________________ KC_GRV, KC_1, KC_2, KC_3, KC_PLUS + +#define ________________LOWER_L1________________ KC_ESC, KC_QUES,KC_UNDS,KC_F1, KC_F2 +#define ________________LOWER_L2________________ KC_LSFT,KC_TAB, KC_PGUP,KC_F5, KC_F6 +#define ________________LOWER_L3________________ KC_CLCK,KC_SLCK,KC_PGDN,KC_F9, KC_F10 + +#define ________________LOWER_R1________________ KC_F3, KC_F4, KC_MINS,KC_SLSH,KC_BSPC +#define ________________LOWER_R2________________ KC_F7, KC_F8, KC_HOME,KC_LALT,KC_ENT +#define ________________LOWER_R3________________ KC_F11, KC_F12, KC_END, KC_INS, KC_SLSH + +#define ________________ADJUST_L1_______________ _______,EXPLR, KC_UP, PRVTAB, PRVWIN +#define ________________ADJUST_L2_______________ TSKMGR, KC_LEFT,KC_DOWN,KC_RGHT,UPTAB +#define ________________ADJUST_L3_______________ _______,CLSGUI, _______,CONPST, RESET + +#define ________________ADJUST_R1_______________ NXTWIN, NXTTAB, _______,_______,LCKGUI +#define ________________ADJUST_R2_______________ DNTAB, KC_ENT, KC_LGUI,_______,CALDL +#define ________________ADJUST_R3_______________ _______,_______,_______,_______,_______ From 8c3ff3f32c49c649ef6632d10f8fb15ef60d990d Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 4 Mar 2020 09:10:39 +1100 Subject: [PATCH 020/106] [Keyboard] LFK78 refactor (#7835) * Change include guards to pragma once * Clean up default keymaps * Remove some magic numbers and use GPIO macros * Clean up keyboard.[ch] * Tidy up info.json and readme * Align config.h with template * Split up revision code into subfolders * rev C-H has no audio, apparently * Change revc_h to revc and document differences * Turn off Audio on revb for now, for Travis' sake * Split info.json into revision folders * Clean up default keymaps some more --- keyboards/lfkeyboards/lfk78/config.h | 137 ++++-- keyboards/lfkeyboards/lfk78/info.json | 21 - .../lfk78/keymaps/default/keymap.c | 164 ++++---- .../lfk78/keymaps/default/rules.mk | 32 -- .../lfkeyboards/lfk78/keymaps/iso/keymap.c | 164 ++++---- .../lfkeyboards/lfk78/keymaps/iso/readme.md | 2 +- .../lfkeyboards/lfk78/keymaps/iso/rules.mk | 41 -- .../lfk78/keymaps/split_bs_osx/keymap.c | 162 ++++---- .../lfk78/keymaps/split_bs_osx/rules.mk | 31 -- keyboards/lfkeyboards/lfk78/lfk78.c | 140 ++++--- keyboards/lfkeyboards/lfk78/lfk78.h | 140 +------ keyboards/lfkeyboards/lfk78/readme.md | 17 +- keyboards/lfkeyboards/lfk78/revb/config.h | 21 + keyboards/lfkeyboards/lfk78/revb/info.json | 104 +++++ keyboards/lfkeyboards/lfk78/revb/revb.h | 39 ++ keyboards/lfkeyboards/lfk78/revb/rules.mk | 2 + keyboards/lfkeyboards/lfk78/revc/config.h | 21 + keyboards/lfkeyboards/lfk78/revc/info.json | 392 ++++++++++++++++++ keyboards/lfkeyboards/lfk78/revc/revc.h | 76 ++++ keyboards/lfkeyboards/lfk78/revc/rules.mk | 2 + keyboards/lfkeyboards/lfk78/revj/config.h | 21 + keyboards/lfkeyboards/lfk78/revj/info.json | 392 ++++++++++++++++++ keyboards/lfkeyboards/lfk78/revj/revj.h | 76 ++++ keyboards/lfkeyboards/lfk78/revj/rules.mk | 4 + keyboards/lfkeyboards/lfk78/rules.mk | 52 +-- 25 files changed, 1581 insertions(+), 672 deletions(-) delete mode 100644 keyboards/lfkeyboards/lfk78/info.json delete mode 100644 keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk delete mode 100644 keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk delete mode 100644 keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk create mode 100644 keyboards/lfkeyboards/lfk78/revb/config.h create mode 100644 keyboards/lfkeyboards/lfk78/revb/info.json create mode 100644 keyboards/lfkeyboards/lfk78/revb/revb.h create mode 100644 keyboards/lfkeyboards/lfk78/revb/rules.mk create mode 100644 keyboards/lfkeyboards/lfk78/revc/config.h create mode 100644 keyboards/lfkeyboards/lfk78/revc/info.json create mode 100644 keyboards/lfkeyboards/lfk78/revc/revc.h create mode 100644 keyboards/lfkeyboards/lfk78/revc/rules.mk create mode 100644 keyboards/lfkeyboards/lfk78/revj/config.h create mode 100644 keyboards/lfkeyboards/lfk78/revj/info.json create mode 100644 keyboards/lfkeyboards/lfk78/revj/revj.h create mode 100644 keyboards/lfkeyboards/lfk78/revj/rules.mk diff --git a/keyboards/lfkeyboards/lfk78/config.h b/keyboards/lfkeyboards/lfk78/config.h index 44b55b50e0c..3478c9629f9 100644 --- a/keyboards/lfkeyboards/lfk78/config.h +++ b/keyboards/lfkeyboards/lfk78/config.h @@ -15,68 +15,58 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" +/* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 #define MANUFACTURER LFKeyboards #define PRODUCT LFK78 -#define DESCRIPTION QMK keyboard firmware for LFK78 LFK_REV_STRING +#define DESCRIPTION QMK keyboard firmware for LFK78 -#ifdef LFK_REV_B -/* RevB Matrix config */ - #define DIODE_DIRECTION COL2ROW - #define MATRIX_ROWS 10 - #define MATRIX_COLS 8 - #define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, F0, F1, F4, F5, F6} - #define MATRIX_COL_PINS { E6, F7, D2, D3, D4, D5, D6, D7 } - #define UNUSED_PINS { C7 } - #define RGBLED_NUM 31 // Number of LEDs -#else -/* RevC/D Matrix config */ - #define DIODE_DIRECTION COL2ROW - #define MATRIX_ROWS 5 - #define MATRIX_COLS 18 - #define MATRIX_ROW_PINS {D2, D3, D4, D5, D6 } - #define MATRIX_COL_PINS {A0, A1, A2, A3, A4, A5, A6, A7, E6, E7,\ - F0, F1, F2, F3, C0, C1, C2, C3 } - #define UNUSED_PINS {B0, B1, B2, B3, B4, B4, B5, B6, B7, C4, C5, C6, C7,\ - D0, D1, D7, E0, E1, E2, E3, E4, D5, F4, F5, F6, F7,\ - E6, E7, F0, F1, F2, F3, C0, C1, C2, C3} - #define RGBLED_NUM 27 // Number of LEDs -#endif +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW -#define AUDIO_VOICES -#define C6_AUDIO +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 #define BACKLIGHT_LEVELS 8 -#define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255} - -#define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 +#define BACKLIGHT_PWM_MAP { 8, 16, 40, 55, 70, 128, 200, 255 } #define TAPPING_TERM 200 +#define C6_AUDIO +#define AUDIO_VOICES + +#define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile +#ifdef RGB_DI_PIN +# define RGBLIGHT_HUE_STEP 10 +# define RGBLIGHT_SAT_STEP 17 +# define RGBLIGHT_VAL_STEP 17 +# define RGBLIGHT_ANIMATIONS +#endif + /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST -/* number of backlight levels */ - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + /* * Force NKRO * @@ -110,6 +100,10 @@ along with this program. If not, see . * */ +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) + /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true @@ -119,8 +113,8 @@ along with this program. If not, see . //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH //#define MAGIC_KEY_DEBUG D //#define MAGIC_KEY_DEBUG_MATRIX X //#define MAGIC_KEY_DEBUG_KBD K @@ -128,9 +122,8 @@ along with this program. If not, see . //#define MAGIC_KEY_VERSION V //#define MAGIC_KEY_STATUS S //#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE //#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE //#define MAGIC_KEY_LAYER1 1 //#define MAGIC_KEY_LAYER2 2 //#define MAGIC_KEY_LAYER3 3 @@ -140,9 +133,11 @@ along with this program. If not, see . //#define MAGIC_KEY_LAYER7 7 //#define MAGIC_KEY_LAYER8 8 //#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC //#define MAGIC_KEY_LOCK CAPS //#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE //#define MAGIC_KEY_NKRO N //#define MAGIC_KEY_SLEEP_LED Z @@ -161,7 +156,63 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION +/* disable these deprecated features by default */ +#ifndef LINK_TIME_OPTIMIZATION_ENABLE + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION #endif +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/lfkeyboards/lfk78/info.json b/keyboards/lfkeyboards/lfk78/info.json deleted file mode 100644 index 4af5a37ba1e..00000000000 --- a/keyboards/lfkeyboards/lfk78/info.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "keyboard_name": "LFK78/68", - "url": "", - "maintainer": "qmk", - "width": 19.5, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"Back Space", "x":15.25, "y":0, "w":2}, {"label":"Insert", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"|", "x":15.75, "y":1, "w":1.5}, {"label":"Delete", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"\"", "x":14, "y":2}, {"label":"Enter", "x":15, "y":2, "w":2.25}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":2.25}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":2.75}, {"label":"\u2191", "x":17.5, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, {"label":"GUI", "x":3.5, "y":4, "w":1.25}, {"label":"Alt", "x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"label":"Alt", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.25}, {"label":"Fn", "x":14.75, "y":4, "w":1.25}, {"label":"\u2190", "x":16.5, "y":4}, {"label":"\u2193", "x":17.5, "y":4}, {"label":"\u2192", "x":18.5, "y":4}] - }, - "LAYOUT_split_bs": { - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"Back Space", "x":15.25, "y":0}, {"label":"Back Space", "x":16.25, "y":0}, {"label":"Insert", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"|", "x":15.75, "y":1, "w":1.5}, {"label":"Delete", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"\"", "x":14, "y":2}, {"label":"Enter", "x":15, "y":2, "w":2.25}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":2.25}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":2.75}, {"label":"\u2191", "x":17.5, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, {"label":"GUI", "x":3.5, "y":4, "w":1.25}, {"label":"Alt", "x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"label":"Alt", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.25}, {"label":"Fn", "x":14.75, "y":4, "w":1.25}, {"label":"\u2190", "x":16.5, "y":4}, {"label":"\u2193", "x":17.5, "y":4}, {"label":"\u2192", "x":18.5, "y":4}] - }, - "LAYOUT_split_rshift": { - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"Backspace", "x":15.25, "y":0, "w":2}, {"label":"Insert", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"|", "x":15.75, "y":1, "w":1.5}, {"label":"Delete", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"\"", "x":14, "y":2}, {"label":"Enter", "x":15, "y":2, "w":2.25}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":2.25}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":1.75}, {"label":"Fn", "x":16.25, "y":3}, {"label":"\u2191", "x":17.5, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, {"label":"GUI", "x":3.5, "y":4, "w":1.25}, {"label":"Alt", "x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"label":"Alt", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.25}, {"label":"Fn", "x":14.75, "y":4, "w":1.25}, {"label":"\u2190", "x":16.5, "y":4}, {"label":"\u2193", "x":17.5, "y":4}, {"label":"\u2192", "x":18.5, "y":4}] - }, - "LAYOUT_iso": { - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, {"label":"Esc", "x":2.25, "y":0}, {"label":"!", "x":3.25, "y":0}, {"label":"@", "x":4.25, "y":0}, {"label":"#", "x":5.25, "y":0}, {"label":"$", "x":6.25, "y":0}, {"label":"%", "x":7.25, "y":0}, {"label":"^", "x":8.25, "y":0}, {"label":"&", "x":9.25, "y":0}, {"label":"*", "x":10.25, "y":0}, {"label":"(", "x":11.25, "y":0}, {"label":")", "x":12.25, "y":0}, {"label":"_", "x":13.25, "y":0}, {"label":"+", "x":14.25, "y":0}, {"label":"Backspace", "x":15.25, "y":0, "w":2}, {"label":"Insert", "x":17.5, "y":0}, {"label":"PgUp", "x":18.5, "y":0}, {"label":"F3", "x":0, "y":1}, {"label":"F4", "x":1, "y":1}, {"label":"Tab", "x":2.25, "y":1, "w":1.5}, {"label":"Q", "x":3.75, "y":1}, {"label":"W", "x":4.75, "y":1}, {"label":"E", "x":5.75, "y":1}, {"label":"R", "x":6.75, "y":1}, {"label":"T", "x":7.75, "y":1}, {"label":"Y", "x":8.75, "y":1}, {"label":"U", "x":9.75, "y":1}, {"label":"I", "x":10.75, "y":1}, {"label":"O", "x":11.75, "y":1}, {"label":"P", "x":12.75, "y":1}, {"label":"{", "x":13.75, "y":1}, {"label":"}", "x":14.75, "y":1}, {"label":"Enter", "x":16, "y":1, "w":1.25, "h":2}, {"label":"Delete", "x":17.5, "y":1}, {"label":"PgDn", "x":18.5, "y":1}, {"label":"F5", "x":0, "y":2}, {"label":"F6", "x":1, "y":2}, {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, {"label":"A", "x":4, "y":2}, {"label":"S", "x":5, "y":2}, {"label":"D", "x":6, "y":2}, {"label":"F", "x":7, "y":2}, {"label":"G", "x":8, "y":2}, {"label":"H", "x":9, "y":2}, {"label":"J", "x":10, "y":2}, {"label":"K", "x":11, "y":2}, {"label":"L", "x":12, "y":2}, {"label":":", "x":13, "y":2}, {"label":"@", "x":14, "y":2}, {"label":"~", "x":15, "y":2}, {"label":"F7", "x":0, "y":3}, {"label":"F8", "x":1, "y":3}, {"label":"Shift", "x":2.25, "y":3, "w":1.25}, {"label":"|", "x":3.5, "y":3}, {"label":"Z", "x":4.5, "y":3}, {"label":"X", "x":5.5, "y":3}, {"label":"C", "x":6.5, "y":3}, {"label":"V", "x":7.5, "y":3}, {"label":"B", "x":8.5, "y":3}, {"label":"N", "x":9.5, "y":3}, {"label":"M", "x":10.5, "y":3}, {"label":"<", "x":11.5, "y":3}, {"label":">", "x":12.5, "y":3}, {"label":"?", "x":13.5, "y":3}, {"label":"Shift", "x":14.5, "y":3, "w":2.75}, {"label":"\u2191", "x":17.5, "y":3}, {"label":"F9", "x":0, "y":4}, {"label":"F10", "x":1, "y":4}, {"label":"Ctrl", "x":2.25, "y":4, "w":1.25}, {"label":"GUI", "x":3.5, "y":4, "w":1.25}, {"label":"Alt", "x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"label":"Alt", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.25}, {"label":"Fn", "x":14.75, "y":4, "w":1.25}, {"label":"\u2190", "x":16.5, "y":4}, {"label":"\u2193", "x":17.5, "y":4}, {"label":"\u2192", "x":18.5, "y":4}] - } - } -} diff --git a/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c index 81ab4338d1c..a92a506c124 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/default/keymap.c @@ -1,111 +1,99 @@ #include QMK_KEYBOARD_H enum keymap_layout { - VANILLA = 0, // matches MF68 layout - FUNC, // 0x02 - SETTINGS, // 0x04 + VANILLA = 0, // matches MF68 layout + FUNC, + SETTINGS }; // Colors of the layer indicator LED // This list needs to define layer 0xFFFFFFFF, it is the end of the list, and the unknown layer const Layer_Info layer_info[] = { - // Layer Mask Red Green Blue - {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green - {0x00000002, 0xFFFFFFFE, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue - {0x00000004, 0xFFFFFFFC, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta - {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white + // Layer Mask Red Green Blue + { 0x00000000, 0xFFFFFFFF, { 0x0000, 0x0FFF, 0x0000 } }, // base layer - green + { 0x00000002, 0xFFFFFFFE, { 0x0000, 0x0000, 0x0FFF } }, // function layer - blue + { 0x00000004, 0xFFFFFFFC, { 0x0FFF, 0x0000, 0x0FFF } }, // settings layer - magenta + { 0xFFFFFFFF, 0xFFFFFFFF, { 0x0FFF, 0x0FFF, 0x0FFF } } // unknown layer - REQUIRED - white }; - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,---------. ,------------------------------------------------------------. ,---------. - * | F1 | F2 | |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| | Ins|PgUp| - * |---------| |------------------------------------------------------------| |---------| - * | F3 | F4 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del|PgDn| - * |---------| |------------------------------------------------------------| `---------' - * | F5 | F6 | |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |---------| |------------------------------------------------------------| ,----. - * | F7 | F8 | |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |---------| |-------------------------------------------------------------------------. - * | F9 | F10| |Ctrl|Win |Alt | Space |Alt |Ctrl|Func | |Lft| Dn |Rig | - * `---------' `------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT( - KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, \ - KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, \ - KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \ - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,---------. ,------------------------------------------------------------. ,---------. + * | F1 | F2 | |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| | Ins|PgUp| + * |---------| |------------------------------------------------------------| |---------| + * | F3 | F4 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del|PgDn| + * |---------| |------------------------------------------------------------| `---------' + * | F5 | F6 | |CAPS | A| S| D| F| G| H| J| K| L| ;| '| Return | + * |---------| |------------------------------------------------------------| ,----. + * | F7 | F8 | |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |---------| |-------------------------------------------------------------------------. + * | F9 | F10| |Ctrl|Win |Alt | Space |Alt |Ctrl|Func | |Lft| Dn |Rig | + * `---------' `------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT( + KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Keymap FUNCTION: Function Layer - * ,---------. ,-------------------------------------------------------------. ,---------. - * | | | | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | Ins|Home| - * |---------| |-------------------------------------------------------------| |---------| - * | | | |Tab |Hom| Up|End|PgU| | | | | | | | | | | Del|End | - * |---------| |-------------------------------------------------------------| `---------' - * | | | |MO(FUNC)|Lft|Dn |Rig|PgD| |Lft|Dwn| Up|Rgt| | | | - * |---------| |-------------------------------------------------------------| ,----. - * | | | |Shift | | | | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |---------| |--------------------------------------------------------------------------. - * | | | |Ctrl|Win |Alt | Enter |Alt |Func |CTRL | |Lft| Dn |Rig | - * `---------' `------------------------------------------------------' `-------------' - */ - [FUNC] = LAYOUT( - _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, KC_HOME, \ - _______, _______, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_END, \ - _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \ - _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, _______, _______ \ - ), + /* Keymap FUNCTION: Function Layer + * ,---------. ,-------------------------------------------------------------. ,---------. + * | | | | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | Ins|Home| + * |---------| |-------------------------------------------------------------| |---------| + * | | | |Tab |Hom| Up|End|PgU| | | | | | | | | | | Del|End | + * |---------| |-------------------------------------------------------------| `---------' + * | | | |MO(FUNC)|Lft|Dn |Rig|PgD| |Lft|Dwn| Up|Rgt| | | | + * |---------| |-------------------------------------------------------------| ,----. + * | | | |Shift | | | | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |---------| |--------------------------------------------------------------------------. + * | | | |Ctrl|Win |Alt | Enter |Alt |Func |CTRL | |Lft| Dn |Rig | + * `---------' `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT( + _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, KC_HOME, + _______, _______, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_END, + _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, + _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, _______, _______ + ), - /* Keymap SETTINGS: Settings Layer - * ,---------. ,-------------------------------------------------------------. ,-------------. - * | | | |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |---------| |-------------------------------------------------------------| |-------------| - * | | | |MuMode | | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |---------| |-------------------------------------------------------------| `-------------' - * | | | |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |---------| |-------------------------------------------------------------| ,----. - * | | | |ClickTgl |Hz-|MS-| | | | |MuTgl| | | |Layer Clr | |Hue+| - * |---------| |-------------------------------------------------------------------------. - * | | | | | | | | | | | |Sat-|Hue-|Sat+| - * `---------' `--------------------------------------------------------' `--------------' - */ - [SETTINGS] = LAYOUT( - XXXXXXX, XXXXXXX, KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, \ - XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, \ - XXXXXXX, XXXXXXX, AU_TOG, KC_FN1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ - XXXXXXX, XXXXXXX, KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI \ - ), + /* Keymap SETTINGS: Settings Layer + * ,---------. ,-------------------------------------------------------------. ,-------------. + * | | | |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |---------| |-------------------------------------------------------------| |-------------| + * | | | |MuMode | | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |---------| |-------------------------------------------------------------| `-------------' + * | | | |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |---------| |-------------------------------------------------------------| ,----. + * | | | |ClickTgl |Hz-|MS-| | | | |MuTgl| | | |Layer Clr | |Hue+| + * |---------| |-------------------------------------------------------------------------. + * | | | | | | | | | | | |Sat-|Hue-|Sat+| + * `---------' `--------------------------------------------------------' `--------------' + */ + [SETTINGS] = LAYOUT( + XXXXXXX, XXXXXXX, F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, + XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, + XXXXXXX, XXXXXXX, AU_TOG, F(1), F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI + ) }; const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click - }; + ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers + ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click + ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click + ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click + ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click + ACTION_FUNCTION(LFK_CLICK_TOGGLE) // FN5 - Toggle audio click +}; void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed - if(eeconfig_read_default_layer() > 1){ + if (eeconfig_read_default_layer() > 1) { eeconfig_update_default_layer(1); default_layer_set(1); } } - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { -} diff --git a/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk deleted file mode 100644 index 9b8038dd36f..00000000000 --- a/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk +++ /dev/null @@ -1,32 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE = no - -ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled -WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -CAPSLOCK_LED = no # Toggle back light LED of Caps Lock - - -# Override the LFK78 hardware version: -# -# B - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight -# C-H - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB -# J - at90usb646, C6 audio, ISSI device 0 is backlight, 4 is RGB -# LFK_REV = J diff --git a/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c index 806f402e83a..3dbc7755799 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/iso/keymap.c @@ -2,112 +2,98 @@ enum keymap_layout { VANILLA = 0, // matches MF68 layout - FUNC, // 0x02 - SETTINGS, // 0x04 + FUNC, + SETTINGS }; // Colors of the layer indicator LED // This list needs to define layer 0xFFFFFFFF, it is the end of the list, and the unknown layer const Layer_Info layer_info[] = { - // Layer Mask Red Green Blue - {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green - {0x00000002, 0xFFFFFFFE, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue - {0x00000004, 0xFFFFFFFC, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta - {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white + // Layer Mask Red Green Blue + { 0x00000000, 0xFFFFFFFF, { 0x0000, 0x0FFF, 0x0000 } }, // base layer - green + { 0x00000002, 0xFFFFFFFE, { 0x0000, 0x0000, 0x0FFF } }, // function layer - blue + { 0x00000004, 0xFFFFFFFC, { 0x0FFF, 0x0000, 0x0FFF } }, // settings layer - magenta + { 0xFFFFFFFF, 0xFFFFFFFF, { 0x0FFF, 0x0FFF, 0x0FFF } } // unknown layer - REQUIRED - white }; - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,---------. ,------------------------------------------------------------. ,---------. - * | F1 | F2 | |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| | Ins|PgUp| - * |---------| |------------------------------------------------------------| |---------| - * | F3 | F4 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret| | Del|PgDn| - * |---------| |--------------------------------------------------------. | `---------' - * | F5 | F6 | |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | | - * |---------| |-----------------------------------------------------------| ,----. - * | F7 | F8 | |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |---------| |-------------------------------------------------------------------------. - * | F9 | F10| |Ctrl|Win |Alt | Space |Alt |Ctrl|Func | |Lft| Dn |Rig | - * `---------' `------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT_iso( - KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, \ - KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, KC_DEL, KC_PGDN, \ - KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, \ - KC_F7, KC_F8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \ - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,---------. ,------------------------------------------------------------. ,---------. + * | F1 | F2 | |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| | Ins|PgUp| + * |---------| |------------------------------------------------------------| |---------| + * | F3 | F4 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret| | Del|PgDn| + * |---------| |--------------------------------------------------------. | `---------' + * | F5 | F6 | |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | | + * |---------| |-----------------------------------------------------------| ,----. + * | F7 | F8 | |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |---------| |-------------------------------------------------------------------------. + * | F9 | F10| |Ctrl|Win |Alt | Space |Alt |Ctrl|Func | |Lft| Dn |Rig | + * `---------' `------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_iso( + KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_PGUP, + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_ENT, KC_DEL, KC_PGDN, + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, + KC_F7, KC_F8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Keymap FUNCTION: Function Layer - * ,---------. ,-------------------------------------------------------------. ,---------. - * | | | | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | Ins|Home| - * |---------| |-------------------------------------------------------------| |---------| - * | | | |Tab |Hom| Up|End|PgU| | | | | | | | | | | Del|End | - * |---------| |-------------------------------------------------------------| `---------' - * | | | |MO(FUNC)|Lft|Dn |Rig|PgD| |Lft|Dwn| Up|Rgt| | | | - * |---------| |-------------------------------------------------------------| ,----. - * | | | |Shift | | | | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |---------| |--------------------------------------------------------------------------. - * | | | |Ctrl|Win |Alt | PgD |Alt |Func |CTRL | |Lft| Dn |Rig | - * `---------' `------------------------------------------------------' `-------------' - */ - [FUNC] = LAYOUT( - _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, KC_HOME, \ - _______, _______, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_END, \ - _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \ - _______, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______ \ - ), + /* Keymap FUNCTION: Function Layer + * ,---------. ,-------------------------------------------------------------. ,---------. + * | | | | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | Ins|Home| + * |---------| |-------------------------------------------------------------| |---------| + * | | | |Tab |Hom| Up|End|PgU| | | | | | | | | | | Del|End | + * |---------| |-------------------------------------------------------------| `---------' + * | | | |MO(FUNC)|Lft|Dn |Rig|PgD| |Lft|Dwn| Up|Rgt| | | | + * |---------| |-------------------------------------------------------------| ,----. + * | | | |Shift | | | | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |---------| |--------------------------------------------------------------------------. + * | | | |Ctrl|Win |Alt | PgD |Alt |Func |CTRL | |Lft| Dn |Rig | + * `---------' `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_iso( + _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, KC_HOME, + _______, _______, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_END, + _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, TG(SETTINGS), _______, + _______, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______ + ), - /* Keymap SETTINGS: Settings Layer - * ,---------. ,-------------------------------------------------------------. ,-------------. - * | | | |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| - * |---------| |-------------------------------------------------------------| |-------------| - * | | | |MuMode | | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| - * |---------| |-------------------------------------------------------------| `-------------' - * | | | |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |---------| |-------------------------------------------------------------| ,----. - * | | | |ClickTgl |Hz-|MS-| | | | |MuTgl| | | |Layer Clr | |Hue+| - * |---------| |-------------------------------------------------------------------------. - * | | | | | | | | | | | |Sat-|Hue-|Sat+| - * `---------' `--------------------------------------------------------' `--------------' - */ - [SETTINGS] = LAYOUT( - XXXXXXX, XXXXXXX, KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, \ - XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, \ - XXXXXXX, XXXXXXX, AU_TOG, KC_FN1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ - XXXXXXX, XXXXXXX, KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI \ - ), + /* Keymap SETTINGS: Settings Layer + * ,---------. ,-------------------------------------------------------------. ,-------------. + * | | | |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+| + * |---------| |-------------------------------------------------------------| |-------------| + * | | | |MuMode | | | | | | | | | | | | |LEDTst| |RGB Mode|Val-| + * |---------| |-------------------------------------------------------------| `-------------' + * | | | |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |---------| |-------------------------------------------------------------| ,----. + * | | | |ClickTgl |Hz-|MS-| | | | |MuTgl| | | |Layer Clr | |Hue+| + * |---------| |-------------------------------------------------------------------------. + * | | | | | | | | | | | |Sat-|Hue-|Sat+| + * `---------' `--------------------------------------------------------' `--------------' + */ + [SETTINGS] = LAYOUT_iso( + XXXXXXX, XXXXXXX, F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, + XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_VAD, + XXXXXXX, XXXXXXX, AU_TOG, F(1), F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI + ) }; const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click - }; + ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers + ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click + ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click + ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click + ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click + ACTION_FUNCTION(LFK_CLICK_TOGGLE) // FN5 - Toggle audio click +}; void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed - if(eeconfig_read_default_layer() > 1){ + if (eeconfig_read_default_layer() > 1) { eeconfig_update_default_layer(1); default_layer_set(1); } } - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/lfkeyboards/lfk78/keymaps/iso/readme.md b/keyboards/lfkeyboards/lfk78/keymaps/iso/readme.md index 85b7b1a8d28..3b9acefbfd4 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/iso/readme.md +++ b/keyboards/lfkeyboards/lfk78/keymaps/iso/readme.md @@ -1 +1 @@ -# The default keymap for bluepad +# The default ISO keymap for LFK78 diff --git a/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk deleted file mode 100644 index 04fa7d81b03..00000000000 --- a/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk +++ /dev/null @@ -1,41 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE = no - -ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled -WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms - - - -# # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired -# # -# # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight -# # RevC/D - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB -# # -# # Set to B, C or D -# LFK_REV = D - -# ifeq ($(LFK_REV), B) -# MCU = atmega32u4 -# else -# MCU = at90usb1286 -# endif -# OPT_DEFS += -DLFK_REV_$(LFK_REV) -# OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\" diff --git a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c index 35d17805c33..da7593d39c2 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c +++ b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/keymap.c @@ -2,110 +2,98 @@ enum keymap_layout { VANILLA = 0, // matches MF68 layout - FUNC, // 0x02 - SETTINGS, // 0x04 + FUNC, + SETTINGS }; // Colors of the layer indicator LED // This list needs to define layer 0xFFFFFFFF, it is the end of the list, and the unknown layer const Layer_Info layer_info[] = { - // Layer Mask Red Green Blue - {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green - {0x00000002, 0xFFFFFFFE, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue - {0x00000004, 0xFFFFFFFC, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta - {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white + // Layer Mask Red Green Blue + { 0x00000000, 0xFFFFFFFF, { 0x0000, 0x0FFF, 0x0000 } }, // base layer - green + { 0x00000002, 0xFFFFFFFE, { 0x0000, 0x0000, 0x0FFF } }, // function layer - blue + { 0x00000004, 0xFFFFFFFC, { 0x0FFF, 0x0000, 0x0FFF } }, // settings layer - magenta + { 0xFFFFFFFF, 0xFFFFFFFF, { 0x0FFF, 0x0FFF, 0x0FFF } } // unknown layer - REQUIRED - white }; - - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap VANILLA: (Base Layer) Default Layer - * ,---------. ,------------------------------------------------------------. ,---------. - * | F1 | F2 | |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = | / | ` | | Ins|PgUp| - * |---------| |------------------------------------------------------------| |---------| - * | F3 | F4 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backsp| | Del|PgDn| - * |---------| |------------------------------------------------------------| `---------' - * | F5 | F6 | |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |---------| |------------------------------------------------------------| ,----. - * | F7 | F8 | |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |---------| |-------------------------------------------------------------------------. - * | F9 | F10| |Ctrl|Alt |Cmd | Space |Cmd |Ctrl|Func | |Lft| Dn |Rig | - * `---------' `------------------------------------------------------' `-------------' - */ - [VANILLA] = LAYOUT_split_bs( - KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_INS, KC_PGUP, \ - KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, KC_PGDN, \ - KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - KC_F9, KC_F10, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \ - ), + /* Keymap VANILLA: (Base Layer) Default Layer + * ,---------. ,------------------------------------------------------------. ,---------. + * | F1 | F2 | |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = | / | ` | | Ins|PgUp| + * |---------| |------------------------------------------------------------| |---------| + * | F3 | F4 | |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backsp| | Del|PgDn| + * |---------| |------------------------------------------------------------| `---------' + * | F5 | F6 | |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |---------| |------------------------------------------------------------| ,----. + * | F7 | F8 | |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |---------| |-------------------------------------------------------------------------. + * | F9 | F10| |Ctrl|Alt |Cmd | Space |Cmd |Ctrl|Func | |Lft| Dn |Rig | + * `---------' `------------------------------------------------------' `-------------' + */ + [VANILLA] = LAYOUT_split_bs( + KC_F1, KC_F2, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_INS, KC_PGUP, + KC_F3, KC_F4, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, KC_PGDN, + KC_F5, KC_F6, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_F9, KC_F10, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Keymap FUNCTION: Function Layer - * ,---------. ,-------------------------------------------------------------. ,---------. - * | | | | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Ins |Del | | Ins|Home| - * |---------| |-------------------------------------------------------------| |---------| - * | | | |Tab |Hom| Up|End|PgU| | | | | | | | | | | Del|End | - * |---------| |-------------------------------------------------------------| `---------' - * | | | |MO(FUNC)|Lft|Dn |Rig|PgD| |Lft|Dwn| Up|Rgt| | | | - * |---------| |-------------------------------------------------------------| ,----. - * | | | |Shift | | | | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | - * |---------| |--------------------------------------------------------------------------. - * | | | |Ctrl|Alt |Cmd | Enter |Alt |Func |CTRL | |Lft| Dn |Rig | - * `---------' `------------------------------------------------------' `-------------' - */ - [FUNC] = LAYOUT_split_bs( - _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, _______, KC_HOME, \ - _______, _______, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_END, \ - _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \ - _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, _______, _______ \ - ), + /* Keymap FUNCTION: Function Layer + * ,---------. ,-------------------------------------------------------------. ,---------. + * | | | | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Ins |Del | | Ins|Home| + * |---------| |-------------------------------------------------------------| |---------| + * | | | |Tab |Hom| Up|End|PgU| | | | | | | | | | | Del|End | + * |---------| |-------------------------------------------------------------| `---------' + * | | | |MO(FUNC)|Lft|Dn |Rig|PgD| |Lft|Dwn| Up|Rgt| | | | + * |---------| |-------------------------------------------------------------| ,----. + * | | | |Shift | | | | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up | + * |---------| |--------------------------------------------------------------------------. + * | | | |Ctrl|Alt |Cmd | Enter |Alt |Func |CTRL | |Lft| Dn |Rig | + * `---------' `------------------------------------------------------' `-------------' + */ + [FUNC] = LAYOUT_split_bs( + _______, _______, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, _______, KC_HOME, + _______, _______, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_END, + _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, + _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, _______, _______ + ), - /* Keymap SETTINGS: Settings Layer - * ,---------. ,-------------------------------------------------------------. ,-------------. - * | | | |LayClr| | | | | | | | | | |BL-|BL+| | | |RGB Tog |Val+| - * |---------| |-------------------------------------------------------------| |-------------| - * | | | |MuMode | | | | | | | | | | | | |BLTogl| |RGB Mode|Val-| - * |---------| |-------------------------------------------------------------| `-------------' - * | | | |AudTgl |Hz+|MS+| | | | | | | | | | RST | - * |---------| |-------------------------------------------------------------| ,----. - * | | | |ClickTgl |Hz-|MS-| | | | |MuTgl| | | |Layer Clr | |Hue+| - * |---------| |-------------------------------------------------------------------------. - * | | | | | | | | | | | |Sat-|Hue-|Sat+| - * `---------' `--------------------------------------------------------' `--------------' - */ - [SETTINGS] = LAYOUT_split_bs( - XXXXXXX, XXXXXXX, KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, RGB_TOG, RGB_VAI, \ - XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_TOGG, RGB_MOD, RGB_VAD, \ - XXXXXXX, XXXXXXX, AU_TOG, KC_FN1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \ - XXXXXXX, XXXXXXX, KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI \ - ), + /* Keymap SETTINGS: Settings Layer + * ,---------. ,-------------------------------------------------------------. ,-------------. + * | | | |LayClr| | | | | | | | | | |BL-|BL+| | | |RGB Tog |Val+| + * |---------| |-------------------------------------------------------------| |-------------| + * | | | |MuMode | | | | | | | | | | | | |BLTogl| |RGB Mode|Val-| + * |---------| |-------------------------------------------------------------| `-------------' + * | | | |AudTgl |Hz+|MS+| | | | | | | | | | RST | + * |---------| |-------------------------------------------------------------| ,----. + * | | | |ClickTgl |Hz-|MS-| | | | |MuTgl| | | |Layer Clr | |Hue+| + * |---------| |-------------------------------------------------------------------------. + * | | | | | | | | | | | |Sat-|Hue-|Sat+| + * `---------' `--------------------------------------------------------' `--------------' + */ + [SETTINGS] = LAYOUT_split_bs( + XXXXXXX, XXXXXXX, F(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, RGB_TOG, RGB_VAI, + XXXXXXX, XXXXXXX, MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_TOGG, RGB_MOD, RGB_VAD, + XXXXXXX, XXXXXXX, AU_TOG, F(1), F(3), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, + XXXXXXX, XXXXXXX, F(5), F(2), F(4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI + ) }; const uint16_t PROGMEM fn_actions[] = { - ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers - ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click - ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click - ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click - ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click - }; + ACTION_FUNCTION(LFK_CLEAR), // FN0 - reset layers + ACTION_FUNCTION(LFK_CLICK_FREQ_HIGHER), // FN1 - Increase Freq of audio click + ACTION_FUNCTION(LFK_CLICK_FREQ_LOWER), // FN2 - Decrease Freq of audio click + ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click + ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click + ACTION_FUNCTION(LFK_CLICK_TOGGLE) // FN5 - Toggle audio click +}; void matrix_init_user(void) { // This keymap only has a single base layer, so reset the default if needed - if(eeconfig_read_default_layer() > 1){ + if (eeconfig_read_default_layer() > 1) { eeconfig_update_default_layer(1); default_layer_set(1); } } - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { -} diff --git a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk deleted file mode 100644 index e7f035b753f..00000000000 --- a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk +++ /dev/null @@ -1,31 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration -MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE = no - -ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled -WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -CAPSLOCK_LED = no # Toggle back light LED of Caps Lock - -# Override the LFK78 hardware version: -# -# B - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight -# C-H - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB -# J - at90usb646, C6 audio, ISSI device 0 is backlight, 4 is RGB -# LFK_REV = J diff --git a/keyboards/lfkeyboards/lfk78/lfk78.c b/keyboards/lfkeyboards/lfk78/lfk78.c index 60b7ab4ce09..cf49a5cfd09 100644 --- a/keyboards/lfkeyboards/lfk78/lfk78.c +++ b/keyboards/lfkeyboards/lfk78/lfk78.c @@ -1,13 +1,11 @@ -#include +#include "lfk78.h" + #include #include -#include "lfk78.h" -#include "keymap.h" +#include