23#include "gpsacquisition.h"
28#include "devicelist.h"
38static TaskHandle_t vGpsAcquireHandle;
41#define GPS_RX_SIZE 128
43static uint8_t gpsRxBuff[GPS_RX_SIZE];
44static uint8_t gpsRxBuffIdx = 0;
53void vGpsAcquire(
void *argument) {
55 vGpsAcquireHandle = xTaskGetCurrentTaskHandle();
68 TickType_t xLastWakeTime = xTaskGetTickCount();
69 vTaskDelayUntil(&xLastWakeTime, pdMS_TO_TICKS(500));
72 receiver->pollPUBX(receiver);
75 xTaskNotifyWait(0, 0, NULL, portMAX_DELAY);
79 receiver->parsePUBX(receiver, gpsRxBuff, &gpsData);
99void USART3_IRQHandler() {
100 BaseType_t xHigherPriorityTaskWoken = pdFALSE;
103 if (receiver == NULL || vGpsAcquireHandle == NULL)
107 while ((USART3->SR & USART_SR_RXNE) == 0);
108 uint8_t rxData = USART3->DR & 0xFF;
111 gpsRxBuff[gpsRxBuffIdx++] = rxData;
112 gpsRxBuffIdx %= GPS_RX_SIZE;
115 if (rxData == LINE_FEED) {
116 xTaskNotifyFromISR(vGpsAcquireHandle, 0, eNoAction, &xHigherPriorityTaskWoken);
117 portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
bool Topic_publish(PrivateTopic *topic, uint8_t *article)
Publish an "article" to all discovered subscribers of a topic.
#define CREATE_TOPIC(topic, commentInboxSize, messageSize)
Macro to define and initialize a topic instance.
DeviceHandle_t DeviceList_getDeviceHandle(DeviceKey)
Retrieve device handle from list by key.