summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/chibios.mk13
-rw-r--r--tmk_core/common/action.c4
-rw-r--r--tmk_core/protocol/arm_atsam/md_bootloader.h3
3 files changed, 16 insertions, 4 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 44c00bdd15..11715cf346 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -260,6 +260,19 @@ dfu-util-wait: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter
$(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst
+
+# Autodetect teensy loader
+ifndef TEENSY_LOADER_CLI
+ ifneq (, $(shell which teensy-loader-cli 2>/dev/null))
+ TEENSY_LOADER_CLI ?= teensy-loader-cli
+ else
+ TEENSY_LOADER_CLI ?= teensy_loader_cli
+ endif
+endif
+
+teensy: $(BUILD_DIR)/$(TARGET).hex cpfirmware sizeafter
+ $(TEENSY_LOADER_CLI) -mmcu=$(MCU_LDSCRIPT) -w -v $(BUILD_DIR)/$(TARGET).hex
+
bin: $(BUILD_DIR)/$(TARGET).bin sizeafter
if [ ! -z "$(DFU_SUFFIX_ARGS)" ]; then \
$(DFU_SUFFIX) $(DFU_SUFFIX_ARGS) -a $(BUILD_DIR)/$(TARGET).bin 1>/dev/null ;\
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 3991a8a9ef..6a560229a6 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -412,7 +412,7 @@ void process_action(keyrecord_t *record, action_t action)
case OP_BIT_AND: default_layer_and(bits | mask); break;
case OP_BIT_OR: default_layer_or(bits | mask); break;
case OP_BIT_XOR: default_layer_xor(bits | mask); break;
- case OP_BIT_SET: default_layer_and(mask); default_layer_or(bits); break;
+ case OP_BIT_SET: default_layer_set(bits | mask); break;
}
}
} else {
@@ -426,7 +426,7 @@ void process_action(keyrecord_t *record, action_t action)
case OP_BIT_AND: layer_and(bits | mask); break;
case OP_BIT_OR: layer_or(bits | mask); break;
case OP_BIT_XOR: layer_xor(bits | mask); break;
- case OP_BIT_SET: layer_and(mask); layer_or(bits); break;
+ case OP_BIT_SET: layer_state_set(bits | mask); break;
}
}
}
diff --git a/tmk_core/protocol/arm_atsam/md_bootloader.h b/tmk_core/protocol/arm_atsam/md_bootloader.h
index 956145c313..6b80ef4922 100644
--- a/tmk_core/protocol/arm_atsam/md_bootloader.h
+++ b/tmk_core/protocol/arm_atsam/md_bootloader.h
@@ -11,7 +11,7 @@ extern uint32_t _erom;
//WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support
extern uint32_t _eram;
#define BOOTLOADER_MAGIC 0x3B9ACA00
-#define MAGIC_ADDR (uint32_t *)(&_eram - 4)
+#define MAGIC_ADDR (uint32_t *)((intptr_t)(&_eram) - 4)
#endif
#ifdef MD_BOOTLOADER
@@ -22,4 +22,3 @@ extern uint32_t _eram;
#endif //MD_BOOTLOADER
#endif //_MD_BOOTLOADER_H_
-