add graphics_rgb565.c to linux target, fixed compilation errors

replace/cefeb8365c901dfbab2fdadae0f4dffc48d594e9
Federico Amedeo Izzo 2020-10-09 09:51:29 +02:00 zatwierdzone przez Niccolò Izzo
rodzic 0a3249522f
commit 94bece00c0
3 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -60,7 +60,8 @@ dep = [sdl_dep, threads_dep]
## Platform specialization
##
linux_src = src + ['tests/platform/x64_uC.c',
'platform/drivers/display/display_libSDL.c']
'platform/drivers/display/display_libSDL.c',
'openrtx/src/graphics/graphics_rgb565.c']
linux_def = def + {'SCREEN_WIDTH': 160, 'SCREEN_HEIGHT': 128}
##

Wyświetl plik

@ -149,6 +149,6 @@ void graphics_drawLine(point_t start, point_t end, color_t color);
* @param color: border and fill color, in color_t format.
* @param fill: if true the rectangle will be solid, otherwise it will have a 1-pixel border
*/
void graphics_drawRect(uint16_t width, uint16_t height, color_t color, bool fill);
void graphics_drawRect(point_t start, uint16_t width, uint16_t height, color_t color, bool fill);
#endif /* GRAPHICS_H */

Wyświetl plik

@ -26,10 +26,10 @@
typedef struct rgb565_t
{
uint16_t r : 5
uint16_t g : 6
uint16_t b : 5
} rgb565_t
uint16_t r : 5;
uint16_t g : 6;
uint16_t b : 5;
} rgb565_t;
bool initialized = 0;
uint16_t screen_width = 0;
@ -129,7 +129,7 @@ void graphics_drawRect(point_t start, uint16_t width, uint16_t height, color_t c
x_max = screen_width - 1;
uint16_t y_max = start.y + height;
if(y_max > (screen_heigth - 1))
y_max = screen_height - 1;
y_max = screen_heigth - 1;
for(int y=start.y; y < y_max; y++)
{
for(int x=start.x; x < x_max; x++)