core: gps: skip active satellites with ID > 31
Some GPS modules can work on multiple systems at the same time. However, the current code has been written only for GPS and, consequently is not able to manage satellites with an ID greater than 32. This commit provides an hotfix until all the GPS code gets refactored an extended to support also GLONASS and Galileo. Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
This commit is contained in:
parent
f2f84f3da1
commit
b3b057699b
|
|
@ -109,7 +109,7 @@ void gps_task(const struct gpsDevice *dev)
|
||||||
gps_data.fix_type = frame.fix_type;
|
gps_data.fix_type = frame.fix_type;
|
||||||
for (int i = 0; i < 12; i++)
|
for (int i = 0; i < 12; i++)
|
||||||
{
|
{
|
||||||
if (frame.sats[i] != 0)
|
if (frame.sats[i] != 0 && frame.sats[i] < 31)
|
||||||
{
|
{
|
||||||
gps_data.active_sats |= 1 << (frame.sats[i] - 1);
|
gps_data.active_sats |= 1 << (frame.sats[i] - 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue