Commit 7fe44961 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

More debugging of GPS parsing in task, still not working

Tried:
- configuring to less than configMAX_SYSCALL_INTERRUPT_PRIORITY the priorities
of IRQs which have handlers that use FreeRTOS API ISR-'safe' functions to
<give> semaphores, queues
- adding counters to see how many times the IRQ fired, and how many times
the task fired
- etc., etc.
parent 031eb91e
......@@ -33,6 +33,8 @@ extern char gps_rxbuf[GPS_RXBUF_SIZE];
extern xSemaphoreHandle semGps;
int gcnt = 0;
void gpsbkgrnd_main(void *params)
{
/* suppress compiler warning */
......@@ -40,6 +42,7 @@ void gpsbkgrnd_main(void *params)
while (1) {
if (xSemaphoreTake(semGps, portMAX_DELAY) == pdTRUE) {
gcnt++;
gps_parse_nmea(gps_rxbuf);
gps_set_framerdy(0);
}
......
......@@ -117,6 +117,8 @@ static volatile int store = 0;
extern xSemaphoreHandle semGps;
volatile int icnt = 0;
void LEUART0_IRQHandler(void)
{
char c;
......@@ -135,6 +137,7 @@ void LEUART0_IRQHandler(void)
/* Signal task that frame is ready */
if ((idx > 2) &&
(gps_rxbuf[idx-2] == '\r') && (gps_rxbuf[idx-1] == '\n')) {
icnt++;
gps_rxbuf[idx] = '\0';
idx = 0;
store = 0;
......@@ -146,3 +149,8 @@ void LEUART0_IRQHandler(void)
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
}
void Assert_Handler()
{
;
}
......@@ -54,8 +54,16 @@ int main(void)
ui_init();
vSemaphoreCreateBinary(semGps);
xSemaphoreTake(semGps, 0);
gps_init();
uint32_t p;
p = 1 + (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8 - __NVIC_PRIO_BITS));
NVIC_SetPriority(BURTC_IRQn, p);
NVIC_SetPriority(GPIO_ODD_IRQn, p);
NVIC_SetPriority(GPIO_EVEN_IRQn, p);
NVIC_SetPriority(LEUART0_IRQn, p);
GPIO_PinModeSet(gpioPortE, 11, gpioModePushPull, 0);
GPIO_PinModeSet(gpioPortE, 12, gpioModePushPull, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment