aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/config_options.md10
-rw-r--r--docs/feature_hd44780.md8
-rw-r--r--docs/feature_terminal.md4
-rw-r--r--docs/getting_started_make_guide.md8
-rw-r--r--quantum/template/avr/rules.mk13
-rwxr-xr-xutil/rules_cleaner.sh40
6 files changed, 58 insertions, 25 deletions
diff --git a/docs/config_options.md b/docs/config_options.md
index ec3d1a1c8..abd98ec8a 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -310,13 +310,13 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i
310Use 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. 310Use 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.
311 311
312* `BOOTMAGIC_ENABLE` 312* `BOOTMAGIC_ENABLE`
313 * Virtual DIP switch configuration(+1000) 313 * Virtual DIP switch configuration
314* `MOUSEKEY_ENABLE` 314* `MOUSEKEY_ENABLE`
315 * Mouse keys(+4700) 315 * Mouse keys
316* `EXTRAKEY_ENABLE` 316* `EXTRAKEY_ENABLE`
317 * Audio control and System control(+450) 317 * Audio control and System control
318* `CONSOLE_ENABLE` 318* `CONSOLE_ENABLE`
319 * Console for debug(+400) 319 * Console for debug
320* `COMMAND_ENABLE` 320* `COMMAND_ENABLE`
321 * Commands for debug and configuration 321 * Commands for debug and configuration
322* `COMBO_ENABLE` 322* `COMBO_ENABLE`
@@ -348,7 +348,7 @@ Use these to enable or disable building certain features. The more you have enab
348* `NO_USB_STARTUP_CHECK` 348* `NO_USB_STARTUP_CHECK`
349 * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. 349 * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
350* `LINK_TIME_OPTIMIZATION_ENABLE` 350* `LINK_TIME_OPTIMIZATION_ENABLE`
351 = Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION` 351 = Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
352 352
353## USB Endpoint Limitations 353## USB Endpoint Limitations
354 354
diff --git a/docs/feature_hd44780.md b/docs/feature_hd44780.md
index e0838948a..0a174035b 100644
--- a/docs/feature_hd44780.md
+++ b/docs/feature_hd44780.md
@@ -2,7 +2,7 @@
2 2
3This 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) 3This 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)
4 4
5You 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. 5You can enable support for HD44780 Displays by setting the `HD44780_ENABLE` flag in your keyboards `rules.mk` to yes.
6 6
7## Configuration 7## Configuration
8 8
@@ -26,7 +26,7 @@ Uncomment the section labled HD44780 and change the parameters as needed.
26#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 26#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
27#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 27#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
28#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 28#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
29#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 29#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
30#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 30#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
31#define LCD_RS_PORT LCD_PORT //< port for RS line 31#define LCD_RS_PORT LCD_PORT //< port for RS line
32#define LCD_RS_PIN 3 //< pin for RS line 32#define LCD_RS_PIN 3 //< pin for RS line
@@ -39,14 +39,14 @@ Uncomment the section labled HD44780 and change the parameters as needed.
39 39
40Should you need to configure other properties you can copy them from `quantum/hd44780.h` and set them in your `config.h` 40Should you need to configure other properties you can copy them from `quantum/hd44780.h` and set them in your `config.h`
41 41
42## Usage 42## Usage
43 43
44To initialize your display, call `lcd_init()` with one of these parameters: 44To initialize your display, call `lcd_init()` with one of these parameters:
45```` 45````
46LCD_DISP_OFF : display off 46LCD_DISP_OFF : display off
47LCD_DISP_ON : display on, cursor off 47LCD_DISP_ON : display on, cursor off
48LCD_DISP_ON_CURSOR : display on, cursor on 48LCD_DISP_ON_CURSOR : display on, cursor on
49LCD_DISP_ON_CURSOR_BLINK : display on, cursor on flashing 49LCD_DISP_ON_CURSOR_BLINK : display on, cursor on flashing
50```` 50````
51This is best done in your keyboards `matrix_init_kb` or your keymaps `matrix_init_user`. 51This is best done in your keyboards `matrix_init_kb` or your keymaps `matrix_init_user`.
52It is advised to clear the display before use. 52It is advised to clear the display before use.
diff --git a/docs/feature_terminal.md b/docs/feature_terminal.md
index 1863599f8..f85062216 100644
--- a/docs/feature_terminal.md
+++ b/docs/feature_terminal.md
@@ -1,6 +1,6 @@
1# Terminal 1# Terminal
2 2
3> This feature is currently *huge* at 4400 bytes, and should probably only be put on boards with a lot of memory, or for fun. 3> This feature is currently *huge*, and should probably only be put on boards with a lot of memory, or for fun.
4 4
5The 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. 5The 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.
6 6
@@ -56,7 +56,7 @@ Outputs the last 5 commands entered
561. help 561. help
572. about 572. about
583. keymap 0 583. keymap 0
594. help 594. help
605. flush-buffer 605. flush-buffer
61``` 61```
62 62
diff --git a/docs/getting_started_make_guide.md b/docs/getting_started_make_guide.md
index 71e9d33f2..d1ecf6f5a 100644
--- a/docs/getting_started_make_guide.md
+++ b/docs/getting_started_make_guide.md
@@ -41,8 +41,6 @@ Set these variables to `no` to disable them, and `yes` to enable them.
41 41
42This 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. 42This 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.
43 43
44Consumes about 1000 bytes.
45
46`MOUSEKEY_ENABLE` 44`MOUSEKEY_ENABLE`
47 45
48This gives you control over cursor movements and clicks via keycodes/custom functions. 46This 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.
67 65
68**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. 66**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.
69 67
70Consumes about 400 bytes.
71
72`COMMAND_ENABLE` 68`COMMAND_ENABLE`
73 69
74This 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`). 70This 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
125 121
126This enables using the Quantum SYSEX API to send strings (somewhere?) 122This enables using the Quantum SYSEX API to send strings (somewhere?)
127 123
128This consumes about 5390 bytes.
129
130`KEY_LOCK_ENABLE` 124`KEY_LOCK_ENABLE`
131 125
132This enables [key lock](feature_key_lock.md). This consumes an additional 260 bytes. 126This enables [key lock](feature_key_lock.md).
133 127
134`SPLIT_KEYBOARD` 128`SPLIT_KEYBOARD`
135 129
diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk
index 0ed05e71b..bb2bd14f9 100644
--- a/quantum/template/avr/rules.mk
+++ b/quantum/template/avr/rules.mk
@@ -23,10 +23,10 @@ BOOTLOADER = atmel-dfu
23# Build Options 23# Build Options
24# change yes to no to disable 24# change yes to no to disable
25# 25#
26BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) 26BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
27MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 27MOUSEKEY_ENABLE = yes # Mouse keys
28EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 28EXTRAKEY_ENABLE = yes # Audio control and System control
29CONSOLE_ENABLE = yes # Console for debug(+400) 29CONSOLE_ENABLE = yes # Console for debug
30COMMAND_ENABLE = yes # Commands for debug and configuration 30COMMAND_ENABLE = yes # Commands for debug and configuration
31# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 31# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
32SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 32SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
@@ -34,9 +34,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
34NKRO_ENABLE = no # USB Nkey Rollover 34NKRO_ENABLE = no # USB Nkey Rollover
35BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 35BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
36RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow 36RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
37MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) 37MIDI_ENABLE = no # MIDI support
38UNICODE_ENABLE = no # Unicode
39BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 38BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
40AUDIO_ENABLE = no # Audio output on port C6 39AUDIO_ENABLE = no # Audio output on port C6
41FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches 40FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
42HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) 41HD44780_ENABLE = no # Enable support for HD44780 based LCDs
diff --git a/util/rules_cleaner.sh b/util/rules_cleaner.sh
new file mode 100755
index 000000000..ac27c2b09
--- /dev/null
+++ b/util/rules_cleaner.sh
@@ -0,0 +1,40 @@
1#!/bin/bash
2
3# This script finds all rules.mk files in keyboards/ subdirectories,
4# and deletes the build option filesize impacts from them.
5
6# Print an error message with the word "ERROR" in red.
7echo_error() {
8 echo -e "[\033[0;91mERROR\033[m]: $1"
9}
10
11# If we've been started from util/, we want to be in qmk_firmware/
12[[ "$PWD" == *util ]] && cd ..
13
14# The root qmk_firmware/ directory should have a subdirectory called quantum/
15if [ ! -d "quantum" ]; then
16 echo_error "Could not detect the QMK firmware directory!"
17 echo_error "Are you sure you're in the right place?"
18 exit 1
19fi
20
21# Set the inplace editing parameter for sed.
22# macOS/BSD sed expects a file extension immediately following -i.
23set_sed_i() {
24 sed_i=(-i)
25
26 case $(uname -a) in
27 *Darwin*) sed_i=(-i "")
28 esac
29}
30set_sed_i
31
32# Exclude keyamps/ directories
33files=$(find keyboards -type f -name 'rules.mk' -not \( -path '*/keymaps*' -prune \))
34
35# Edit rules.mk files
36for file in $files; do
37 sed "${sed_i[@]}" -e "s/(+[0-9].*)$//g" "$file"
38done
39
40echo "Cleaned up rules.mk files."