[X12S] GPS now OK

This commit is contained in:
Bertrand Songis
2016-08-20 16:36:32 +02:00
parent 91dc936ef3
commit 10aefb10db
48 changed files with 730 additions and 436 deletions
+8 -1
View File
@@ -20,6 +20,8 @@
#include "opentx.h"
Fifo<uint8_t, 64> gpsRxFifo;
void gpsInit()
{
GPIO_InitTypeDef GPIO_InitStructure;
@@ -76,8 +78,13 @@ extern "C" void GPS_USART_IRQHandler(void)
while (status & (USART_FLAG_RXNE | USART_FLAG_ERRORS)) {
uint8_t data = GPS_USART->DR;
if (!(status & USART_FLAG_ERRORS)) {
// TODO gpsRxFifo.push(data);
gpsRxFifo.push(data);
}
status = GPS_USART->SR;
}
}
uint8_t gpsGetByte(uint8_t * byte)
{
return gpsRxFifo.pop(*byte);
}