From 80c87054193b9243670aeb85adefbe1aa6c0fda0 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 21 Jun 2016 12:53:21 -0400 Subject: reduces rgblight warnings, integrates completely (#428) --- tmk_core/common/avr/eeconfig.c | 5 ++++- tmk_core/common/eeconfig.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c index c5391f5cf5..656938fb33 100644 --- a/tmk_core/common/avr/eeconfig.c +++ b/tmk_core/common/avr/eeconfig.c @@ -14,7 +14,10 @@ void eeconfig_init(void) eeprom_update_byte(EECONFIG_BACKLIGHT, 0); #endif #ifdef AUDIO_ENABLE - eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default + eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default +#endif +#ifdef RGBLIGHT_ENABLE + eeprom_update_dword(EECONFIG_RGBLIGHT, 0); #endif } diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index ca47e0d2fd..d8caa346f9 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -32,6 +32,7 @@ along with this program. If not, see . #define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 #define EECONFIG_BACKLIGHT (uint8_t *)6 #define EECONFIG_AUDIO (uint8_t *)7 +#define EECONFIG_RGBLIGHT (uint32_t *)8 /* debug bit */ -- cgit v1.2.3 From a69d002506d822fef9713b844cd512cefcffd4fc Mon Sep 17 00:00:00 2001 From: fredizzimo Date: Tue, 21 Jun 2016 20:31:26 +0300 Subject: Fix the make all-keyboards command (#422) Unfortunately the supported targets, like "quick", "all", "clean", and so on has to be repeated two extra times, but this is the best I can do with my makefile skills. --- tmk_core/rules.mk | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index d9a0fd33f3..e9ef5ca7b5 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -632,17 +632,34 @@ all-keyboards-defaults-%: all-keyboards-defaults: all-keyboards-defaults-all KEYBOARDS := $(SUBDIRS:$(TOP_DIR)/keyboard/%/=/keyboard/%) -all-keyboards-%: $(KEYBOARDS) -/keyboard/%: - $(eval KEYBOARD=$(patsubst /keyboard/%,%,$@)) - $(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)$@/keymaps/*/.)))) - @for x in $(KEYMAPS) ; do \ - printf "Compiling $(BOLD)$(KEYBOARD)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-88s", $$0; }'; \ - LOG=$$($(MAKE) -C $(TOP_DIR)$@ $(subst all-keyboards-,,$@) keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ - done - +all-keyboards-all: $(addsuffix -all,$(KEYBOARDS)) +all-keyboards-quick: $(addsuffix -quick,$(KEYBOARDS)) +all-keyboards-clean: $(addsuffix -clean,$(KEYBOARDS)) all-keyboards: all-keyboards-all +define make_keyboard +$(eval KEYBOARD=$(patsubst /keyboard/%,%,$1)) +$(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)$1/keymaps/*/.)))) +@for x in $(KEYMAPS) ; do \ + printf "Compiling $(BOLD)$(KEYBOARD)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-88s", $$0; }'; \ + LOG=$$($(MAKE) -C $(TOP_DIR)$1 $2 keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \ +done +endef + +define make_keyboard_helper +# Just remove the -quick, -all and so on from the first argument and pass it forward +$(call make_keyboard,$(subst -$2,,$1),$2) +endef + +/keyboard/%-quick: + $(call make_keyboard_helper,$@,quick) +/keyboard/%-all: + $(call make_keyboard_helper,$@,all) +/keyboard/%-clean: + $(call make_keyboard_helper,$@,clean) +/keyboard/%: + $(call make_keyboard_helper,$@,all) + all-keymaps-%: $(eval MAKECONFIG=$(call get_target,all-keymaps,$@)) $(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboard/$(KEYBOARD)/keymaps/*/.)))) -- cgit v1.2.3 From 1a0bac8bccf0e156d2f3c5f14a7214f9677b6370 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 21 Jun 2016 17:42:29 -0400 Subject: Warning reductions (#430) Warning reductions --- tmk_core/common/command.c | 3 +-- tmk_core/common/command.h | 1 + tmk_core/common/led.h | 3 +++ tmk_core/protocol/lufa/bluetooth.c | 1 - tmk_core/protocol/lufa/bluetooth.h | 2 ++ 5 files changed, 7 insertions(+), 3 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 024d7c67a3..187a2b9496 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -66,7 +66,6 @@ static bool mousekey_console(uint8_t code); static void mousekey_console_help(void); #endif -static uint8_t numkey2num(uint8_t code); static void switch_default_layer(uint8_t layer); @@ -763,7 +762,7 @@ static bool mousekey_console(uint8_t code) /*********************************************************** * Utilities ***********************************************************/ -static uint8_t numkey2num(uint8_t code) +uint8_t numkey2num(uint8_t code) { switch (code) { case KC_1: return 1; diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h index 92b18849bf..a729e4b1e4 100644 --- a/tmk_core/common/command.h +++ b/tmk_core/common/command.h @@ -27,6 +27,7 @@ bool command_extra(uint8_t code); bool command_console_extra(uint8_t code); #ifdef COMMAND_ENABLE +uint8_t numkey2num(uint8_t code); bool command_proc(uint8_t code); #else #define command_proc(code) false diff --git a/tmk_core/common/led.h b/tmk_core/common/led.h index 2e18dc2afa..9dc8987802 100644 --- a/tmk_core/common/led.h +++ b/tmk_core/common/led.h @@ -37,6 +37,9 @@ void led_set(uint8_t usb_led); /* keyboard-specific LED functionality */ void led_set_kb(uint8_t usb_led); + +void led_init_ports(void); + #ifdef __cplusplus } #endif diff --git a/tmk_core/protocol/lufa/bluetooth.c b/tmk_core/protocol/lufa/bluetooth.c index ed66e52c1f..549606162d 100644 --- a/tmk_core/protocol/lufa/bluetooth.c +++ b/tmk_core/protocol/lufa/bluetooth.c @@ -19,7 +19,6 @@ along with this program. If not, see . #include "report.h" #include "print.h" #include "debug.h" -#include "../serial.h" #include "bluetooth.h" void bluefruit_keyboard_print_report(report_keyboard_t *report) diff --git a/tmk_core/protocol/lufa/bluetooth.h b/tmk_core/protocol/lufa/bluetooth.h index 01f07e8e67..78ece1cd0b 100644 --- a/tmk_core/protocol/lufa/bluetooth.h +++ b/tmk_core/protocol/lufa/bluetooth.h @@ -18,6 +18,8 @@ along with this program. If not, see . #ifndef BLUETOOTH_H #define BLUETOOTH_H +#include "../serial.h" + void bluefruit_serial_send(uint8_t data); /* -- cgit v1.2.3