]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
Add build option BOOTMAGIC_ENABLE
authortmk <nobody@nowhere>
Mon, 11 Mar 2013 06:28:14 +0000 (15:28 +0900)
committertmk <nobody@nowhere>
Mon, 11 Mar 2013 06:28:46 +0000 (15:28 +0900)
common.mk
common/command.c
common/keyboard.c
keyboard/gh60/Makefile.lufa
keyboard/gh60/Makefile.pjrc

index 2735f5becfaeafc0f9cb2a5ae0814236069e3839..f9faf2f95b18082aa90edd3fd2fe89283baeca07 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -10,12 +10,16 @@ SRC +=      $(COMMON_DIR)/host.c \
        $(COMMON_DIR)/print.c \
        $(COMMON_DIR)/debug.c \
        $(COMMON_DIR)/bootloader.c \
-       $(COMMON_DIR)/bootmagic.c \
-       $(COMMON_DIR)/eeconfig.c \
        $(COMMON_DIR)/util.c
 
 
 # Option modules
+ifdef BOOTMAGIC_ENABLE
+    SRC += $(COMMON_DIR)/bootmagic.c
+    SRC += $(COMMON_DIR)/eeconfig.c
+    OPT_DEFS += -DBOOTMAGIC_ENABLE
+endif
+
 ifdef MOUSEKEY_ENABLE
     SRC += $(COMMON_DIR)/mousekey.c
     OPT_DEFS += -DMOUSEKEY_ENABLE
index d7ba3f232a31a60ed94d5a971b9601d09fe4bbce..372ca291e2cf4e0417f8f744921987134b5b153d 100644 (file)
@@ -123,6 +123,7 @@ static void command_common_help(void)
     print("Paus:       jump to bootloader\n");
 }
 
+#ifdef BOOTMAGIC_ENABLE
 static void print_eeprom_config(void)
 {
     uint8_t eebyte;
@@ -145,15 +146,18 @@ static void print_eeprom_config(void)
     print("keyconf.swap_grave_esc: "); print_hex8(kc.swap_grave_esc); print("\n");
     print("keyconf.swap_backslash_backspace: "); print_hex8(kc.swap_backslash_backspace); print("\n");
 }
+#endif
 
 static bool command_common(uint8_t code)
 {
     static host_driver_t *host_driver = 0;
     switch (code) {
+#ifdef BOOTMAGIC_ENABLE
         case KC_E:
             print("eeprom config\n");
             print_eeprom_config();
             break;
+#endif
         case KC_CAPSLOCK:
             if (host_get_driver()) {
                 host_driver = host_get_driver();
index 1acb79861da04bb76d70702f0f8fbdc672115c81..401fdb4e17f311be9bdae5d6f991f8ac4aff6bd1 100644 (file)
@@ -29,10 +29,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "util.h"
 #include "sendchar.h"
 #include "bootmagic.h"
-#ifdef MOUSEKEY_ENABLE
-#include "mousekey.h"
-#endif
 #include "eeconfig.h"
+#include "mousekey.h"
 
 
 #ifdef MATRIX_HAS_GHOST
@@ -64,6 +62,7 @@ void keyboard_init(void)
     ps2_mouse_init();
 #endif
 
+#ifdef BOOTMAGIC_ENABLE
     bootmagic();
 
     if (eeconfig_is_enabled()) {
@@ -77,6 +76,7 @@ void keyboard_init(void)
     } else {
         eeconfig_init();
     }
+#endif
 }
 
 /*
index b885b7dfa162b2d5a6b698e7c4dddc88dd3d9d7d..a5ff609a778698569e1d5d372c5302aa1f3868f9 100644 (file)
@@ -47,8 +47,7 @@ TOP_DIR = ../..
 # Directory keyboard dependent files exist
 TARGET_DIR = .
 
-
-# List C source files here. (C dependencies are automatically generated.)
+# project specific files
 SRC += keymap.c \
        matrix.c \
        led.c
@@ -100,6 +99,7 @@ F_USB = $(F_CPU)
 # Build Options
 #   comment out to disable the options.
 #
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
 MOUSEKEY_ENABLE = yes  # Mouse keys(+4700)
 EXTRAKEY_ENABLE = yes  # Audio control and System control(+450)
 CONSOLE_ENABLE = yes   # Console for debug(+400)
index 2538c0c6bbbcdf7ec320832a569c1d9420e99ace..f03ca9416d28bc4bcb772676c533ebcd0c90b51f 100644 (file)
@@ -47,7 +47,7 @@ TOP_DIR = ../..
 # Directory keyboard dependent files exist
 TARGET_DIR = .
 
-# keyboard dependent files
+# project specific files
 SRC =  keymap.c \
        matrix.c \
        led.c
@@ -57,10 +57,8 @@ CONFIG_H = config.h
 
 # MCU name, you MUST set this to match the board you are using
 # type "make clean" after changing this, so all files will be rebuilt
-#MCU = at90usb162       # Teensy 1.0
-MCU = atmega32u4       # Teensy 2.0
-#MCU = at90usb646       # Teensy++ 1.0
-#MCU = at90usb1286      # Teensy++ 2.0
+MCU = atmega32u4
+#MCU = at90usb1286
 
 
 # Processor frequency.
@@ -79,6 +77,7 @@ OPT_DEFS += -DBOOT_SIZE=4096
 # Build Options
 #   comment out to disable the options.
 #
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
 MOUSEKEY_ENABLE = yes  # Mouse keys(+5000)
 EXTRAKEY_ENABLE = yes  # Audio control and System control(+600)
 NKRO_ENABLE = yes      # USB Nkey Rollover(+500)