summaryrefslogtreecommitdiffstats
path: root/quantum
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Fix bug with layer caching in get_event_keycode (#8693)Drashna Jaelre2020-04-122-7/+10
| | | | | | | | | | | | | | | * Fix bug with layer caching in get_event_keycode * Improve naming
* | | quantum/debounce: Added sym_pk debounce algorithm (#8587)Purdea Andrei2020-04-112-7/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * quantum/debounce: Added sym_pk debounce algorithm * Apply suggestions from code review Co-Authored-By: Ryan <fauxpark@gmail.com> * quantum/debounce/sym_pk: delete comments and rename functions following code review * quantum/debounce/sym_pk: Modifications for code readability according to code review * quantum/debounce/sym_pk: Modifications for code readability according to code review (2) * quantum/debounce/sym_pk: code review: cleaner code Co-Authored-By: Nick Brassel <nick@tzarc.org> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Nick Brassel <nick@tzarc.org>
* | | format code according to conventions [skip ci]QMK Bot2020-04-112-10/+10
| | |
* | | Various fixes to how timer differences are calculated (#8585)Purdea Andrei2020-04-112-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tmk_core/common: Fixing TIMER_DIFF macro to calculate difference correctly after the timer wraps. Let's go through an example, using the following macro: If the first timer read is 0xe4 and the second one is 0x32, the timer wrapped. If the timer would have had more bits, it's new value would have been 0x132, and the correct difference in time is 0x132 - 0xe4 = 0x4e old code TIMER_DIFF_8(0x32, 0xe4) = 0xff - 0xe4 + 0x32 = 0x4d, which is wrong. new code TIMER_DIFF_8(0x32, 0xe4) = 0xff + 1 - 0xe4 + 0x32 = 0x4e, which is correct. This also gives a chance for a smart compiler to optimize the code using normal integer overflow. For example on AVR, the following C code: uint8_t __attribute__ ((noinline)) test(uint8_t current_timer, uint8_t start_timer) { return TIMER_DIFF_8(current_timer, start_timer); } With the original code, it gets translated to the following list of instructions: 00004c6e <test>: 4c6e: 98 2f mov r25, r24 4c70: 86 1b sub r24, r22 4c72: 96 17 cp r25, r22 4c74: 08 f4 brcc .+2 ; 0x4c78 <test+0xa> 4c76: 81 50 subi r24, 0x01 ; 1 4c78: 08 95 ret But with this commit, it gets translated to a single instruction: 00004c40 <test>: 4c40: 86 1b sub r24, r22 4c42: 08 95 ret This unfortunately doesn't always work so nicely, for example the following C code: int __attribute__ ((noinline)) test(uint8_t current_timer, uint8_t start_timer) { return TIMER_DIFF_8(current_timer, start_timer); } (Note: return type changed to int) With the original code it gets translated to: 00004c6e <test>: 4c6e: 28 2f mov r18, r24 4c70: 30 e0 ldi r19, 0x00 ; 0 4c72: 46 2f mov r20, r22 4c74: 50 e0 ldi r21, 0x00 ; 0 4c76: 86 17 cp r24, r22 4c78: 20 f0 brcs .+8 ; 0x4c82 <test+0x14> 4c7a: c9 01 movw r24, r18 4c7c: 84 1b sub r24, r20 4c7e: 95 0b sbc r25, r21 4c80: 08 95 ret 4c82: c9 01 movw r24, r18 4c84: 84 1b sub r24, r20 4c86: 95 0b sbc r25, r21 4c88: 81 50 subi r24, 0x01 ; 1 4c8a: 9f 4f sbci r25, 0xFF ; 255 4c8c: 08 95 ret Wth this commit it gets translated to: 00004c40 <test>: 4c40: 28 2f mov r18, r24 4c42: 30 e0 ldi r19, 0x00 ; 0 4c44: 46 2f mov r20, r22 4c46: 50 e0 ldi r21, 0x00 ; 0 4c48: 86 17 cp r24, r22 4c4a: 20 f0 brcs .+8 ; 0x4c54 <test+0x14> 4c4c: c9 01 movw r24, r18 4c4e: 84 1b sub r24, r20 4c50: 95 0b sbc r25, r21 4c52: 08 95 ret 4c54: c9 01 movw r24, r18 4c56: 84 1b sub r24, r20 4c58: 95 0b sbc r25, r21 4c5a: 93 95 inc r25 4c5c: 08 95 ret There is not much performance improvement in this case, however at least with this commit it functions correctly. Note: The following commit will improve compiler output for the latter example. * tmk_core/common: Improve code generation for TIMER_DIFF* macros Because of integer promotion the compiler is having a hard time generating efficient code to calculate TIMER_DIFF* macros in some situations. In the below example, the return value is "int", and this is causing the trouble. Example C code: int __attribute__ ((noinline)) test(uint8_t current_timer, uint8_t start_timer) { return TIMER_DIFF_8(current_timer, start_timer); } BEFORE: (with -Os) 00004c40 <test>: 4c40: 28 2f mov r18, r24 4c42: 30 e0 ldi r19, 0x00 ; 0 4c44: 46 2f mov r20, r22 4c46: 50 e0 ldi r21, 0x00 ; 0 4c48: 86 17 cp r24, r22 4c4a: 20 f0 brcs .+8 ; 0x4c54 <test+0x14> 4c4c: c9 01 movw r24, r18 4c4e: 84 1b sub r24, r20 4c50: 95 0b sbc r25, r21 4c52: 08 95 ret 4c54: c9 01 movw r24, r18 4c56: 84 1b sub r24, r20 4c58: 95 0b sbc r25, r21 4c5a: 93 95 inc r25 4c5c: 08 95 ret AFTER: (with -Os) 00004c40 <test>: 4c40: 86 1b sub r24, r22 4c42: 90 e0 ldi r25, 0x00 ; 0 4c44: 08 95 ret Note: the example is showing -Os but improvements can be seen at all optimization levels, including -O0. We never use -O0, but I tested it to make sure that no extra code is generated in that case.OA * quantum/debounce: Fix custom wrapping timers in eager_pr and eager_pk debounce algorithms Please see the below simulated sequence of events: Column A is the 16-bit value returned by read_timer(); Column B is the value returned by custom_wrap_timer_read(); Column C is the original code: (timer_read() % MAX_DEBOUNCE) A, B, C 65530, 19, 30 65531, 20, 31 65532, 21, 32 65533, 22, 33 65534, 23, 34 65535, 24, 35 0 25, 0 1, 26, 1 2, 27, 2 3, 28, 3 4, 29, 4 5, 30, 5 read_timer() wraps about every 1.09 seconds, and so debouncing might fail at these times without this commit. * quantum/debounce/eager_pr and eager_pk: modifications for code readability according to code review. * quantum/debounce/eager_pr and eager_pk: modifications for code readability according to code review. (2)
* | | Fix compile issues related to NO_ACTION_MACRO/FUNCTION and LTO_ENABLE (#8663)Konstantin Đorđević2020-04-092-8/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Define NO_ACTION_MACRO/FUNCTION in header instead of makefile when LTO is enabled Currently, boards and keymaps that define NO_ACTION_MACRO/FUNCTION unconditionally will not compile with LTO_ENABLE (#8604). This fixes the issue by moving the definitions from common.mk to action.h, which enables us to check for previous definitions of those macros (this cannot be done in a makefile). * Remove LTO checks in templates Since now NO_ACTION_MACRO/FUNCTION are defined as needed in action.h (which is included by quantum.h), checking for LTO in keyboard and user code is no longer required. * Update LTO_ENABLE docs
* | Configurable VIA layout options default value (#8707)Wilba2020-04-062-1/+9
|/
* Add Greek keymap (#8636)Ryan2020-04-051-0/+162
| | | | | | | | | | | | | * Add Greek keymap * Split left shift (unused), change keycode for dialytika tonos * Update quantum/keymap_extras/keymap_greek.h Co-Authored-By: Konstantin Đorđević <vomindoraan@gmail.com> * Fix definition for DTON Co-authored-by: Konstantin Đorđević <vomindoraan@gmail.com>
* Add Polish keymap (#8637)Ryan2020-04-052-4/+156
| | | | | | | | | | | | | | | | | | | | | * Add Polish keymap * Fix wrong AltGr mapping * These are ogoneks, not cedillas * Too many !s * ANSI * Just use BSLS * Move BSLS * Move PIPE * Fix some incorrect names in keymap_slovak.h Thanks to vomindoraan
* Add Russian keymap (#8638)Drashna Jaelre2020-04-051-0/+133
|\ | | | | | | | | * Add Russian keymap * Switch to ANSI layout
| * Switch to ANSI layoutfauxpark2020-04-021-15/+16
| |
| * Add Russian keymapfauxpark2020-04-011-0/+132
| |
* | Add Korean keymap (#8635)Ryan2020-04-051-0/+128
| | | | | | | | | | | | | | | | | | | | | | * Add Korean keymap * Switch to ANSI layout * Update quantum/keymap_extras/keymap_korean.h Co-Authored-By: Konstantin Đorđević <vomindoraan@gmail.com> Co-authored-by: Konstantin Đorđević <vomindoraan@gmail.com>
* | Initial support for ATtiny85 (#8632)Joel Challis2020-04-022-0/+18
| | | | | | | | | | * Initial support for ATtiny85 * Update mcu selection
* | Strip out features to allow minimum firmware sizes (#8645)Joel Challis2020-04-012-0/+16
| |
* | Miscellaneous cleanups (#8639)Ryan2020-04-012-5/+1
|/ | | | | * Miscellaneous cleanups * Cast NO_PIN
* Add Slovak keymap and sendstring LUT (#8561)Ryan2020-04-012-0/+276
|
* Add Serbian keymaps and sendstring LUT (#8560)Ryan2020-04-013-0/+400
| | | | | | | | | | | * Add Serbian keymaps and sendstring LUT * Apply suggestions from code review Co-Authored-By: Konstantin Đorđević <vomindoraan@gmail.com> * Fix formatting Co-authored-by: Konstantin Đorđević <vomindoraan@gmail.com>
* Add Lithuanian keymap and sendstring LUT (#8562)Ryan2020-04-014-0/+502
| | | | | * Add Lithuanian keymap and sendstring LUT * Add Lithuanian AZERTY
* Add Latvian keymap and sendstring LUT (#8563)Ryan2020-04-012-0/+246
|
* Rename UC_OSX (and related constants) to UC_MAC (#8589)Konstantin Đorđević2020-03-314-17/+28
| | | | | | | | | | | | | | | | | | | | | * Rename UC_OSX (and related constants) to UC_MAC * Update UNICODE_SONG_OSX references to UNICODE_SONG_MAC * Update UC_M_OS references to UC_M_MA * Add UC_OSX alias for backwards compatibility * Add deprecation warning for UC_OSX to Unicode docs * Add UC_M_OS alias for backwards compatibility * Update newly found UC_M_OS and UNICODE_SONG_OSX references * Add legacy UNICODE_MODE_OSX alias, revert changes to user keymaps * Add legacy UNICODE_SONG_OSX alias, revert changes to user keymaps * Replace removed sounds in Unicode song doc examples
* V-USB: Consolidate usbconfig.h's into a single file (#8584)Ryan2020-03-311-342/+0
|
* format code according to conventions [skip ci]QMK Bot2020-03-301-3/+1
|
* Added USSR anthem. (#8588)Antosha2020-03-301-3/+11
|
* V-USB: Use structs for USB descriptors (#8572)Ryan2020-03-281-39/+8
| | | | | | | * V-USB: Use structs for USB descriptors * Update usbconfigs * cformat pass
* Fix IT_APOS backward compatibility define in keymap_italian.h (#8565)Drashna Jaelre2020-03-271-1/+1
| | | | | * Fix IT_APOS backward compatibility define in keymap_italian.h Found by ZSA.
* Add Estonian keymap (#8527)Ryan2020-03-262-0/+255
|
* Add Croatian keymap (#8525)Ryan2020-03-262-0/+263
| | | | | * Add Croatian keymap * Fix comment on HR_DIAE
* Run clang-format manually to fix recently changed files (#8552)Joel Challis2020-03-255-29/+25
|
* Add Irish keymap (#8528)Ryan2020-03-221-0/+152
|
* Add Czech keymap (#8526)Ryan2020-03-222-0/+273
|
* format code according to conventions [skip ci]QMK Bot2020-03-221-10/+6
|
* Add Post Processing to process_record (#4892)Drashna Jaelre2020-03-232-3/+19
| | | | | | | | | | | | | | | | | | | * Improve process_record system Code based on @colinta's * Rename and better handle functions * Fix incorrect function call to process_record_user * Add documentation for post_process_record * Add both get_event_keycode and get_record_keycode functions And add some comments about these functions * Update code format * Cleanup merge artifacts
* Variable combo (#8120)Jeremy Bernhardt2020-03-231-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | * keymap(gergo): colemak * added flipped numbers * add STENO_DISABLE_VIRTSER * add STENO_DISABLE_VIRTSER * Added GergoPlex and Faunchpad * push retab * push retab * added variable option for combos * removed accidental commit * removed accidental commit * More accidental deletions! (╯°□°)╯︵ ┻━┻ Co-authored-by: Damien Rajon <145502+pyrho@users.noreply.github.com>
* Add Word Per Minute calculation feature (#8054)brickbots2020-03-235-0/+138
| | | | | | | | | | | | | | | | | | | | | * Add Word Per Minute calculation feature * Fix copyright info * Remove header from quantum.c, setup overloadable keycode inclusion for WPM, update docs * Simplify logic for keycode filtering * Adding link from summary to wpm_feature info * Update docs/feature_wpm.md Typo in function prototype example in docs Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Add WPM transport via i2c Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
* Align some ChibiOS build logic (#8461)Joel Challis2020-03-221-0/+2
| | | | | | | * Align some ChibiOS build logic * infer more makefile logic * Move bootloader logic to chibios file
* Add US International keymap (#8493)Ryan2020-03-228-35/+241
| | | | | * Add US International keymap * Add extra spacing to UK AltGr keycode comments
* Add Icelandic keymap and sendstring LUT (#8494)Ryan2020-03-222-0/+253
|
* Add Finnish keymap and sendstring LUT (#8495)Ryan2020-03-222-0/+253
|
* Remove BOOTLOADER_SIZE stuff from template (#8516)Ryan2020-03-221-10/+0
|
* Add support for Bootmagic lite when using SPLIT_HAND_PIN (#8347)Joel Challis2020-03-212-56/+0
| | | | | | | | | * Add support for Bootmagic lite when using SPLIT_HAND_PIN * Deduplicate bootmagic_lite logic from within via * Revert location of defaults so that user overrides still work for now * Tidy up code slightly
* Initial arm->chibios pass - simplify some platform logic (#8450)Joel Challis2020-03-213-0/+0
|
* Update JIS keymap and sendstring LUT (#8457)Ryan2020-03-202-46/+120
|
* Fix missing deprecated keycodes for keymap_swedish (#8483)Ryan2020-03-191-20/+20
|
* Update Programmer Dvorak keymap and add sendstring LUT (#8456)Ryan2020-03-182-77/+184
| | | | | * Update Programmer Dvorak keymap and add sendstring LUT * Include quantum.h
* Update UK keymap and sendstring LUT (#8458)Ryan2020-03-172-147/+196
|
* Update Italian keymap and add sendstring LUT (#8438)Ryan2020-03-162-88/+259
|
* Update German keymap and sendstring LUT (#8437)Ryan2020-03-162-92/+147
|
* Update French keymap and sendstring LUT (#8436)Ryan2020-03-162-85/+156
|
* Update Brazilian keymap and add sendstring LUT (#8435)Ryan2020-03-162-50/+236
|
* Update Belgian keymap and sendstring LUT (#8349)Ryan2020-03-162-99/+162