2 * (c) 2015 flabberast <s3+flabbergast@sdfeu.org>
4 * Based on the following work:
5 * - Guillaume Duc's raw hid example (MIT License)
6 * https://github.com/guiduc/usb-hid-chibios-example
7 * - PJRC Teensy examples (MIT License)
8 * https://www.pjrc.com/teensy/usb_keyboard.html
9 * - hasu's TMK keyboard code (GPL v2 and some code Modified BSD)
10 * https://github.com/tmk/tmk_keyboard/
11 * - ChibiOS demo code (Apache 2.0 License)
12 * http://www.chibios.org
14 * Since some GPL'd code is used, this work is licensed under
26 #include "host_driver.h"
32 #ifdef SLEEP_LED_ENABLE
33 #include "sleep_led.h"
38 /* -------------------------
39 * TMK host driver defs
40 * -------------------------
43 host_driver_t chibios_driver = {
58 palSetPad(GPIOC, GPIOC_LED_BLUE);
59 chThdSleepMilliseconds(400);
60 palClearPad(GPIOC, GPIOC_LED_BLUE);
63 init_usb_driver(&USB_DRIVER);
66 init_printf(NULL,sendchar_pf);
68 /* Wait until the USB is active */
69 while(USB_DRIVER.state != USB_ACTIVE)
70 chThdSleepMilliseconds(50);
72 print("USB configured.\n");
74 /* init TMK modules */
76 host_set_driver(&chibios_driver);
78 #ifdef SLEEP_LED_ENABLE
82 print("Keyboard start.\n");
86 /* TODO: check for suspended event */
89 chThdSleepMilliseconds(5);