Remove build option firmware size impacts (#6947)
* Update rules.mk template to remove build option size impacts * Add rules.mk cleaning script * Update all rules.mk files to remove build option firmware size impact messages * Remove references to feature filesize in documentation * Revert "Update all rules.mk files to remove build option firmware size impact messages" This reverts commit 7cfe70976bcc223bf47c960b2e6af8596df80a32. * Fix regex in cleanup script and exclude keymaps/ directories * Update quantum/template/avr/rules.mk Fixed missing tabs/spaces. Co-Authored-By: fauxpark <fauxpark@gmail.com>
This commit is contained in:
parent
1b1e0977e0
commit
b23f6011c3
6 changed files with 58 additions and 25 deletions
|
@ -310,13 +310,13 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i
|
||||||
Use these to enable or disable building certain features. The more you have enabled the bigger your firmware will be, and you run the risk of building a firmware too large for your MCU.
|
Use these to enable or disable building certain features. The more you have enabled the bigger your firmware will be, and you run the risk of building a firmware too large for your MCU.
|
||||||
|
|
||||||
* `BOOTMAGIC_ENABLE`
|
* `BOOTMAGIC_ENABLE`
|
||||||
* Virtual DIP switch configuration(+1000)
|
* Virtual DIP switch configuration
|
||||||
* `MOUSEKEY_ENABLE`
|
* `MOUSEKEY_ENABLE`
|
||||||
* Mouse keys(+4700)
|
* Mouse keys
|
||||||
* `EXTRAKEY_ENABLE`
|
* `EXTRAKEY_ENABLE`
|
||||||
* Audio control and System control(+450)
|
* Audio control and System control
|
||||||
* `CONSOLE_ENABLE`
|
* `CONSOLE_ENABLE`
|
||||||
* Console for debug(+400)
|
* Console for debug
|
||||||
* `COMMAND_ENABLE`
|
* `COMMAND_ENABLE`
|
||||||
* Commands for debug and configuration
|
* Commands for debug and configuration
|
||||||
* `COMBO_ENABLE`
|
* `COMBO_ENABLE`
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
This is an integration of Peter Fleury's LCD library. This page will explain the basics. [For in depth documentation visit his page.](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html)
|
This is an integration of Peter Fleury's LCD library. This page will explain the basics. [For in depth documentation visit his page.](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html)
|
||||||
|
|
||||||
You can enable support for HD44780 Displays by setting the `HD44780_ENABLE` flag in your keyboards `rules.mk` to yes. This will use about 400 KB of extra space.
|
You can enable support for HD44780 Displays by setting the `HD44780_ENABLE` flag in your keyboards `rules.mk` to yes.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Terminal
|
# Terminal
|
||||||
|
|
||||||
> This feature is currently *huge* at 4400 bytes, and should probably only be put on boards with a lot of memory, or for fun.
|
> This feature is currently *huge*, and should probably only be put on boards with a lot of memory, or for fun.
|
||||||
|
|
||||||
The terminal feature is a command-line-like interface designed to communicate through a text editor with keystrokes. It's beneficial to turn off auto-indent features in your editor.
|
The terminal feature is a command-line-like interface designed to communicate through a text editor with keystrokes. It's beneficial to turn off auto-indent features in your editor.
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,6 @@ Set these variables to `no` to disable them, and `yes` to enable them.
|
||||||
|
|
||||||
This allows you to hold a key and the salt key (space by default) and have access to a various EEPROM settings that persist over power loss. It's advised you keep this disabled, as the settings are often changed by accident, and produce confusing results that makes it difficult to debug. It's one of the more common problems encountered in help sessions.
|
This allows you to hold a key and the salt key (space by default) and have access to a various EEPROM settings that persist over power loss. It's advised you keep this disabled, as the settings are often changed by accident, and produce confusing results that makes it difficult to debug. It's one of the more common problems encountered in help sessions.
|
||||||
|
|
||||||
Consumes about 1000 bytes.
|
|
||||||
|
|
||||||
`MOUSEKEY_ENABLE`
|
`MOUSEKEY_ENABLE`
|
||||||
|
|
||||||
This gives you control over cursor movements and clicks via keycodes/custom functions.
|
This gives you control over cursor movements and clicks via keycodes/custom functions.
|
||||||
|
@ -67,8 +65,6 @@ To see the text, open `hid_listen` and enjoy looking at your printed messages.
|
||||||
|
|
||||||
**NOTE:** Do not include *uprint* messages in anything other than your keymap code. It must not be used within the QMK system framework. Otherwise, you will bloat other people's .hex files.
|
**NOTE:** Do not include *uprint* messages in anything other than your keymap code. It must not be used within the QMK system framework. Otherwise, you will bloat other people's .hex files.
|
||||||
|
|
||||||
Consumes about 400 bytes.
|
|
||||||
|
|
||||||
`COMMAND_ENABLE`
|
`COMMAND_ENABLE`
|
||||||
|
|
||||||
This enables magic commands, typically fired with the default magic key combo `LSHIFT+RSHIFT+KEY`. Magic commands include turning on debugging messages (`MAGIC+D`) or temporarily toggling NKRO (`MAGIC+N`).
|
This enables magic commands, typically fired with the default magic key combo `LSHIFT+RSHIFT+KEY`. Magic commands include turning on debugging messages (`MAGIC+D`) or temporarily toggling NKRO (`MAGIC+N`).
|
||||||
|
@ -125,11 +121,9 @@ Use this to debug changes to variable values, see the [tracing variables](unit_t
|
||||||
|
|
||||||
This enables using the Quantum SYSEX API to send strings (somewhere?)
|
This enables using the Quantum SYSEX API to send strings (somewhere?)
|
||||||
|
|
||||||
This consumes about 5390 bytes.
|
|
||||||
|
|
||||||
`KEY_LOCK_ENABLE`
|
`KEY_LOCK_ENABLE`
|
||||||
|
|
||||||
This enables [key lock](feature_key_lock.md). This consumes an additional 260 bytes.
|
This enables [key lock](feature_key_lock.md).
|
||||||
|
|
||||||
`SPLIT_KEYBOARD`
|
`SPLIT_KEYBOARD`
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,10 @@ BOOTLOADER = atmel-dfu
|
||||||
# Build Options
|
# Build Options
|
||||||
# change yes to no to disable
|
# change yes to no to disable
|
||||||
#
|
#
|
||||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
CONSOLE_ENABLE = yes # Console for debug
|
||||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
@ -34,9 +34,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
NKRO_ENABLE = no # USB Nkey Rollover
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
MIDI_ENABLE = no # MIDI support
|
||||||
UNICODE_ENABLE = no # Unicode
|
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
AUDIO_ENABLE = no # Audio output on port C6
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||||
|
|
40
util/rules_cleaner.sh
Executable file
40
util/rules_cleaner.sh
Executable file
|
@ -0,0 +1,40 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script finds all rules.mk files in keyboards/ subdirectories,
|
||||||
|
# and deletes the build option filesize impacts from them.
|
||||||
|
|
||||||
|
# Print an error message with the word "ERROR" in red.
|
||||||
|
echo_error() {
|
||||||
|
echo -e "[\033[0;91mERROR\033[m]: $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# If we've been started from util/, we want to be in qmk_firmware/
|
||||||
|
[[ "$PWD" == *util ]] && cd ..
|
||||||
|
|
||||||
|
# The root qmk_firmware/ directory should have a subdirectory called quantum/
|
||||||
|
if [ ! -d "quantum" ]; then
|
||||||
|
echo_error "Could not detect the QMK firmware directory!"
|
||||||
|
echo_error "Are you sure you're in the right place?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set the inplace editing parameter for sed.
|
||||||
|
# macOS/BSD sed expects a file extension immediately following -i.
|
||||||
|
set_sed_i() {
|
||||||
|
sed_i=(-i)
|
||||||
|
|
||||||
|
case $(uname -a) in
|
||||||
|
*Darwin*) sed_i=(-i "")
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
set_sed_i
|
||||||
|
|
||||||
|
# Exclude keyamps/ directories
|
||||||
|
files=$(find keyboards -type f -name 'rules.mk' -not \( -path '*/keymaps*' -prune \))
|
||||||
|
|
||||||
|
# Edit rules.mk files
|
||||||
|
for file in $files; do
|
||||||
|
sed "${sed_i[@]}" -e "s/(+[0-9].*)$//g" "$file"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Cleaned up rules.mk files."
|
Loading…
Reference in a new issue