qmk_firmware/quantum
Liyang HU 383fae55c5
Refactor quantum/command.{c,h} for code size & {read,maintain}ability (#11842)
* quantum/command.c: coalesce `print()`s in `command_common_help()` & `print_version()`

Also undo some damage by clang-format in b624f32f94

* quantum/command.c: replace `print(…); print_{,val_}{dec,hex}*(…);` sequences with single `xprintf(…)`

`print_{dec,hex}*(…)` are just `#define`s for `xprintf(…)` anyway.

Each additional `xprintf(…)` costs ~8 bytes: the call instructions,
plus an additional NUL terminator.

This _really_ adds up: this commit saves 814 bytes on my ATmega32.

* quantum/command.c: optimise `mousekey_console()` for size & legibility

Made various tweaks to the interface, but still functionally identical.

Assume `KC_1`…`KC_0` to be contiguous, and removed `numkey2num(…)` entirely.
It was exported in `command.h` by 1a0bac8bcc for no obvious reason, before
which it was `static`. I doubt anyone uses it.

`mousekey_console()` is now enabled regardless of `MK_3_SPEED`.
Needs fleshing out for things other than the X11 variant though.

This commit saves 638 bytes on my ATmega32.
2021-08-07 17:12:57 +10:00
..
api
audio Refactor some platform dependent logic (#13675) 2021-07-24 19:56:45 +01:00
backlight
bootmagic Remove Full Bootmagic (#13846) 2021-08-06 23:59:56 -07:00
debounce
keymap_extras Merge remote-tracking branch 'origin/master' into develop 2021-07-20 16:17:22 +00:00
led_matrix Switch Ergodox Infinity over to split_common (#13481) 2021-07-19 18:54:32 -07:00
logging Move print/debug files to quantum (#12069) 2021-08-03 18:49:33 +01:00
process_keycode Process combos earlier & overlapping combos (#8591) 2021-08-06 09:44:57 +10:00
rgb_matrix Align AW20216 driver (#13712) 2021-07-27 23:55:51 +01:00
rgblight Merge remote-tracking branch 'upstream/master' into develop 2021-07-25 12:17:15 +10:00
sequencer matrix_scan_x -> x_task (#13748) 2021-07-28 12:01:23 +01:00
serial_link
split_common Avoid LTO conficts on arm_atsam (#13676) 2021-07-24 12:13:06 +01:00
template Remove Full Bootmagic (#13846) 2021-08-06 23:59:56 -07:00
tools
visualizer
api.c
api.h
bitwise.c
bitwise.h
color.c
color.h
command.c Refactor quantum/command.{c,h} for code size & {read,maintain}ability (#11842) 2021-08-07 17:12:57 +10:00
command.h Refactor quantum/command.{c,h} for code size & {read,maintain}ability (#11842) 2021-08-07 17:12:57 +10:00
config_common.h
crc.c
crc.h
debounce.h
dip_switch.c
dip_switch.h
dynamic_keymap.c
dynamic_keymap.h
dynamic_macro.h
encoder.c
encoder.h
haptic.c Haptic: driver-> feature (#13713) 2021-07-25 19:14:58 -07:00
haptic.h Haptic: driver-> feature (#13713) 2021-07-25 19:14:58 -07:00
joystick.c
joystick.h
keycode_config.c
keycode_config.h
keymap_common.c Process combos earlier & overlapping combos (#8591) 2021-08-06 09:44:57 +10:00
keymap.h
led_tables.c
led_tables.h
led.c
led.h
matrix_common.c
matrix.c
matrix.h
mcu_selection.mk
mousekey.c
mousekey.h
pointing_device.c
pointing_device.h
quantum_keycodes.h [Feature] Key Overrides (#11422) 2021-07-13 10:13:51 -07:00
quantum.c Process combos earlier & overlapping combos (#8591) 2021-08-06 09:44:57 +10:00
quantum.h Merge remote-tracking branch 'origin/master' into develop 2021-08-06 05:54:10 +00:00
ring_buffer.h
send_string_keycodes.h
send_string.c Move SENDSTRING_BELL code to send_string.h (#13566) 2021-07-16 09:40:20 -07:00
send_string.h
util.h
variable_trace.c
variable_trace.h
velocikey.c
velocikey.h
via_ensure_keycode.h
via.c
via.h
wpm.c Fix overflows in WPM calculations (#13128) 2021-08-04 07:40:08 +10:00
wpm.h