diff options
| author | Drashna Jaelre <drashna@live.com> | 2018-09-28 07:24:08 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-09-28 10:46:47 -0400 |
| commit | 8847b2abbff5c6d55cf43402d394e9db751f728f (patch) | |
| tree | 32661cbefcb827618b6fa5f613fa7fd1b19d61c5 | |
| parent | a4bdab68370bc1497a7d5aa32d05bd8a6b3c3c14 (diff) | |
| download | qmk_firmware-8847b2abbff5c6d55cf43402d394e9db751f728f.tar.gz qmk_firmware-8847b2abbff5c6d55cf43402d394e9db751f728f.zip | |
Optimize size of Vitamins_Included keyboard
| -rw-r--r-- | keyboards/vitamins_included/config.h | 10 | ||||
| -rw-r--r-- | keyboards/vitamins_included/keymaps/default/config.h | 7 | ||||
| -rw-r--r-- | keyboards/vitamins_included/keymaps/default/keymap.c | 12 | ||||
| -rw-r--r-- | keyboards/vitamins_included/keymaps/default/rules.mk | 4 | ||||
| -rw-r--r-- | keyboards/vitamins_included/rules.mk | 5 |
5 files changed, 8 insertions, 30 deletions
diff --git a/keyboards/vitamins_included/config.h b/keyboards/vitamins_included/config.h index 27924ae46..abbb31056 100644 --- a/keyboards/vitamins_included/config.h +++ b/keyboards/vitamins_included/config.h | |||
| @@ -16,20 +16,12 @@ You should have received a copy of the GNU General Public License | |||
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #ifndef CONFIG_H | 19 | #pragma once |
| 20 | #define CONFIG_H | ||
| 21 | 20 | ||
| 22 | #include "config_common.h" | 21 | #include "config_common.h" |
| 23 | 22 | ||
| 24 | #if !defined(NO_DEBUG) && !defined(CONSOLE_ENABLE) | ||
| 25 | #define NO_DEBUG | ||
| 26 | #endif // !NO_DEBUG | ||
| 27 | #if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) | ||
| 28 | #define NO_PRINT | ||
| 29 | #endif // !NO_PRINT | ||
| 30 | #define NO_ACTION_MACRO | 23 | #define NO_ACTION_MACRO |
| 31 | #define NO_ACTION_FUNCTION | 24 | #define NO_ACTION_FUNCTION |
| 32 | 25 | ||
| 33 | #define DISABLE_LEADER | 26 | #define DISABLE_LEADER |
| 34 | 27 | ||
| 35 | #endif | ||
diff --git a/keyboards/vitamins_included/keymaps/default/config.h b/keyboards/vitamins_included/keymaps/default/config.h index 35f641a94..aba9fa7d4 100644 --- a/keyboards/vitamins_included/keymaps/default/config.h +++ b/keyboards/vitamins_included/keymaps/default/config.h | |||
| @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License | |||
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #ifndef CONFIG_USER_H | 21 | #pragma once |
| 22 | #define CONFIG_USER_H | ||
| 23 | |||
| 24 | #include "../../config.h" | ||
| 25 | 22 | ||
| 26 | /* Use I2C or Serial, not both */ | 23 | /* Use I2C or Serial, not both */ |
| 27 | 24 | ||
| @@ -40,5 +37,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 40 | SONG(COLEMAK_SOUND) \ | 37 | SONG(COLEMAK_SOUND) \ |
| 41 | } | 38 | } |
| 42 | #endif | 39 | #endif |
| 43 | |||
| 44 | #endif | ||
diff --git a/keyboards/vitamins_included/keymaps/default/keymap.c b/keyboards/vitamins_included/keymaps/default/keymap.c index f25e2fd32..13b48e764 100644 --- a/keyboards/vitamins_included/keymaps/default/keymap.c +++ b/keyboards/vitamins_included/keymaps/default/keymap.c | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | #include "action_layer.h" | ||
| 3 | #include "eeconfig.h" | ||
| 4 | 2 | ||
| 5 | extern keymap_config_t keymap_config; | 3 | extern keymap_config_t keymap_config; |
| 6 | 4 | ||
| @@ -141,28 +139,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 141 | 139 | ||
| 142 | }; | 140 | }; |
| 143 | 141 | ||
| 144 | void persistent_default_layer_set(uint16_t default_layer) { | ||
| 145 | eeconfig_update_default_layer(default_layer); | ||
| 146 | default_layer_set(default_layer); | ||
| 147 | } | ||
| 148 | 142 | ||
| 149 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 143 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 150 | switch (keycode) { | 144 | switch (keycode) { |
| 151 | case QWERTY: | 145 | case QWERTY: |
| 152 | if (record->event.pressed) { | 146 | if (record->event.pressed) { |
| 153 | persistent_default_layer_set(1UL<<_QWERTY); | 147 | set_single_persistent_default_layer(_QWERTY); |
| 154 | } | 148 | } |
| 155 | return false; | 149 | return false; |
| 156 | break; | 150 | break; |
| 157 | case COLEMAK: | 151 | case COLEMAK: |
| 158 | if (record->event.pressed) { | 152 | if (record->event.pressed) { |
| 159 | persistent_default_layer_set(1UL<<_COLEMAK); | 153 | set_single_persistent_default_layer(_COLEMAK); |
| 160 | } | 154 | } |
| 161 | return false; | 155 | return false; |
| 162 | break; | 156 | break; |
| 163 | case DVORAK: | 157 | case DVORAK: |
| 164 | if (record->event.pressed) { | 158 | if (record->event.pressed) { |
| 165 | persistent_default_layer_set(1UL<<_DVORAK); | 159 | set_single_persistent_default_layer(_DVORAK); |
| 166 | } | 160 | } |
| 167 | return false; | 161 | return false; |
| 168 | break; | 162 | break; |
diff --git a/keyboards/vitamins_included/keymaps/default/rules.mk b/keyboards/vitamins_included/keymaps/default/rules.mk index 457a3d01d..8b1378917 100644 --- a/keyboards/vitamins_included/keymaps/default/rules.mk +++ b/keyboards/vitamins_included/keymaps/default/rules.mk | |||
| @@ -1,3 +1 @@ | |||
| 1 | ifndef QUANTUM_DIR | ||
| 2 | include ../../../../Makefile | ||
| 3 | endif | ||
diff --git a/keyboards/vitamins_included/rules.mk b/keyboards/vitamins_included/rules.mk index 2291b2116..8ac39dffb 100644 --- a/keyboards/vitamins_included/rules.mk +++ b/keyboards/vitamins_included/rules.mk | |||
| @@ -56,7 +56,7 @@ BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | |||
| 56 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | 56 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) |
| 57 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 57 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 58 | CONSOLE_ENABLE = no # Console for debug(+400) | 58 | CONSOLE_ENABLE = no # Console for debug(+400) |
| 59 | COMMAND_ENABLE = yes # Commands for debug and configuration | 59 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 60 | NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 60 | NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 61 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | 61 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
| 62 | MIDI_ENABLE = no # MIDI controls | 62 | MIDI_ENABLE = no # MIDI controls |
| @@ -64,7 +64,6 @@ AUDIO_ENABLE = no # Audio output on port C6 | |||
| 64 | UNICODE_ENABLE = no # Unicode | 64 | UNICODE_ENABLE = no # Unicode |
| 65 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | 65 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID |
| 66 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | 66 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. |
| 67 | USE_I2C = no | ||
| 68 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 67 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 69 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 68 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 70 | 69 | ||
| @@ -74,4 +73,4 @@ LAYOUTS = ortho_4x12 | |||
| 74 | 73 | ||
| 75 | DEFAULT_FOLDER = vitamins_included/rev1 | 74 | DEFAULT_FOLDER = vitamins_included/rev1 |
| 76 | 75 | ||
| 77 | EXTRAFLAGS += -flto \ No newline at end of file | 76 | EXTRAFLAGS += -flto |
