[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
+1
View File
@@ -44,6 +44,7 @@ set(GUI_SRC
${LAYOUTS_SRC}
${WIDGETS_SRC}
)
set(SRC ${SRC} gps.cpp)
if(HELI)
set(GUI_SRC ${GUI_SRC} model_heli.cpp)
endif()
+6
View File
@@ -391,7 +391,13 @@ void hapticOff(void);
void hapticOn(uint32_t pwmPercent);
// GPS driver
#if PCBREV >= 13
#define INTERNAL_GPS 1
#else
#define INTERNAL_GPS 0
#endif
void gpsInit(void);
uint8_t gpsGetByte(uint8_t * byte);
// Second serial port driver
#define DEBUG_BAUDRATE 115200
+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);
}