mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
trying to free up USART IRQ from GPS aids
This commit is contained in:
parent
a8f383077c
commit
1898fd43fd
2 changed files with 2796 additions and 2789 deletions
5578
obj/baseflight.hex
5578
obj/baseflight.hex
File diff suppressed because it is too large
Load diff
|
@ -93,7 +93,8 @@ void gpsInit(uint8_t baudrateIndex)
|
|||
mode = MODE_RX;
|
||||
|
||||
gpsSetPIDs();
|
||||
core.gpsport = uartOpen(USART2, gpsNewData, gpsInitData[baudrateIndex].baudrate, mode);
|
||||
// Open GPS UART, no callback - buffer will be read out in gpsThread()
|
||||
core.gpsport = uartOpen(USART2, NULL, gpsInitData[baudrateIndex].baudrate, mode);
|
||||
// signal GPS "thread" to initialize when it gets to it
|
||||
gpsSetState(GPS_INITIALIZING);
|
||||
}
|
||||
|
@ -158,6 +159,10 @@ void gpsInitHardware(void)
|
|||
|
||||
void gpsThread(void)
|
||||
{
|
||||
// read out available GPS bytes
|
||||
while (uartTotalBytesWaiting(core.gpsport))
|
||||
gpsNewData(uartRead(core.gpsport));
|
||||
|
||||
switch (gpsData.state) {
|
||||
case GPS_UNKNOWN:
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue