[X12S] GPS now OK
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user