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_code.h clang-format changes 2019-08-30 15:01:52 -07:00
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 clang-format changes 2019-08-30 15:01:52 -07:00
action_macro.h clang-format changes 2019-08-30 15:01:52 -07:00
action_tapping.c Implement and document TAPPING_FORCE_HOLD_PER_KEY (#7859) 2020-01-17 15:49:23 -05:00
action_tapping.h clang-format changes 2019-08-30 15:01:52 -07:00
action_util.c clang-format changes 2019-08-30 15:01:52 -07:00
action_util.h clang-format changes 2019-08-30 15:01:52 -07: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
bootloader.h clang-format changes 2019-08-30 15:01:52 -07:00
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 clang-format changes 2019-08-30 15:01:52 -07:00
debug.c clang-format changes 2019-08-30 15:01:52 -07:00
debug.h clang-format changes 2019-08-30 15:01:52 -07:00
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_driver.h clang-format changes 2019-08-30 15:01:52 -07: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
keyboard.c Move rgblight and backlight task to common location (#7733) 2020-01-19 00:59:09 +00:00
keyboard.h clang-format changes 2019-08-30 15:01:52 -07:00
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 clang-format changes 2019-08-30 15:01:52 -07:00
magic.h MAGIC functionality, AG swap in default layout 2016-04-16 18:51:58 -04:00
matrix.h Move some common matrix code to a common location (#7699) 2020-01-04 20:29:44 +00:00
mousekey.c clang-format changes 2019-08-30 15:01:52 -07:00
mousekey.h clang-format changes 2019-08-30 15:01:52 -07:00
nodebug.h clang-format changes 2019-08-30 15:01:52 -07:00
print.c clang-format changes 2019-08-30 15:01:52 -07:00
print.h Remove mbed files (#7605) 2019-12-11 11:36:00 -08:00
progmem.h clang-format changes 2019-08-30 15:01:52 -07:00
raw_hid.h clang-format changes 2019-08-30 15:01:52 -07:00
report.c clang-format changes 2019-08-30 15:01:52 -07:00
report.h Use function for KEYCODE2 routines instead of macro. (#8101) 2020-02-07 12:53:43 +11:00
sendchar_null.c clang-format changes 2019-08-30 15:01:52 -07:00
sendchar_uart.c clang-format changes 2019-08-30 15:01:52 -07:00
sendchar.h clang-format changes 2019-08-30 15:01:52 -07:00
sleep_led.h clang-format changes 2019-08-30 15:01:52 -07:00
suspend.h clang-format changes 2019-08-30 15:01:52 -07:00
timer.h Fixing wrapping math logic for timer_expired functions (#6746) 2019-09-23 00:52:33 +10:00
uart.c clang-format changes 2019-08-30 15:01:52 -07:00
uart.h clang-format changes 2019-08-30 15:01:52 -07:00
util.c clang-format changes 2019-08-30 15:01:52 -07:00
util.h Wrap util.h functions in extern "C" (#6762) 2019-10-04 09:24:47 +10:00
virtser.h Added USB Virtual Serial support 2016-08-23 04:16:35 +00:00
wait.h Remove mbed files (#7605) 2019-12-11 11:36:00 -08:00