summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/chibios.mk2
-rw-r--r--tmk_core/common/chibios/printf.c3
-rw-r--r--tmk_core/protocol/chibios/usb_main.c110
3 files changed, 59 insertions, 56 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 62e1561878..b2e364f216 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -108,6 +108,8 @@ else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/ld/$(MCU_LDSCRIPT).ld)","")
LDSCRIPT = $(KEYBOARD_PATH_2)/ld/$(MCU_LDSCRIPT).ld
else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/ld/$(MCU_LDSCRIPT).ld)","")
LDSCRIPT = $(KEYBOARD_PATH_1)/ld/$(MCU_LDSCRIPT).ld
+else ifneq ("$(wildcard $(TOP_DIR)/drivers/boards/ld/$(MCU_LDSCRIPT).ld)","")
+ LDSCRIPT = $(TOP_DIR)/drivers/boards/ld/$(MCU_LDSCRIPT).ld
else
LDSCRIPT = $(STARTUPLD)/$(MCU_LDSCRIPT).ld
endif
diff --git a/tmk_core/common/chibios/printf.c b/tmk_core/common/chibios/printf.c
index dcf33f35f8..3a81acd312 100644
--- a/tmk_core/common/chibios/printf.c
+++ b/tmk_core/common/chibios/printf.c
@@ -120,7 +120,8 @@ static void putchw(void* putp, putcf putf, int n, char z, char* bf) {
}
void tfp_format(void* putp, putcf putf, char* fmt, va_list va) {
- char bf[12];
+ // This used to handle max of 12, but binary support jumps this to at least 32
+ char bf[36];
char ch;
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 9981477a58..dd701f661e 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -175,61 +175,61 @@ typedef struct {
} usb_driver_config_t;
/* Reusable initialization structure - see USBEndpointConfig comment at top of file */
-#define QMK_USB_DRIVER_CONFIG(stream, notification, fixedsize) \
- { \
- .queue_capacity_in = stream##_IN_CAPACITY, .queue_capacity_out = stream##_OUT_CAPACITY, \
- .in_ep_config = \
- { \
- stream##_IN_MODE, /* Interrupt EP */ \
- NULL, /* SETUP packet notification callback */ \
- qmkusbDataTransmitted, /* IN notification callback */ \
- NULL, /* OUT notification callback */ \
- stream##_EPSIZE, /* IN maximum packet size */ \
- 0, /* OUT maximum packet size */ \
- NULL, /* IN Endpoint state */ \
- NULL, /* OUT endpoint state */ \
- 2, /* IN multiplier */ \
- NULL /* SETUP buffer (not a SETUP endpoint) */ \
- }, \
- .out_ep_config = \
- { \
- stream##_OUT_MODE, /* Interrupt EP */ \
- NULL, /* SETUP packet notification callback */ \
- NULL, /* IN notification callback */ \
- qmkusbDataReceived, /* OUT notification callback */ \
- 0, /* IN maximum packet size */ \
- stream##_EPSIZE, /* OUT maximum packet size */ \
- NULL, /* IN Endpoint state */ \
- NULL, /* OUT endpoint state */ \
- 2, /* IN multiplier */ \
- NULL, /* SETUP buffer (not a SETUP endpoint) */ \
- }, \
- .int_ep_config = \
- { \
- USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ \
- NULL, /* SETUP packet notification callback */ \
- qmkusbInterruptTransmitted, /* IN notification callback */ \
- NULL, /* OUT notification callback */ \
- CDC_NOTIFICATION_EPSIZE, /* IN maximum packet size */ \
- 0, /* OUT maximum packet size */ \
- NULL, /* IN Endpoint state */ \
- NULL, /* OUT endpoint state */ \
- 2, /* IN multiplier */ \
- NULL, /* SETUP buffer (not a SETUP endpoint) */ \
- }, \
- .config = { \
- .usbp = &USB_DRIVER, \
- .bulk_in = stream##_IN_EPNUM, \
- .bulk_out = stream##_OUT_EPNUM, \
- .int_in = notification, \
- .in_buffers = stream##_IN_CAPACITY, \
- .out_buffers = stream##_OUT_CAPACITY, \
- .in_size = stream##_EPSIZE, \
- .out_size = stream##_EPSIZE, \
- .fixed_size = fixedsize, \
- .ib = (uint8_t[BQ_BUFFER_SIZE(stream##_IN_CAPACITY, stream##_EPSIZE)]){}, \
- .ob = (uint8_t[BQ_BUFFER_SIZE(stream##_OUT_CAPACITY, stream##_EPSIZE)]){}, \
- } \
+#define QMK_USB_DRIVER_CONFIG(stream, notification, fixedsize) \
+ { \
+ .queue_capacity_in = stream##_IN_CAPACITY, .queue_capacity_out = stream##_OUT_CAPACITY, \
+ .in_ep_config = \
+ { \
+ stream##_IN_MODE, /* Interrupt EP */ \
+ NULL, /* SETUP packet notification callback */ \
+ qmkusbDataTransmitted, /* IN notification callback */ \
+ NULL, /* OUT notification callback */ \
+ stream##_EPSIZE, /* IN maximum packet size */ \
+ 0, /* OUT maximum packet size */ \
+ NULL, /* IN Endpoint state */ \
+ NULL, /* OUT endpoint state */ \
+ 2, /* IN multiplier */ \
+ NULL /* SETUP buffer (not a SETUP endpoint) */ \
+ }, \
+ .out_ep_config = \
+ { \
+ stream##_OUT_MODE, /* Interrupt EP */ \
+ NULL, /* SETUP packet notification callback */ \
+ NULL, /* IN notification callback */ \
+ qmkusbDataReceived, /* OUT notification callback */ \
+ 0, /* IN maximum packet size */ \
+ stream##_EPSIZE, /* OUT maximum packet size */ \
+ NULL, /* IN Endpoint state */ \
+ NULL, /* OUT endpoint state */ \
+ 2, /* IN multiplier */ \
+ NULL, /* SETUP buffer (not a SETUP endpoint) */ \
+ }, \
+ .int_ep_config = \
+ { \
+ USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ \
+ NULL, /* SETUP packet notification callback */ \
+ qmkusbInterruptTransmitted, /* IN notification callback */ \
+ NULL, /* OUT notification callback */ \
+ CDC_NOTIFICATION_EPSIZE, /* IN maximum packet size */ \
+ 0, /* OUT maximum packet size */ \
+ NULL, /* IN Endpoint state */ \
+ NULL, /* OUT endpoint state */ \
+ 2, /* IN multiplier */ \
+ NULL, /* SETUP buffer (not a SETUP endpoint) */ \
+ }, \
+ .config = { \
+ .usbp = &USB_DRIVER, \
+ .bulk_in = stream##_IN_EPNUM, \
+ .bulk_out = stream##_OUT_EPNUM, \
+ .int_in = notification, \
+ .in_buffers = stream##_IN_CAPACITY, \
+ .out_buffers = stream##_OUT_CAPACITY, \
+ .in_size = stream##_EPSIZE, \
+ .out_size = stream##_EPSIZE, \
+ .fixed_size = fixedsize, \
+ .ib = (__attribute__((aligned(4))) uint8_t[BQ_BUFFER_SIZE(stream##_IN_CAPACITY, stream##_EPSIZE)]){}, \
+ .ob = (__attribute__((aligned(4))) uint8_t[BQ_BUFFER_SIZE(stream##_OUT_CAPACITY, stream##_EPSIZE)]){}, \
+ } \
}
typedef struct {