Browse Source

Merge branch 'chibios' of https://github.com/flabbergast/tmk_keyboard into flabbergast_chibios

tags/v2.9
tmk 8 years ago
parent
commit
a3f29c973d

+ 7
- 0
tmk_core/protocol/chibios/main.c View File

while(USB_DRIVER.state != USB_ACTIVE) while(USB_DRIVER.state != USB_ACTIVE)
chThdSleepMilliseconds(50); chThdSleepMilliseconds(50);


/* Do need to wait here!
* Otherwise the next print might start a transfer on console EP
* before the USB is completely ready, which sometimes causes
* HardFaults.
*/
chThdSleepMilliseconds(50);

print("USB configured.\n"); print("USB configured.\n");


/* init TMK modules */ /* init TMK modules */

+ 4
- 4
tmk_core/protocol/chibios/usb_main.c View File

* --------------------------------------------------------- * ---------------------------------------------------------
*/ */


uint8_t keyboard_idle = 0;
uint8_t keyboard_protocol = 1;
uint16_t keyboard_led_stats = 0;
uint8_t keyboard_idle __attribute__((aligned(2))) = 0;
uint8_t keyboard_protocol __attribute__((aligned(2))) = 1;
uint16_t keyboard_led_stats __attribute__((aligned(2))) = 0;
volatile uint16_t keyboard_idle_count = 0; volatile uint16_t keyboard_idle_count = 0;
static virtual_timer_t keyboard_idle_timer; static virtual_timer_t keyboard_idle_timer;
static void keyboard_idle_timer_cb(void *arg); static void keyboard_idle_timer_cb(void *arg);
return 0; return 0;
} }
osalSysUnlock(); osalSysUnlock();
/* Timeout after 5us if the queue is full.
/* Timeout after 100us if the queue is full.
* Increase this timeout if too much stuff is getting * Increase this timeout if too much stuff is getting
* dropped (i.e. the buffer is getting full too fast * dropped (i.e. the buffer is getting full too fast
* for USB/HIDRAW to dequeue). Another possibility * for USB/HIDRAW to dequeue). Another possibility

+ 1
- 5
tmk_core/protocol/chibios/usb_main.h View File

#define NKRO_REPORT_KEYS (NKRO_EPSIZE - 1) #define NKRO_REPORT_KEYS (NKRO_EPSIZE - 1)
#endif #endif


/* this defines report_keyboard_t and computes REPORT_SIZE defines */
// #include "report.h"

/* extern report_keyboard_t keyboard_report_sent; */ /* extern report_keyboard_t keyboard_report_sent; */


/* keyboard IN request callback handler */ /* keyboard IN request callback handler */
#define CONSOLE_EPSIZE 16 #define CONSOLE_EPSIZE 16


/* Number of IN reports that can be stored inside the output queue */ /* Number of IN reports that can be stored inside the output queue */
#define CONSOLE_QUEUE_CAPACITY 2
#define CONSOLE_QUEUE_BUFFER_SIZE (CONSOLE_QUEUE_CAPACITY * CONSOLE_EPSIZE)
#define CONSOLE_QUEUE_CAPACITY 4


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

Loading…
Cancel
Save