Skip to content

Commit ec9eff2

Browse files
committed
Chibios: cleanup usb_main code.
1 parent 28c4665 commit ec9eff2

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

protocol/chibios/usb_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
* ---------------------------------------------------------
3434
*/
3535

36-
uint8_t keyboard_idle = 0;
37-
uint8_t keyboard_protocol = 1;
38-
uint16_t keyboard_led_stats = 0;
36+
uint8_t keyboard_idle __attribute__((aligned(2))) = 0;
37+
uint8_t keyboard_protocol __attribute__((aligned(2))) = 1;
38+
uint16_t keyboard_led_stats __attribute__((aligned(2))) = 0;
3939
volatile uint16_t keyboard_idle_count = 0;
4040
static virtual_timer_t keyboard_idle_timer;
4141
static void keyboard_idle_timer_cb(void *arg);
@@ -1350,7 +1350,7 @@ int8_t sendchar(uint8_t c) {
13501350
return 0;
13511351
}
13521352
osalSysUnlock();
1353-
/* Timeout after 5us if the queue is full.
1353+
/* Timeout after 100us if the queue is full.
13541354
* Increase this timeout if too much stuff is getting
13551355
* dropped (i.e. the buffer is getting full too fast
13561356
* for USB/HIDRAW to dequeue). Another possibility

protocol/chibios/usb_main.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ void send_remote_wakeup(USBDriver *usbp);
5858
#define NKRO_REPORT_KEYS (NKRO_EPSIZE - 1)
5959
#endif
6060

61-
/* this defines report_keyboard_t and computes REPORT_SIZE defines */
62-
// #include "report.h"
63-
6461
/* extern report_keyboard_t keyboard_report_sent; */
6562

6663
/* keyboard IN request callback handler */
@@ -122,8 +119,7 @@ typedef struct {
122119
#define CONSOLE_EPSIZE 16
123120

124121
/* Number of IN reports that can be stored inside the output queue */
125-
#define CONSOLE_QUEUE_CAPACITY 2
126-
#define CONSOLE_QUEUE_BUFFER_SIZE (CONSOLE_QUEUE_CAPACITY * CONSOLE_EPSIZE)
122+
#define CONSOLE_QUEUE_CAPACITY 4
127123

128124
/* Console flush time */
129125
#define CONSOLE_FLUSH_MS 50

0 commit comments

Comments
 (0)