qmk_firmware/quantum
Ted M Lin 552f8d81b9
Reduce PROGMEM usage for sendstring LUT (#8109)
* Reduce PROGMEM usage for keycode map

Bit-pack the keycode bool array to gain back a small amount of flash space.
The trade-off is an increase in runtime instructions when running macros.

It does make the code a bit harder to read, as well as maintain.

For configs that use send_string() et al, it saves ~100 bytes.

* Switch to macro and common definition

Rewrite the array declarations so both the unpacked (original) and
packed LUT arrays can use the same value definitions. This is done by
defining a macro that "knows what to do".

This makes the code much easier to read and maintain.

* Fix macro typos and improve perf

Pack the bits in a more efficient order for extraction.
And also fix the copy/paste error in the macro...

* Switch fully to packed LUT

Some minor reformatting.
Compile tested all sendstring_xyz.h to make sure they were converted
properly. Also checked that an unconverted version would generate a
compile error.

* Apply whitespace suggestions from code review

Co-Authored-By: Ryan <fauxpark@gmail.com>

Co-authored-by: Ryan <fauxpark@gmail.com>
2020-03-03 10:43:18 +11:00
..
api clang-format changes 2019-08-30 15:01:52 -07:00
audio 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
backlight Prune out pure software pwm && custom driver && remove wrapping BACKLIGHT_PIN (#8041) 2020-03-01 20:22:13 +00:00
debounce clang-format changes 2019-08-30 15:01:52 -07:00
keymap_extras Reduce PROGMEM usage for sendstring LUT (#8109) 2020-03-03 10:43:18 +11:00
process_keycode 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
rgb_matrix_animations RGB matrix effect - left-right gradient (#7742) 2020-01-07 21:25:17 +00:00
rgb_matrix_runners clang-format changes 2019-08-30 15:01:52 -07:00
serial_link 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
split_common Split - Avoid race condition during matrix_init_quantum (#8235) 2020-02-25 14:10:04 +00:00
stm32 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
template Send string keycode tweaks (#7471) 2019-11-25 23:16:58 -08:00
tools Backlight abstraction and other changes (#439) 2016-06-23 22:18:20 -04:00
visualizer 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
api.c clang-format changes 2019-08-30 15:01:52 -07:00
api.h clang-format changes 2019-08-30 15:01:52 -07:00
color.c Run clang-format manually to fix recently changed files (#7934) 2020-01-19 16:30:34 +00:00
color.h Use White channel on RGBW LEDs (#7678) 2019-12-31 16:33:49 +00:00
config_common.h Ensure setPinInput actually sets input high-Z (#6237) 2020-01-26 23:04:38 -05:00
debounce.h Removed #include "matrix.h" from debounce.h 2019-01-26 22:44:33 +11:00
dip_switch.c Run clang-format manually to fix recently changed files 2019-11-17 08:25:58 -08:00
dip_switch.h Add Dip Switch as a core feature (#6140) 2019-09-03 08:34:31 -07:00
dynamic_keymap.c dynamic keymap sanity check (#8181) 2020-02-17 17:54:13 -08:00
dynamic_keymap.h clang-format changes 2019-08-30 15:01:52 -07:00
dynamic_macro.h [Core] Convert Dynamic Macro to a Core Feature (#5948) 2019-11-04 22:59:13 -08:00
encoder.c 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
encoder.h Added encoder support to split common code (#5477) 2019-04-03 16:01:17 -07:00
fauxclicky.c clang-format changes 2019-08-30 15:01:52 -07:00
fauxclicky.h clang-format changes 2019-08-30 15:01:52 -07:00
keycode_config.c clang-format changes 2019-08-30 15:01:52 -07:00
keycode_config.h clang-format changes 2019-08-30 15:01:52 -07:00
keymap_common.c 2020 February 29 Breaking Changes Update (#8064) 2020-02-29 11:59:30 -08:00
keymap.h clang-format changes 2019-08-30 15:01:52 -07:00
led_matrix_drivers.c clang-format changes 2019-08-30 15:01:52 -07:00
led_matrix.c clang-format changes 2019-08-30 15:01:52 -07:00
led_tables.c Smoother Linear Light Table (#6764) 2019-09-18 18:32:38 -07:00
led_tables.h Move CIE1931 and breathing tables to its own file 2017-04-09 18:34:59 +03:00
ledmatrix.h clang-format changes 2019-08-30 15:01:52 -07:00
matrix_common.c Allow 30us matrix delay to be keyboard/user overridable (#8216) 2020-02-21 14:49:33 +11:00
matrix.c Allow 30us matrix delay to be keyboard/user overridable (#8216) 2020-02-21 14:49:33 +11:00
mcu_selection.mk Add Arm Teensys to mcu_selection.mk (#8026) 2020-02-21 17:12:15 +11:00
pincontrol.h clang-format changes 2019-08-30 15:01:52 -07:00
pointing_device.c clang-format changes 2019-08-30 15:01:52 -07:00
pointing_device.h clang-format changes 2019-08-30 15:01:52 -07:00
quantum_keycodes.h Run clang-format manually to fix recently changed files (#7934) 2020-01-19 16:30:34 +00:00
quantum.c Reduce PROGMEM usage for sendstring LUT (#8109) 2020-03-03 10:43:18 +11:00
quantum.h Reduce PROGMEM usage for sendstring LUT (#8109) 2020-03-03 10:43:18 +11:00
rgb_matrix_drivers.c Use White channel on RGBW LEDs (#7678) 2019-12-31 16:33:49 +00:00
rgb_matrix_types.h clang-format changes 2019-08-30 15:01:52 -07:00
rgb_matrix.c Run clang-format manually to fix recently changed files (#7934) 2020-01-19 16:30:34 +00:00
rgb_matrix.h Relocate RGB keycode processing (#7508) 2019-12-16 12:27:53 -08:00
rgb.h clang-format changes 2019-08-30 15:01:52 -07:00
rgblight_breathe_table.h clang-format changes 2019-08-30 15:01:52 -07:00
rgblight_list.h clang-format changes 2019-08-30 15:01:52 -07:00
rgblight_modes.h clang-format changes 2019-08-30 15:01:52 -07:00
rgblight_post_config.h clang-format changes 2019-08-30 15:01:52 -07:00
rgblight_reconfig.h clang-format changes 2019-08-30 15:01:52 -07:00
rgblight.c Add customisable EEPROM driver selection (#7274) 2020-01-24 12:45:58 +11:00
rgblight.h format code according to conventions [skip ci] 2020-01-20 18:48:28 +00:00
send_string_keycodes.h Add support for delays in send_string. (#8244) 2020-02-27 20:38:19 +11:00
variable_trace.c clang-format changes 2019-08-30 15:01:52 -07:00
variable_trace.h clang-format changes 2019-08-30 15:01:52 -07:00
velocikey.c clang-format changes 2019-08-30 15:01:52 -07:00
velocikey.h clang-format changes 2019-08-30 15:01:52 -07:00
via.c Add VIA support for QMK backlight, QMK RGBLight (#7911) 2020-01-20 10:18:25 -08:00
via.h Add VIA support for QMK backlight, QMK RGBLight (#7911) 2020-01-20 10:18:25 -08:00