diff options
| author | Alex Ong <the.onga@gmail.com> | 2019-01-04 19:39:14 +1100 |
|---|---|---|
| committer | Alex Ong <the.onga@gmail.com> | 2019-01-04 19:39:14 +1100 |
| commit | 47c91fc7f75ae0a477e55b687aa0fc30da0a283c (patch) | |
| tree | 65ad39452748ff2e6d4a83ce54ede6ca22c9ada9 /tmk_core/protocol/chibios/main.c | |
| parent | ac9b88e8ccbbf38762871504cd827ff0d941c426 (diff) | |
| parent | 563ce3f225d981ce460c12ca5130dfe47af41df0 (diff) | |
| download | qmk_firmware-47c91fc7f75ae0a477e55b687aa0fc30da0a283c.tar.gz qmk_firmware-47c91fc7f75ae0a477e55b687aa0fc30da0a283c.zip | |
Merge branch 'master' of https://github.com/qmk/qmk_firmware
Diffstat (limited to 'tmk_core/protocol/chibios/main.c')
| -rw-r--r-- | tmk_core/protocol/chibios/main.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index f2abc438d..ee9571c95 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c | |||
| @@ -44,6 +44,9 @@ | |||
| 44 | #ifdef MIDI_ENABLE | 44 | #ifdef MIDI_ENABLE |
| 45 | #include "qmk_midi.h" | 45 | #include "qmk_midi.h" |
| 46 | #endif | 46 | #endif |
| 47 | #ifdef STM32_EEPROM_ENABLE | ||
| 48 | #include "eeprom_stm32.h" | ||
| 49 | #endif | ||
| 47 | #include "suspend.h" | 50 | #include "suspend.h" |
| 48 | #include "wait.h" | 51 | #include "wait.h" |
| 49 | 52 | ||
| @@ -72,7 +75,7 @@ host_driver_t chibios_driver = { | |||
| 72 | void virtser_task(void); | 75 | void virtser_task(void); |
| 73 | #endif | 76 | #endif |
| 74 | 77 | ||
| 75 | #ifdef RAW_HID_ENABLE | 78 | #ifdef RAW_ENABLE |
| 76 | void raw_hid_task(void); | 79 | void raw_hid_task(void); |
| 77 | #endif | 80 | #endif |
| 78 | 81 | ||
| @@ -109,6 +112,10 @@ int main(void) { | |||
| 109 | halInit(); | 112 | halInit(); |
| 110 | chSysInit(); | 113 | chSysInit(); |
| 111 | 114 | ||
| 115 | #ifdef STM32_EEPROM_ENABLE | ||
| 116 | EEPROM_init(); | ||
| 117 | #endif | ||
| 118 | |||
| 112 | // TESTING | 119 | // TESTING |
| 113 | // chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); | 120 | // chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); |
| 114 | 121 | ||
| @@ -135,10 +142,15 @@ int main(void) { | |||
| 135 | 142 | ||
| 136 | /* Wait until the USB or serial link is active */ | 143 | /* Wait until the USB or serial link is active */ |
| 137 | while (true) { | 144 | while (true) { |
| 145 | #if defined(WAIT_FOR_USB) || defined(SERIAL_LINK_ENABLE) | ||
| 138 | if(USB_DRIVER.state == USB_ACTIVE) { | 146 | if(USB_DRIVER.state == USB_ACTIVE) { |
| 139 | driver = &chibios_driver; | 147 | driver = &chibios_driver; |
| 140 | break; | 148 | break; |
| 141 | } | 149 | } |
| 150 | #else | ||
| 151 | driver = &chibios_driver; | ||
| 152 | break; | ||
| 153 | #endif | ||
| 142 | #ifdef SERIAL_LINK_ENABLE | 154 | #ifdef SERIAL_LINK_ENABLE |
| 143 | if(is_serial_link_connected()) { | 155 | if(is_serial_link_connected()) { |
| 144 | driver = get_serial_link_driver(); | 156 | driver = get_serial_link_driver(); |
| @@ -171,6 +183,7 @@ int main(void) { | |||
| 171 | /* Main loop */ | 183 | /* Main loop */ |
| 172 | while(true) { | 184 | while(true) { |
| 173 | 185 | ||
| 186 | #if !defined(NO_USB_STARTUP_CHECK) | ||
| 174 | if(USB_DRIVER.state == USB_SUSPENDED) { | 187 | if(USB_DRIVER.state == USB_SUSPENDED) { |
| 175 | print("[s]"); | 188 | print("[s]"); |
| 176 | #ifdef VISUALIZER_ENABLE | 189 | #ifdef VISUALIZER_ENABLE |
| @@ -198,6 +211,7 @@ int main(void) { | |||
| 198 | visualizer_resume(); | 211 | visualizer_resume(); |
| 199 | #endif | 212 | #endif |
| 200 | } | 213 | } |
| 214 | #endif | ||
| 201 | 215 | ||
| 202 | keyboard_task(); | 216 | keyboard_task(); |
| 203 | #ifdef CONSOLE_ENABLE | 217 | #ifdef CONSOLE_ENABLE |
| @@ -206,7 +220,7 @@ int main(void) { | |||
| 206 | #ifdef VIRTSER_ENABLE | 220 | #ifdef VIRTSER_ENABLE |
| 207 | virtser_task(); | 221 | virtser_task(); |
| 208 | #endif | 222 | #endif |
| 209 | #ifdef RAW_HID_ENABLE | 223 | #ifdef RAW_ENABLE |
| 210 | raw_hid_task(); | 224 | raw_hid_task(); |
| 211 | #endif | 225 | #endif |
| 212 | } | 226 | } |
