summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/chibios
diff options
context:
space:
mode:
authorDrashna Jael're <drashna@live.com>2022-05-29 15:38:33 -0700
committerDrashna Jael're <drashna@live.com>2022-05-29 15:38:33 -0700
commit30aac80d5a6d8c6f7c06efb49189d748e70edc4a (patch)
treeceb11968ae41228e4b110c07467cdca7cc9cff22 /tmk_core/protocol/chibios
parent67f4e5f34489abf986dedb4984b256692086c615 (diff)
parente22a183329fd05d39f88bb9dfebe98cfa7cd8402 (diff)
Merge remote-tracking branch 'qmk 0.17.0' into firmware21
Diffstat (limited to 'tmk_core/protocol/chibios')
-rw-r--r--tmk_core/protocol/chibios/usb_driver.c2
-rw-r--r--tmk_core/protocol/chibios/usb_main.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/tmk_core/protocol/chibios/usb_driver.c b/tmk_core/protocol/chibios/usb_driver.c
index 4de060f306..ad45f9b1da 100644
--- a/tmk_core/protocol/chibios/usb_driver.c
+++ b/tmk_core/protocol/chibios/usb_driver.c
@@ -60,7 +60,7 @@ static bool qmkusb_start_receive(QMKUSBDriver *qmkusbp) {
}
/* Checking if there is already a transaction ongoing on the endpoint.*/
- if (usbGetReceiveStatusI(qmkusbp->config->usbp, qmkusbp->config->bulk_in)) {
+ if (usbGetReceiveStatusI(qmkusbp->config->usbp, qmkusbp->config->bulk_out)) {
return true;
}
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index e18268db3b..66cef7838a 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -363,8 +363,12 @@ static usb_driver_configs_t drivers = {
.console_driver = QMK_USB_DRIVER_CONFIG(CONSOLE, 0, true),
#endif
#ifdef RAW_ENABLE
-# define RAW_IN_CAPACITY 4
-# define RAW_OUT_CAPACITY 4
+# ifndef RAW_IN_CAPACITY
+# define RAW_IN_CAPACITY 4
+# endif
+# ifndef RAW_OUT_CAPACITY
+# define RAW_OUT_CAPACITY 4
+# endif
# define RAW_IN_MODE USB_EP_MODE_TYPE_INTR
# define RAW_OUT_MODE USB_EP_MODE_TYPE_INTR
.raw_driver = QMK_USB_DRIVER_CONFIG(RAW, 0, false),
@@ -1126,7 +1130,7 @@ void console_task(void) {
uint8_t buffer[CONSOLE_EPSIZE];
size_t size = 0;
do {
- size_t size = chnReadTimeout(&drivers.console_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE);
+ size = chnReadTimeout(&drivers.console_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE);
if (size > 0) {
console_receive(buffer, size);
}
@@ -1154,7 +1158,7 @@ void raw_hid_task(void) {
uint8_t buffer[RAW_EPSIZE];
size_t size = 0;
do {
- size_t size = chnReadTimeout(&drivers.raw_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE);
+ size = chnReadTimeout(&drivers.raw_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE);
if (size > 0) {
raw_hid_receive(buffer, size);
}
@@ -1202,7 +1206,7 @@ void midi_ep_task(void) {
uint8_t buffer[MIDI_STREAM_EPSIZE];
size_t size = 0;
do {
- size_t size = chnReadTimeout(&drivers.midi_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE);
+ size = chnReadTimeout(&drivers.midi_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE);
if (size > 0) {
MIDI_EventPacket_t event;
recv_midi_packet(&event);