diff options
author | Stephan Bösebeck <sb@caluga.de> | 2016-04-16 22:56:33 +0200 |
---|---|---|
committer | Stephan Bösebeck <sb@caluga.de> | 2016-04-16 22:56:33 +0200 |
commit | 38a1d830faa138f6a7e094b3eda33dc528112ec7 (patch) | |
tree | ea7745744f1759741b09577f25faf616fb39dfa7 /tmk_core | |
parent | 990254edecab782d6f2e71ebfc0b0dda4dc0781e (diff) | |
parent | 5f648b6c4060d586c343ea05562c607e2630dfc4 (diff) |
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common.mk | 27 | ||||
-rw-r--r-- | tmk_core/common/avr/eeconfig.c | 8 | ||||
-rw-r--r-- | tmk_core/common/eeconfig.h | 6 | ||||
-rw-r--r-- | tmk_core/protocol/lufa.mk | 4 |
4 files changed, 30 insertions, 15 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 89c366f554..f8006c6708 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -17,66 +17,67 @@ SRC += $(COMMON_DIR)/host.c \ # Option modules -ifdef BOOTMAGIC_ENABLE +ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) SRC += $(COMMON_DIR)/bootmagic.c SRC += $(COMMON_DIR)/avr/eeconfig.c OPT_DEFS += -DBOOTMAGIC_ENABLE endif -ifdef MOUSEKEY_ENABLE +ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) SRC += $(COMMON_DIR)/mousekey.c OPT_DEFS += -DMOUSEKEY_ENABLE OPT_DEFS += -DMOUSE_ENABLE endif -ifdef EXTRAKEY_ENABLE +ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) OPT_DEFS += -DEXTRAKEY_ENABLE endif -ifdef CONSOLE_ENABLE +ifeq ($(strip $(CONSOLE_ENABLE)), yes) OPT_DEFS += -DCONSOLE_ENABLE else OPT_DEFS += -DNO_PRINT OPT_DEFS += -DNO_DEBUG endif -ifdef COMMAND_ENABLE +ifeq ($(strip $(COMMAND_ENABLE)), yes) SRC += $(COMMON_DIR)/command.c OPT_DEFS += -DCOMMAND_ENABLE endif -ifdef NKRO_ENABLE +ifeq ($(strip $(NKRO_ENABLE)), yes) OPT_DEFS += -DNKRO_ENABLE endif -ifdef MIDI_ENABLE +ifeq ($(strip $(MIDI_ENABLE)), yes) OPT_DEFS += -DMIDI_ENABLE endif -ifdef AUDIO_ENABLE +ifeq ($(strip $(AUDIO_ENABLE)), yes) OPT_DEFS += -DAUDIO_ENABLE endif -ifdef USB_6KRO_ENABLE +ifeq ($(strip $(USB_6KRO_ENABLE)), yes) OPT_DEFS += -DUSB_6KRO_ENABLE endif -ifdef SLEEP_LED_ENABLE +ifeq ($(strip $(SLEEP_LED_ENABLE)), yes) SRC += $(COMMON_DIR)/sleep_led.c OPT_DEFS += -DSLEEP_LED_ENABLE OPT_DEFS += -DNO_SUSPEND_POWER_DOWN endif -ifdef BACKLIGHT_ENABLE +ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) SRC += $(COMMON_DIR)/backlight.c + SRC += $(COMMON_DIR)/avr/eeconfig.c OPT_DEFS += -DBACKLIGHT_ENABLE endif -ifdef BLUETOOTH_ENABLE +ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) OPT_DEFS += -DBLUETOOTH_ENABLE endif -ifdef KEYMAP_SECTION_ENABLE +ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes) OPT_DEFS += -DKEYMAP_SECTION_ENABLE ifeq ($(strip $(MCU)),atmega32u2) diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c index 5bd47dc6ad..25bb9e849c 100644 --- a/tmk_core/common/avr/eeconfig.c +++ b/tmk_core/common/avr/eeconfig.c @@ -13,6 +13,9 @@ void eeconfig_init(void) #ifdef BACKLIGHT_ENABLE eeprom_write_byte(EECONFIG_BACKLIGHT, 0); #endif +#ifdef AUDIO_ENABLE + eeprom_write_byte(EECONFIG_AUDIO, 0xFF); // On by default +#endif } void eeconfig_enable(void) @@ -43,3 +46,8 @@ void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); } void eeconfig_write_backlight(uint8_t val) { eeprom_write_byte(EECONFIG_BACKLIGHT, val); } #endif + +#ifdef AUDIO_ENABLE +uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); } +void eeconfig_write_audio(uint8_t val) { eeprom_write_byte(EECONFIG_AUDIO, val); } +#endif
\ No newline at end of file diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index 3cd1a174f6..ddefca1347 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define EECONFIG_KEYMAP (uint8_t *)4 #define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 #define EECONFIG_BACKLIGHT (uint8_t *)6 +#define EECONFIG_AUDIO (uint8_t *)7 /* debug bit */ @@ -72,4 +73,9 @@ uint8_t eeconfig_read_backlight(void); void eeconfig_write_backlight(uint8_t val); #endif +#ifdef AUDIO_ENABLE +uint8_t eeconfig_read_audio(void); +void eeconfig_write_audio(uint8_t val); +#endif + #endif diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk index 4905760bb4..9ac6298f11 100644 --- a/tmk_core/protocol/lufa.mk +++ b/tmk_core/protocol/lufa.mk @@ -17,7 +17,7 @@ LUFA_SRC = $(LUFA_DIR)/lufa.c \ $(LUFA_DIR)/descriptor.c \ $(LUFA_SRC_USB) -ifdef MIDI_ENABLE +ifeq ($(strip $(MIDI_ENABLE)), yes) LUFA_SRC += $(LUFA_DIR)/midi/midi.c \ $(LUFA_DIR)/midi/midi_device.c \ $(LUFA_DIR)/midi/bytequeue/bytequeue.c \ @@ -25,7 +25,7 @@ ifdef MIDI_ENABLE $(LUFA_SRC_USBCLASS) endif -ifdef BLUETOOTH_ENABLE +ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ $(TMK_DIR)/protocol/serial_uart.c endif |