diff --git a/openrtx/include/core/gps.h b/openrtx/include/core/gps.h index c6a975fb..0577fc23 100644 --- a/openrtx/include/core/gps.h +++ b/openrtx/include/core/gps.h @@ -33,7 +33,7 @@ typedef struct uint16_t azimuth; // Azimuth in degrees uint8_t snr; // Quality of the signal in range 0-99 } -sat_t; +gpssat_t; /** * Data structure representing the last state received from the GPS module. @@ -45,7 +45,7 @@ typedef struct uint8_t fix_type; // 0: no fix, 1: 2D, 2: 3D 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 + gpssat_t satellites[12]; // Details about satellites in view uint32_t active_sats; // Bitmap representing which sats are part of the fix float latitude; // Latitude coordinates float longitude; // Longitude coordinates diff --git a/openrtx/include/interfaces/graphics.h b/openrtx/include/interfaces/graphics.h index ba1dfa7b..e9832ee2 100644 --- a/openrtx/include/interfaces/graphics.h +++ b/openrtx/include/interfaces/graphics.h @@ -73,8 +73,8 @@ extern "C" { */ typedef struct point_t { - uint16_t x; - uint16_t y; + int16_t x; + int16_t y; } point_t; /** @@ -329,7 +329,7 @@ void gfx_drawSmeterLevel(point_t start, uint16_t width, uint16_t height, float r * @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, uint32_t active_sats); +void gfx_drawGPSgraph(point_t start, uint16_t width, uint16_t height, gpssat_t *sats, uint32_t active_sats); /** * Function to draw a compass of arbitrary size. diff --git a/openrtx/src/core/gps.c b/openrtx/src/core/gps.c index e9bb25b6..830b8722 100644 --- a/openrtx/src/core/gps.c +++ b/openrtx/src/core/gps.c @@ -138,7 +138,7 @@ void gps_taskFunc() // When the first sentence arrives, clear all the old data if (frame.msg_nr == 1) { - bzero(&gps_data.satellites[0], 12 * sizeof(sat_t)); + bzero(&gps_data.satellites[0], 12 * sizeof(gpssat_t)); } gps_data.satellites_in_view = frame.total_sats; diff --git a/openrtx/src/core/graphics.cpp b/openrtx/src/core/graphics.cpp index ea5058fe..a35e58dc 100644 --- a/openrtx/src/core/graphics.cpp +++ b/openrtx/src/core/graphics.cpp @@ -169,7 +169,8 @@ void gfx_fillScreen(color_t color) inline void gfx_setPixel(point_t pos, color_t color) { - if (pos.x >= SCREEN_WIDTH || pos.y >= SCREEN_HEIGHT) + if (pos.x >= SCREEN_WIDTH || pos.y >= SCREEN_HEIGHT + || pos.x < 0 || pos.y < 0) return; // off the screen #ifdef PIX_FMT_RGB565 @@ -818,7 +819,7 @@ void gfx_drawSmeterLevel(point_t start, uint16_t width, uint16_t height, float r void gfx_drawGPSgraph(point_t start, uint16_t width, uint16_t height, - sat_t *sats, + gpssat_t *sats, uint32_t active_sats) { color_t white = {255, 255, 255, 255};