aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/arm_atsam.mk2
-rw-r--r--tmk_core/avr.mk2
-rw-r--r--tmk_core/chibios.mk5
-rw-r--r--tmk_core/common.mk7
-rw-r--r--tmk_core/common/chibios/suspend.c2
-rw-r--r--tmk_core/common/keyboard.c19
-rw-r--r--tmk_core/common/mousekey.c4
-rw-r--r--tmk_core/protocol/arm_atsam/led_matrix.c9
-rw-r--r--tmk_core/rules.mk2
9 files changed, 44 insertions, 8 deletions
diff --git a/tmk_core/arm_atsam.mk b/tmk_core/arm_atsam.mk
index 06823fb62..25a3411f4 100644
--- a/tmk_core/arm_atsam.mk
+++ b/tmk_core/arm_atsam.mk
@@ -6,7 +6,7 @@ CC = arm-none-eabi-gcc
OBJCOPY = arm-none-eabi-objcopy
OBJDUMP = arm-none-eabi-objdump
SIZE = arm-none-eabi-size
-AR = arm-none-eabi-ar rcs
+AR = arm-none-eabi-ar
NM = arm-none-eabi-nm
HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature
EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT)
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index f6af3f5e2..6bf86d58a 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -6,7 +6,7 @@ CC = avr-gcc
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
-AR = avr-ar rcs
+AR = avr-ar
NM = avr-nm
HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature
EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT)
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 01edebfd7..44c00bdd1 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -201,6 +201,7 @@ DFU_ARGS ?=
ifneq ("$(SERIAL)","")
DFU_ARGS += -S $(SERIAL)
endif
+DFU_SUFFIX_ARGS ?=
ST_LINK_ARGS ?=
@@ -208,6 +209,7 @@ ST_LINK_ARGS ?=
EXTRALIBDIRS = $(RULESPATH)/ld
DFU_UTIL ?= dfu-util
+DFU_SUFFIX ?= dfu-suffix
ST_LINK_CLI ?= st-link_cli
# Generate a .qmk for the QMK-FF
@@ -259,4 +261,7 @@ st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter
$(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst
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 ;\
+ fi
$(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin;
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index 94f3c2380..221688755 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -208,6 +208,13 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
endif
+
+ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes)
+ EXTRAFLAGS += -flto
+ TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE
+ TMK_COMMON_DEFS += -DNO_ACTION_MACRO
+ TMK_COMMON_DEFS += -DNO_ACTION_FUNCTION
+endif
# Bootloader address
ifdef STM32_BOOTLOADER_ADDRESS
TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)
diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c
index 4a119ccef..6027d69b7 100644
--- a/tmk_core/common/chibios/suspend.c
+++ b/tmk_core/common/chibios/suspend.c
@@ -82,7 +82,7 @@ void suspend_wakeup_init_user(void) { }
*/
__attribute__ ((weak))
void suspend_wakeup_init_kb(void) {
- suspend_power_down_user();
+ suspend_wakeup_init_user();
}
/** \brief suspend wakeup condition
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 52546866e..85d252548 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -75,6 +75,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef QWIIC_ENABLE
# include "qwiic.h"
#endif
+#ifdef OLED_DRIVER_ENABLE
+ #include "oled_driver.h"
+#endif
#ifdef VELOCIKEY_ENABLE
#include "velocikey.h"
#endif
@@ -205,6 +208,9 @@ void keyboard_init(void) {
#ifdef QWIIC_ENABLE
qwiic_init();
#endif
+#ifdef OLED_DRIVER_ENABLE
+ oled_init(OLED_ROTATION_0);
+#endif
#ifdef PS2_MOUSE_ENABLE
ps2_mouse_init();
#endif
@@ -262,7 +268,11 @@ void keyboard_task(void)
uint8_t keys_processed = 0;
#endif
+#if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT)
+ uint8_t ret = matrix_scan();
+#else
matrix_scan();
+#endif
if (is_keyboard_master()) {
for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
@@ -306,6 +316,15 @@ MATRIX_LOOP_END:
qwiic_task();
#endif
+#ifdef OLED_DRIVER_ENABLE
+ oled_task();
+#ifndef OLED_DISABLE_TIMEOUT
+ // Wake up oled if user is using those fabulous keys!
+ if (ret)
+ oled_on();
+#endif
+#endif
+
#ifdef MOUSEKEY_ENABLE
// mousekey repeat & acceleration
mousekey_task();
diff --git a/tmk_core/common/mousekey.c b/tmk_core/common/mousekey.c
index 8c9184306..bb08576b9 100644
--- a/tmk_core/common/mousekey.c
+++ b/tmk_core/common/mousekey.c
@@ -114,7 +114,9 @@ void mousekey_task(void) {
/* diagonal move [1/sqrt(2)] */
if (mouse_report.x && mouse_report.y) {
mouse_report.x = times_inv_sqrt2(mouse_report.x);
+ if (mouse_report.x == 0) { mouse_report.x = 1; }
mouse_report.y = times_inv_sqrt2(mouse_report.y);
+ if (mouse_report.y == 0) { mouse_report.y = 1; }
}
if (mouse_report.v > 0) mouse_report.v = wheel_unit();
if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1;
@@ -232,7 +234,9 @@ void adjust_speed(void) {
// adjust for diagonals
if (mouse_report.x && mouse_report.y) {
mouse_report.x = times_inv_sqrt2(mouse_report.x);
+ if (mouse_report.x == 0) { mouse_report.x = 1; }
mouse_report.y = times_inv_sqrt2(mouse_report.y);
+ if (mouse_report.y == 0) { mouse_report.y = 1; }
}
if (mouse_report.h && mouse_report.v) {
mouse_report.h = times_inv_sqrt2(mouse_report.h);
diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c
index e29fb6587..ea067a743 100644
--- a/tmk_core/protocol/arm_atsam/led_matrix.c
+++ b/tmk_core/protocol/arm_atsam/led_matrix.c
@@ -431,6 +431,7 @@ static void led_run_pattern(led_setup_t *f, float* ro, float* go, float* bo, flo
}
}
+extern led_config_t g_led_config;
static void led_matrix_massdrop_config_override(int i)
{
float ro = 0;
@@ -438,14 +439,14 @@ static void led_matrix_massdrop_config_override(int i)
float bo = 0;
float po = (led_animation_orientation)
- ? (float)g_rgb_leds[i].point.y / 64.f * 100
- : (float)g_rgb_leds[i].point.x / 224.f * 100;
+ ? (float)g_led_config.point[i].y / 64.f * 100
+ : (float)g_led_config.point[i].x / 224.f * 100;
uint8_t highest_active_layer = biton32(layer_state);
- if (led_lighting_mode == LED_MODE_KEYS_ONLY && g_rgb_leds[i].matrix_co.raw == 0xff) {
+ if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) {
//Do not act on this LED
- } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && g_rgb_leds[i].matrix_co.raw != 0xff) {
+ } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_led_config.flags[i], LED_FLAG_UNDERGLOW)) {
//Do not act on this LED
} else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) {
//Do not act on this LED (Only show indicators)
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 3a322cee4..6d2bb51f0 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -331,7 +331,7 @@ $1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN)
$1/%.a : $1/%.o
@mkdir -p $$(@D)
@$(SILENT) || printf "Archiving: $$<" | $$(AWK_CMD)
- $$(eval CMD=$$(AR) $$@ $$<)
+ $$(eval CMD=$$(AR) rcs $$@ $$<)
@$$(BUILD_CMD)
$1/force: