diff options
| -rw-r--r-- | build_keyboard.mk | 6 | ||||
| -rw-r--r-- | common_features.mk | 6 | ||||
| -rw-r--r-- | keyboards/lets_split/rev1/config.h | 3 | ||||
| -rw-r--r-- | keyboards/lets_split/rev2/config.h | 3 | ||||
| -rw-r--r-- | keyboards/lets_split/sockets/config.h | 3 | ||||
| -rw-r--r-- | quantum/split_common/i2c.c | 3 | ||||
| -rw-r--r-- | quantum/split_common/serial.c | 16 | ||||
| -rw-r--r-- | tmk_core/common/command.c | 4 | ||||
| -rw-r--r-- | tmk_core/rules.mk | 36 |
9 files changed, 56 insertions, 24 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk index d225fe821..b639b92d3 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk | |||
| @@ -34,6 +34,10 @@ $(error MASTER does not have a valid value(left/right)) | |||
| 34 | endif | 34 | endif |
| 35 | endif | 35 | endif |
| 36 | 36 | ||
| 37 | ifdef SKIP_VERSION | ||
| 38 | OPT_DEFS += -DSKIP_VERSION | ||
| 39 | endif | ||
| 40 | |||
| 37 | # Determine which subfolders exist. | 41 | # Determine which subfolders exist. |
| 38 | KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) | 42 | KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) |
| 39 | KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1))) | 43 | KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1))) |
| @@ -278,6 +282,7 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") | |||
| 278 | endif | 282 | endif |
| 279 | 283 | ||
| 280 | # # project specific files | 284 | # # project specific files |
| 285 | SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) | ||
| 281 | SRC += $(KEYBOARD_SRC) \ | 286 | SRC += $(KEYBOARD_SRC) \ |
| 282 | $(KEYMAP_C) \ | 287 | $(KEYMAP_C) \ |
| 283 | $(QUANTUM_SRC) | 288 | $(QUANTUM_SRC) |
| @@ -296,6 +301,7 @@ include $(TMK_PATH)/protocol.mk | |||
| 296 | include $(TMK_PATH)/common.mk | 301 | include $(TMK_PATH)/common.mk |
| 297 | include bootloader.mk | 302 | include bootloader.mk |
| 298 | 303 | ||
| 304 | SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) | ||
| 299 | SRC += $(TMK_COMMON_SRC) | 305 | SRC += $(TMK_COMMON_SRC) |
| 300 | OPT_DEFS += $(TMK_COMMON_DEFS) | 306 | OPT_DEFS += $(TMK_COMMON_DEFS) |
| 301 | EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS) | 307 | EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS) |
diff --git a/common_features.mk b/common_features.mk index 97febe2e7..73aab5d84 100644 --- a/common_features.mk +++ b/common_features.mk | |||
| @@ -270,7 +270,7 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) | |||
| 270 | endif | 270 | endif |
| 271 | OPT_DEFS += -DSPLIT_KEYBOARD | 271 | OPT_DEFS += -DSPLIT_KEYBOARD |
| 272 | QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \ | 272 | QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \ |
| 273 | $(QUANTUM_DIR)/split_common/split_util.c \ | 273 | $(QUANTUM_DIR)/split_common/split_util.c |
| 274 | $(QUANTUM_DIR)/split_common/i2c.c \ | 274 | QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/i2c.c |
| 275 | $(QUANTUM_DIR)/split_common/serial.c | 275 | QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/serial.c |
| 276 | endif | 276 | endif |
diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h index a8d614915..18b7cce5a 100644 --- a/keyboards/lets_split/rev1/config.h +++ b/keyboards/lets_split/rev1/config.h | |||
| @@ -45,6 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 45 | /* Set 0 if debouncing isn't needed */ | 45 | /* Set 0 if debouncing isn't needed */ |
| 46 | #define DEBOUNCING_DELAY 5 | 46 | #define DEBOUNCING_DELAY 5 |
| 47 | 47 | ||
| 48 | /* serial.c configuration for split keyboard */ | ||
| 49 | #define SOFT_SERIAL_PIN D0 | ||
| 50 | |||
| 48 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | 51 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ |
| 49 | #define LOCKING_SUPPORT_ENABLE | 52 | #define LOCKING_SUPPORT_ENABLE |
| 50 | /* Locking resynchronize hack */ | 53 | /* Locking resynchronize hack */ |
diff --git a/keyboards/lets_split/rev2/config.h b/keyboards/lets_split/rev2/config.h index 8844e5bb8..1c0871cd1 100644 --- a/keyboards/lets_split/rev2/config.h +++ b/keyboards/lets_split/rev2/config.h | |||
| @@ -45,6 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 45 | /* Set 0 if debouncing isn't needed */ | 45 | /* Set 0 if debouncing isn't needed */ |
| 46 | #define DEBOUNCING_DELAY 5 | 46 | #define DEBOUNCING_DELAY 5 |
| 47 | 47 | ||
| 48 | /* serial.c configuration for split keyboard */ | ||
| 49 | #define SOFT_SERIAL_PIN D0 | ||
| 50 | |||
| 48 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | 51 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ |
| 49 | #define LOCKING_SUPPORT_ENABLE | 52 | #define LOCKING_SUPPORT_ENABLE |
| 50 | /* Locking resynchronize hack */ | 53 | /* Locking resynchronize hack */ |
diff --git a/keyboards/lets_split/sockets/config.h b/keyboards/lets_split/sockets/config.h index 10d0c997e..6939d37dc 100644 --- a/keyboards/lets_split/sockets/config.h +++ b/keyboards/lets_split/sockets/config.h | |||
| @@ -45,6 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 45 | /* Set 0 if debouncing isn't needed */ | 45 | /* Set 0 if debouncing isn't needed */ |
| 46 | #define DEBOUNCING_DELAY 5 | 46 | #define DEBOUNCING_DELAY 5 |
| 47 | 47 | ||
| 48 | /* serial.c configuration for split keyboard */ | ||
| 49 | #define SOFT_SERIAL_PIN D0 | ||
| 50 | |||
| 48 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | 51 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ |
| 49 | #define LOCKING_SUPPORT_ENABLE | 52 | #define LOCKING_SUPPORT_ENABLE |
| 50 | /* Locking resynchronize hack */ | 53 | /* Locking resynchronize hack */ |
diff --git a/quantum/split_common/i2c.c b/quantum/split_common/i2c.c index b3d7fcc68..45e958b39 100644 --- a/quantum/split_common/i2c.c +++ b/quantum/split_common/i2c.c | |||
| @@ -7,8 +7,6 @@ | |||
| 7 | #include "i2c.h" | 7 | #include "i2c.h" |
| 8 | #include "split_flags.h" | 8 | #include "split_flags.h" |
| 9 | 9 | ||
| 10 | #if defined(USE_I2C) || defined(EH) | ||
| 11 | |||
| 12 | // Limits the amount of we wait for any one i2c transaction. | 10 | // Limits the amount of we wait for any one i2c transaction. |
| 13 | // Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is | 11 | // Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is |
| 14 | // 9 bits, a single transaction will take around 90μs to complete. | 12 | // 9 bits, a single transaction will take around 90μs to complete. |
| @@ -184,4 +182,3 @@ ISR(TWI_vect) { | |||
| 184 | // Reset everything, so we are ready for the next TWI interrupt | 182 | // Reset everything, so we are ready for the next TWI interrupt |
| 185 | TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN); | 183 | TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN); |
| 186 | } | 184 | } |
| 187 | #endif | ||
diff --git a/quantum/split_common/serial.c b/quantum/split_common/serial.c index f34f824d7..13e58d825 100644 --- a/quantum/split_common/serial.c +++ b/quantum/split_common/serial.c | |||
| @@ -12,18 +12,14 @@ | |||
| 12 | #include <stdbool.h> | 12 | #include <stdbool.h> |
| 13 | #include "serial.h" | 13 | #include "serial.h" |
| 14 | 14 | ||
| 15 | #ifndef USE_I2C | 15 | #ifdef SOFT_SERIAL_PIN |
| 16 | |||
| 17 | #ifndef SOFT_SERIAL_PIN | ||
| 18 | #error quantum/split_common/serial.c need SOFT_SERIAL_PIN define | ||
| 19 | #endif | ||
| 20 | 16 | ||
| 21 | #ifdef __AVR_ATmega32U4__ | 17 | #ifdef __AVR_ATmega32U4__ |
| 22 | // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. | 18 | // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. |
| 23 | #ifdef USE_I2C | 19 | #ifdef USE_AVR_I2C |
| 24 | #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 | 20 | #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 |
| 25 | #error Using ATmega32U4 I2C, so can not use PD0, PD1 | 21 | #error Using ATmega32U4 I2C, so can not use PD0, PD1 |
| 26 | #endif | 22 | #endif |
| 27 | #endif | 23 | #endif |
| 28 | 24 | ||
| 29 | #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 | 25 | #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 |
| @@ -278,4 +274,4 @@ int serial_update_buffers(void) { | |||
| 278 | return 0; | 274 | return 0; |
| 279 | } | 275 | } |
| 280 | 276 | ||
| 281 | #endif | 277 | #endif /* SOFT_SERIAL_PIN */ |
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index f79d5a257..aab99290d 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c | |||
| @@ -181,7 +181,11 @@ static void print_version(void) | |||
| 181 | print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " | 181 | print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " |
| 182 | "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " | 182 | "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " |
| 183 | "VER: " STR(DEVICE_VER) "\n"); | 183 | "VER: " STR(DEVICE_VER) "\n"); |
| 184 | #ifdef SKIP_VERSION | ||
| 185 | print("BUILD: (" __DATE__ ")\n"); | ||
| 186 | #else | ||
| 184 | print("BUILD: " STR(QMK_VERSION) " (" __TIME__ " " __DATE__ ")\n"); | 187 | print("BUILD: " STR(QMK_VERSION) " (" __TIME__ " " __DATE__ ")\n"); |
| 188 | #endif | ||
| 185 | 189 | ||
| 186 | /* build options */ | 190 | /* build options */ |
| 187 | print("OPTIONS:" | 191 | print("OPTIONS:" |
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index ce3cd83b3..2e419dd66 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk | |||
| @@ -28,12 +28,13 @@ VPATH := | |||
| 28 | 28 | ||
| 29 | # Convert all SRC to OBJ | 29 | # Convert all SRC to OBJ |
| 30 | define OBJ_FROM_SRC | 30 | define OBJ_FROM_SRC |
| 31 | $(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$($1_SRC))))) | 31 | $(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$(patsubst %.clib,$1/%.a,$($1_SRC)))))) |
| 32 | endef | 32 | endef |
| 33 | $(foreach OUTPUT,$(OUTPUTS),$(eval $(OUTPUT)_OBJ +=$(call OBJ_FROM_SRC,$(OUTPUT)))) | 33 | $(foreach OUTPUT,$(OUTPUTS),$(eval $(OUTPUT)_OBJ +=$(call OBJ_FROM_SRC,$(OUTPUT)))) |
| 34 | 34 | ||
| 35 | # Define a list of all objects | 35 | # Define a list of all objects |
| 36 | OBJ := $(foreach OUTPUT,$(OUTPUTS),$($(OUTPUT)_OBJ)) | 36 | OBJ := $(foreach OUTPUT,$(OUTPUTS),$($(OUTPUT)_OBJ)) |
| 37 | NO_LTO_OBJ := $(filter %.a,$(OBJ)) | ||
| 37 | 38 | ||
| 38 | MASTER_OUTPUT := $(firstword $(OUTPUTS)) | 39 | MASTER_OUTPUT := $(firstword $(OUTPUTS)) |
| 39 | 40 | ||
| @@ -81,7 +82,9 @@ CSTANDARD = -std=gnu99 | |||
| 81 | # -Wall...: warning level | 82 | # -Wall...: warning level |
| 82 | # -Wa,...: tell GCC to pass this to the assembler. | 83 | # -Wa,...: tell GCC to pass this to the assembler. |
| 83 | # -adhlns...: create assembler listing | 84 | # -adhlns...: create assembler listing |
| 84 | CFLAGS += -g$(DEBUG) | 85 | ifndef SKIP_DEBUG_INFO |
| 86 | CFLAGS += -g$(DEBUG) | ||
| 87 | endif | ||
| 85 | CFLAGS += $(CDEFS) | 88 | CFLAGS += $(CDEFS) |
| 86 | CFLAGS += -O$(OPT) | 89 | CFLAGS += -O$(OPT) |
| 87 | # add color | 90 | # add color |
| @@ -110,7 +113,9 @@ CFLAGS += $(CSTANDARD) | |||
| 110 | # -Wall...: warning level | 113 | # -Wall...: warning level |
| 111 | # -Wa,...: tell GCC to pass this to the assembler. | 114 | # -Wa,...: tell GCC to pass this to the assembler. |
| 112 | # -adhlns...: create assembler listing | 115 | # -adhlns...: create assembler listing |
| 113 | CPPFLAGS += -g$(DEBUG) | 116 | ifndef SKIP_DEBUG_INFO |
| 117 | CPPFLAGS += -g$(DEBUG) | ||
| 118 | endif | ||
| 114 | CPPFLAGS += $(CPPDEFS) | 119 | CPPFLAGS += $(CPPDEFS) |
| 115 | CPPFLAGS += -O$(OPT) | 120 | CPPFLAGS += -O$(OPT) |
| 116 | # to supress "warning: only initialized variables can be placed into program memory area" | 121 | # to supress "warning: only initialized variables can be placed into program memory area" |
| @@ -138,7 +143,11 @@ CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) | |||
| 138 | # -listing-cont-lines: Sets the maximum number of continuation lines of hex | 143 | # -listing-cont-lines: Sets the maximum number of continuation lines of hex |
| 139 | # dump that will be displayed for a given single line of source input. | 144 | # dump that will be displayed for a given single line of source input. |
| 140 | ASFLAGS += $(ADEFS) | 145 | ASFLAGS += $(ADEFS) |
| 141 | ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 | 146 | ifndef SKIP_DEBUG_INFO |
| 147 | ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 | ||
| 148 | else | ||
| 149 | ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100 | ||
| 150 | endif | ||
| 142 | 151 | ||
| 143 | #---------------- Library Options ---------------- | 152 | #---------------- Library Options ---------------- |
| 144 | # Minimalistic printf version | 153 | # Minimalistic printf version |
| @@ -210,6 +219,11 @@ ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(EXTRAFLAGS) | |||
| 210 | ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(EXTRAFLAGS) | 219 | ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(EXTRAFLAGS) |
| 211 | ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) | 220 | ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) |
| 212 | 221 | ||
| 222 | define NO_LTO | ||
| 223 | $(patsubst %.a,%.o,$1): NOLTO_CFLAGS += -fno-lto | ||
| 224 | endef | ||
| 225 | $(foreach LOBJ, $(NO_LTO_OBJ), $(eval $(call NO_LTO,$(LOBJ)))) | ||
| 226 | |||
| 213 | MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) | 227 | MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) |
| 214 | 228 | ||
| 215 | 229 | ||
| @@ -290,8 +304,8 @@ $1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC)) | |||
| 290 | ifdef $1_CONFIG | 304 | ifdef $1_CONFIG |
| 291 | $1_CONFIG_FLAGS += $$(patsubst %,-include %,$$($1_CONFIG)) | 305 | $1_CONFIG_FLAGS += $$(patsubst %,-include %,$$($1_CONFIG)) |
| 292 | endif | 306 | endif |
| 293 | $1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) | 307 | $1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS) |
| 294 | $1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) | 308 | $1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS) |
| 295 | $1_ASFLAGS= $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) | 309 | $1_ASFLAGS= $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) |
| 296 | 310 | ||
| 297 | # Compile: create object files from C source files. | 311 | # Compile: create object files from C source files. |
| @@ -321,6 +335,12 @@ $1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN) | |||
| 321 | $$(eval CMD=$$(CC) -c $$($1_ASFLAGS) $$< -o $$@) | 335 | $$(eval CMD=$$(CC) -c $$($1_ASFLAGS) $$< -o $$@) |
| 322 | @$$(BUILD_CMD) | 336 | @$$(BUILD_CMD) |
| 323 | 337 | ||
| 338 | $1/%.a : $1/%.o | ||
| 339 | @mkdir -p $$(@D) | ||
| 340 | @$(SILENT) || printf "Archiving: $$<" | $$(AWK_CMD) | ||
| 341 | $$(eval CMD=$$(AR) $$@ $$<) | ||
| 342 | @$$(BUILD_CMD) | ||
| 343 | |||
| 324 | $1/force: | 344 | $1/force: |
| 325 | 345 | ||
| 326 | $1/cflags.txt: $1/force | 346 | $1/cflags.txt: $1/force |
| @@ -346,7 +366,7 @@ $(MASTER_OUTPUT)/ldflags.txt: $(MASTER_OUTPUT)/force | |||
| 346 | 366 | ||
| 347 | 367 | ||
| 348 | # We have to use static rules for the .d files for some reason | 368 | # We have to use static rules for the .d files for some reason |
| 349 | DEPS = $(patsubst %.o,%.d,$(OBJ)) | 369 | DEPS = $(patsubst %.o,%.d,$(patsubst %.a,%.o,$(OBJ))) |
| 350 | # Keep the .d files | 370 | # Keep the .d files |
| 351 | .PRECIOUS: $(DEPS) | 371 | .PRECIOUS: $(DEPS) |
| 352 | # Empty rule to force recompilation if the .d file is missing | 372 | # Empty rule to force recompilation if the .d file is missing |
| @@ -391,7 +411,7 @@ $(shell mkdir -p $(BUILD_DIR) 2>/dev/null) | |||
| 391 | $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null))) | 411 | $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null))) |
| 392 | 412 | ||
| 393 | # Include the dependency files. | 413 | # Include the dependency files. |
| 394 | -include $(patsubst %.o,%.d,$(OBJ)) | 414 | -include $(patsubst %.o,%.d,$(patsubst %.a,%.o,$(OBJ))) |
| 395 | 415 | ||
| 396 | 416 | ||
| 397 | # Listing of phony targets. | 417 | # Listing of phony targets. |
