aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-04-14 21:47:14 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-04-14 21:47:14 +0200
commitb78a68e23216dd4f3c08f8101ba13ad713452206 (patch)
tree95d28d10413ce1409b5758f962797485971f2a00 /src/common
parentb9da01524a915c5a97027ab38b3026d32e2764c7 (diff)
downloadglutte-o-matic-b78a68e23216dd4f3c08f8101ba13ad713452206.tar.gz
glutte-o-matic-b78a68e23216dd4f3c08f8101ba13ad713452206.tar.bz2
glutte-o-matic-b78a68e23216dd4f3c08f8101ba13ad713452206.zip
Properly use queues from ISR
Diffstat (limited to 'src/common')
-rw-r--r--src/common/src/Core/main.c2
-rw-r--r--src/common/src/GPIO/usart.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c
index da3a27b..b308f08 100644
--- a/src/common/src/Core/main.c
+++ b/src/common/src/Core/main.c
@@ -225,7 +225,7 @@ static void launcher_task(void __attribute__ ((unused))*pvParameters)
"TaskNF",
3*configMINIMAL_STACK_SIZE,
(void*) NULL,
- tskIDLE_PRIORITY + 2UL,
+ tskIDLE_PRIORITY + 3UL,
&task_handle);
if (!task_handle) {
diff --git a/src/common/src/GPIO/usart.c b/src/common/src/GPIO/usart.c
index 535b062..8bcd80a 100644
--- a/src/common/src/GPIO/usart.c
+++ b/src/common/src/GPIO/usart.c
@@ -134,7 +134,9 @@ void usart_process_char(char c) {
usart_debug("Unknown command %c\r\n", c);
}
-void usart_gps_process_char(char c) {
+void usart_gps_process_char(char c)
+{
+ BaseType_t require_context_switch = pdFALSE;
if (nmea_sentence_last_written == 0) {
if (c == '$') {
@@ -151,7 +153,7 @@ void usart_gps_process_char(char c) {
int success = xQueueSendToBackFromISR(
usart_nmea_queue,
nmea_sentence,
- NULL);
+ &require_context_switch);
if (success == pdFALSE) {
trigger_fault(FAULT_SOURCE_USART);
@@ -165,4 +167,5 @@ void usart_gps_process_char(char c) {
usart_clear_nmea_buffer();
}
+ portYIELD_FROM_ISR(require_context_switch);
}