qmk_firmware/tmk_core/common
Ted M Lin d84eb14b3a
Use function for KEYCODE2 routines instead of macro. (#8101)
* Option to use function for KEYCODE2 routines.

Convert the KEYCODE2SYSTEM and KEYCODE2CONSUMER macros to functions,
defaulting to using the macros.  The function form allows the compiler
to optimize the switch statement itself, over the macro nested
ternaries.

To enable this feature, #define USE_KEYCODE2_FUNCTION.

Testing against a random selection of avr-based keyboards, this
increased available flash by ~500 bytes. For arm-based keyboards,
the available flash increased by ~400 bytes.

* Replace macro with function entirely.

As zvecr states, go bold and just commit to using the function instead
of the macro.

* Reformat whitespace now that functional review is done

Verified against clang-format output.
2020-02-07 12:53:43 +11:00
..
arm_atsam format code according to conventions [skip ci] 2020-01-24 02:15:29 +00:00
avr Move tmk_core/common/backlight to quantum/backlight (#6710) 2019-10-17 17:48:58 +01:00
chibios format code according to conventions [skip ci] 2020-02-01 09:46:34 +00:00
test Add customisable EEPROM driver selection (#7274) 2020-01-24 12:45:58 +11:00
action.c Run clang-format manually to fix recently changed files (#7934) 2020-01-19 16:30:34 +00:00
action.h Fix bug in do_code16() (#6935) 2019-10-16 00:02:09 +01:00
action_code.h
action_layer.c Fix LAYER_STATE_8BIT compile issues (#7304) 2019-11-08 18:23:26 -08:00
action_layer.h Fix LAYER_STATE_8BIT compile issues (#7304) 2019-11-08 18:23:26 -08:00
action_macro.c
action_macro.h
action_tapping.c Implement and document TAPPING_FORCE_HOLD_PER_KEY (#7859) 2020-01-17 15:49:23 -05:00
action_tapping.h
action_util.c
action_util.h
bootloader.h
bootmagic.c ARM split - Add bootmagic/magic keycodes for setting handedness (#6545) 2019-09-24 15:24:12 +01:00
bootmagic.h ARM split - Add bootmagic/magic keycodes for setting handedness (#6545) 2019-09-24 15:24:12 +01:00
command.c Remove KEYMAP_SECTION_ENABLE (#7882) 2020-01-17 00:32:09 +11:00
command.h
debug.c
debug.h
eeconfig.c Add customisable EEPROM driver selection (#7274) 2020-01-24 12:45:58 +11:00
eeconfig.h VIA Configurator Refactor (#7268) 2020-01-03 12:52:00 -08:00
eeprom.h Add customisable EEPROM driver selection (#7274) 2020-01-24 12:45:58 +11:00
host.c Run clang-format manually to fix recently changed files 2019-11-17 08:25:58 -08:00
host.h New and improved lock LED callbacks (#7215) 2019-11-06 00:42:16 +00:00
host_driver.h
keyboard.c Move rgblight and backlight task to common location (#7733) 2020-01-19 00:59:09 +00:00
keyboard.h
keycode.h Add 4-character aliases for sendstring keycodes (#7409) 2019-11-22 14:11:28 +11:00
led.h Run clang-format manually to fix recently changed files 2019-11-17 08:25:58 -08:00
magic.c
magic.h
matrix.h Move some common matrix code to a common location (#7699) 2020-01-04 20:29:44 +00:00
mousekey.c
mousekey.h
nodebug.h
print.c
print.h Remove mbed files (#7605) 2019-12-11 11:36:00 -08:00
progmem.h
raw_hid.h
report.c
report.h Use function for KEYCODE2 routines instead of macro. (#8101) 2020-02-07 12:53:43 +11:00
sendchar.h
sendchar_null.c
sendchar_uart.c
sleep_led.h
suspend.h
timer.h
uart.c
uart.h
util.c
util.h Wrap util.h functions in extern "C" (#6762) 2019-10-04 09:24:47 +10:00
virtser.h
wait.h Remove mbed files (#7605) 2019-12-11 11:36:00 -08:00