diff options
| author | Fred Sundvik <fsundvik@gmail.com> | 2016-05-15 12:59:50 +0300 |
|---|---|---|
| committer | Fred Sundvik <fsundvik@gmail.com> | 2016-05-15 12:59:50 +0300 |
| commit | b4ab61171e83eeca82fbc1930fcaab175b45c656 (patch) | |
| tree | 4ea4e97213d6e122454e90ff87b0308562bad52c | |
| parent | a08bcea9983cc97fb2f567c303622495f19a5a1e (diff) | |
| download | qmk_firmware-b4ab61171e83eeca82fbc1930fcaab175b45c656.tar.gz qmk_firmware-b4ab61171e83eeca82fbc1930fcaab175b45c656.zip | |
Configurable serializer thread priority
| -rw-r--r-- | serial_link/system/system.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/serial_link/system/system.c b/serial_link/system/system.c index 5a47d8b83..f5af9baa7 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c | |||
| @@ -32,6 +32,7 @@ SOFTWARE. | |||
| 32 | #include "matrix.h" | 32 | #include "matrix.h" |
| 33 | #include <stdbool.h> | 33 | #include <stdbool.h> |
| 34 | #include "print.h" | 34 | #include "print.h" |
| 35 | #include "config.h" | ||
| 35 | 36 | ||
| 36 | static event_source_t new_data_event; | 37 | static event_source_t new_data_event; |
| 37 | static bool serial_link_connected; | 38 | static bool serial_link_connected; |
| @@ -50,10 +51,15 @@ host_driver_t serial_driver = { | |||
| 50 | send_consumer | 51 | send_consumer |
| 51 | }; | 52 | }; |
| 52 | 53 | ||
| 54 | // Define these in your Config.h file | ||
| 53 | #ifndef SERIAL_LINK_BAUD | 55 | #ifndef SERIAL_LINK_BAUD |
| 54 | #error "Serial link baud is not set" | 56 | #error "Serial link baud is not set" |
| 55 | #endif | 57 | #endif |
| 56 | 58 | ||
| 59 | #ifndef SERIAL_LINK_THREAD_PRIORITY | ||
| 60 | #error "Serial link thread priority not set" | ||
| 61 | #endif | ||
| 62 | |||
| 57 | static SerialConfig config = { | 63 | static SerialConfig config = { |
| 58 | .sc_speed = SERIAL_LINK_BAUD | 64 | .sc_speed = SERIAL_LINK_BAUD |
| 59 | }; | 65 | }; |
| @@ -184,7 +190,7 @@ void init_serial_link(void) { | |||
| 184 | sdStart(&SD2, &config); | 190 | sdStart(&SD2, &config); |
| 185 | chEvtObjectInit(&new_data_event); | 191 | chEvtObjectInit(&new_data_event); |
| 186 | (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), | 192 | (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), |
| 187 | LOWPRIO, serialThread, NULL); | 193 | SERIAL_LINK_THREAD_PRIORITY, serialThread, NULL); |
| 188 | } | 194 | } |
| 189 | 195 | ||
| 190 | void matrix_set_remote(matrix_row_t* rows, uint8_t index); | 196 | void matrix_set_remote(matrix_row_t* rows, uint8_t index); |
