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 /serial_link | |
parent | a08bcea9983cc97fb2f567c303622495f19a5a1e (diff) |
Configurable serializer thread priority
Diffstat (limited to 'serial_link')
-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 5a47d8b83c..f5af9baa74 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -32,6 +32,7 @@ SOFTWARE. #include "matrix.h" #include <stdbool.h> #include "print.h" +#include "config.h" static event_source_t new_data_event; static bool serial_link_connected; @@ -50,10 +51,15 @@ host_driver_t serial_driver = { send_consumer }; +// Define these in your Config.h file #ifndef SERIAL_LINK_BAUD #error "Serial link baud is not set" #endif +#ifndef SERIAL_LINK_THREAD_PRIORITY +#error "Serial link thread priority not set" +#endif + static SerialConfig config = { .sc_speed = SERIAL_LINK_BAUD }; @@ -184,7 +190,7 @@ void init_serial_link(void) { sdStart(&SD2, &config); chEvtObjectInit(&new_data_event); (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), - LOWPRIO, serialThread, NULL); + SERIAL_LINK_THREAD_PRIORITY, serialThread, NULL); } void matrix_set_remote(matrix_row_t* rows, uint8_t index); |