diff --git a/openrtx/include/interfaces/graphics.h b/openrtx/include/interfaces/graphics.h index fd003a92..8ea62d94 100644 --- a/openrtx/include/interfaces/graphics.h +++ b/openrtx/include/interfaces/graphics.h @@ -269,7 +269,7 @@ void gfx_drawSmeter(point_t start, uint16_t width, uint16_t height, float rssi, * @param sats: pointer to the array of satellites data * @param active_sats: bitset representing which sats are part of the fix */ -void gfx_drawGPSgraph(point_t start, uint16_t width, uint16_t height, sat_t *sats, uint16_t active_sats); +void gfx_drawGPSgraph(point_t start, uint16_t width, uint16_t height, sat_t *sats, uint32_t active_sats); /** * Function to draw a compass of arbitrary size. diff --git a/openrtx/include/state.h b/openrtx/include/state.h index 1945ce4d..0838906f 100644 --- a/openrtx/include/state.h +++ b/openrtx/include/state.h @@ -49,7 +49,7 @@ typedef struct uint8_t satellites_tracked; // Number of tracked satellites uint8_t satellites_in_view; // Satellites in view sat_t satellites[12]; // Details about satellites in view - uint16_t active_sats; // Bitmap representing which sats are part of the fix + uint32_t active_sats; // Bitmap representing which sats are part of the fix float latitude; // Latitude coordinates float longitude; // Longitude coordinates float altitude; // Antenna altitude above mean sea level (geoid) in m diff --git a/openrtx/src/gps.c b/openrtx/src/gps.c index 18b1e344..393649d0 100644 --- a/openrtx/src/gps.c +++ b/openrtx/src/gps.c @@ -67,7 +67,7 @@ void gps_taskFunc(char *line, int len, gps_t *state) { if (frame.sats[i] != 0) { - state->active_sats |= 1 << frame.sats[i]; + state->active_sats |= 1 << (frame.sats[i] - 1); } } } diff --git a/openrtx/src/graphics.c b/openrtx/src/graphics.c index ad5c1c37..145b0fdb 100644 --- a/openrtx/src/graphics.c +++ b/openrtx/src/graphics.c @@ -642,7 +642,7 @@ void gfx_drawGPSgraph(point_t start, uint16_t width, uint16_t height, sat_t *sats, - uint16_t active_sats) + uint32_t active_sats) { color_t white = {255, 255, 255, 255}; color_t yellow = {250, 180, 19 , 255}; @@ -656,7 +656,7 @@ void gfx_drawGPSgraph(point_t start, bar_height = (height - 8) * sats[i].snr / 100 + 1; point_t bar_pos = {start.x + 2 + i * (bar_width + 2), start.y + (height - 8) - bar_height}; - color_t bar_color = (active_sats & 1 << sats[i].id) ? yellow : white; + color_t bar_color = (active_sats & 1 << (sats[i].id - 1)) ? yellow : white; gfx_drawRect(bar_pos, bar_width, bar_height, bar_color, true); snprintf(id_buf, 5, "%2d ", sats[i].id); point_t id_pos = {bar_pos.x, start.y + height};