check for core.gpsport nullpointer first
This commit is contained in:
parent
d002f0fdc1
commit
fc1f5c9f1e
5342
obj/baseflight.hex
5342
obj/baseflight.hex
File diff suppressed because it is too large
Load Diff
|
@ -160,8 +160,10 @@ void gpsInitHardware(void)
|
|||
void gpsThread(void)
|
||||
{
|
||||
// read out available GPS bytes
|
||||
while (serialTotalBytesWaiting(core.gpsport))
|
||||
gpsNewData(serialRead(core.gpsport));
|
||||
if (core.gpsport) {
|
||||
while (serialTotalBytesWaiting(core.gpsport))
|
||||
gpsNewData(serialRead(core.gpsport));
|
||||
}
|
||||
|
||||
switch (gpsData.state) {
|
||||
case GPS_UNKNOWN:
|
||||
|
|
Loading…
Reference in New Issue