File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,13 @@ int main(void) {
101
101
while (USB_DRIVER .state != USB_ACTIVE )
102
102
chThdSleepMilliseconds (50 );
103
103
104
+ /* Do need to wait here!
105
+ * Otherwise the next print might start a transfer on console EP
106
+ * before the USB is completely ready, which sometimes causes
107
+ * HardFaults.
108
+ */
109
+ chThdSleepMilliseconds (50 );
110
+
104
111
print ("USB configured.\n" );
105
112
106
113
/* init TMK modules */
Original file line number Diff line number Diff line change 33
33
* ---------------------------------------------------------
34
34
*/
35
35
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 ;
39
39
volatile uint16_t keyboard_idle_count = 0 ;
40
40
static virtual_timer_t keyboard_idle_timer ;
41
41
static void keyboard_idle_timer_cb (void * arg );
@@ -1350,7 +1350,7 @@ int8_t sendchar(uint8_t c) {
1350
1350
return 0 ;
1351
1351
}
1352
1352
osalSysUnlock ();
1353
- /* Timeout after 5us if the queue is full.
1353
+ /* Timeout after 100us if the queue is full.
1354
1354
* Increase this timeout if too much stuff is getting
1355
1355
* dropped (i.e. the buffer is getting full too fast
1356
1356
* for USB/HIDRAW to dequeue). Another possibility
Original file line number Diff line number Diff line change @@ -58,9 +58,6 @@ void send_remote_wakeup(USBDriver *usbp);
58
58
#define NKRO_REPORT_KEYS (NKRO_EPSIZE - 1)
59
59
#endif
60
60
61
- /* this defines report_keyboard_t and computes REPORT_SIZE defines */
62
- // #include "report.h"
63
-
64
61
/* extern report_keyboard_t keyboard_report_sent; */
65
62
66
63
/* keyboard IN request callback handler */
@@ -122,8 +119,7 @@ typedef struct {
122
119
#define CONSOLE_EPSIZE 16
123
120
124
121
/* 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
127
123
128
124
/* Console flush time */
129
125
#define CONSOLE_FLUSH_MS 50
You can’t perform that action at this time.
0 commit comments