Configurable serializer thread priority

This commit is contained in:
Fred Sundvik 2016-05-15 12:59:50 +03:00
parent a08bcea998
commit b4ab61171e

View File

@ -32,6 +32,7 @@ SOFTWARE.
#include "matrix.h" #include "matrix.h"
#include <stdbool.h> #include <stdbool.h>
#include "print.h" #include "print.h"
#include "config.h"
static event_source_t new_data_event; static event_source_t new_data_event;
static bool serial_link_connected; static bool serial_link_connected;
@ -50,10 +51,15 @@ host_driver_t serial_driver = {
send_consumer send_consumer
}; };
// Define these in your Config.h file
#ifndef SERIAL_LINK_BAUD #ifndef SERIAL_LINK_BAUD
#error "Serial link baud is not set" #error "Serial link baud is not set"
#endif #endif
#ifndef SERIAL_LINK_THREAD_PRIORITY
#error "Serial link thread priority not set"
#endif
static SerialConfig config = { static SerialConfig config = {
.sc_speed = SERIAL_LINK_BAUD .sc_speed = SERIAL_LINK_BAUD
}; };
@ -184,7 +190,7 @@ void init_serial_link(void) {
sdStart(&SD2, &config); sdStart(&SD2, &config);
chEvtObjectInit(&new_data_event); chEvtObjectInit(&new_data_event);
(void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), (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); void matrix_set_remote(matrix_row_t* rows, uint8_t index);