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
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
action_code.h
action_layer.c
action_layer.h
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
bootmagic.h
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
host.h
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
led.h
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
virtser.h
wait.h Remove mbed files (#7605) 2019-12-11 11:36:00 -08:00