From 411e983ccff3704c949040f6d3f3e922d1d575af Mon Sep 17 00:00:00 2001 From: Felix Raimundo Date: Wed, 23 Mar 2016 11:42:32 +0100 Subject: [PATCH] Final pass at removing the warnings. Change-Id: I4cd0276c97112e69fe2449c8db5eaaa1c186dfb6 --- ion/include/ion/framebuffer.h | 2 +- ion/src/blackbox/ion.c | 2 +- ion/src/device/display/framebuffer.c | 2 +- ion/src/device/display/st7586.c | 4 ++-- ion/src/simulator/init.cpp | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ion/include/ion/framebuffer.h b/ion/include/ion/framebuffer.h index 348514546..ffbfd415f 100644 --- a/ion/include/ion/framebuffer.h +++ b/ion/include/ion/framebuffer.h @@ -3,7 +3,7 @@ #include -void ion_set_pixel(uint8_t x, uint8_t y, uint8_t color); +void ion_set_pixel(uint16_t x, uint16_t y, uint8_t color); #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 diff --git a/ion/src/blackbox/ion.c b/ion/src/blackbox/ion.c index 3de2ee775..ba60a9b25 100644 --- a/ion/src/blackbox/ion.c +++ b/ion/src/blackbox/ion.c @@ -1,7 +1,7 @@ #include #include -void ion_set_pixel(uint8_t x, uint8_t y, uint8_t color) { +void ion_set_pixel(uint16_t x, uint16_t y, uint8_t color) { } bool ion_key_down(ion_key_t key) { diff --git a/ion/src/device/display/framebuffer.c b/ion/src/device/display/framebuffer.c index 71f6b2bcd..26053a36a 100644 --- a/ion/src/device/display/framebuffer.c +++ b/ion/src/device/display/framebuffer.c @@ -12,7 +12,7 @@ * those pixels and have to resort to two pixels per byte using the following * format : AAxBBxxx, where AA and BB are the bits for two contiguous pixels. */ -void ion_set_pixel(uint8_t x, uint8_t y, uint8_t color) { +void ion_set_pixel(uint16_t x, uint16_t y, uint8_t color) { assert(x <= FRAMEBUFFER_WIDTH); assert(y <= FRAMEBUFFER_HEIGHT); diff --git a/ion/src/device/display/st7586.c b/ion/src/device/display/st7586.c index cc50de375..2a01c804f 100644 --- a/ion/src/device/display/st7586.c +++ b/ion/src/device/display/st7586.c @@ -32,8 +32,8 @@ typedef struct { static void perform_instruction(st7586_t * c, instruction_t instruction) { if (instruction.mode == DELAY_MODE) { // FIXME: Should sleep instruction->payload miliseconds - // FIXME: This can be optimized away by the compiler! - for (volatile int i = 0; i < 800*instruction.payload; i++) { + for (int i = 0; i < 800*instruction.payload; i++) { + __asm volatile("nop"); } } else { c->data_command_pin_write(instruction.mode); diff --git a/ion/src/simulator/init.cpp b/ion/src/simulator/init.cpp index ee18e00ae..1421b5901 100644 --- a/ion/src/simulator/init.cpp +++ b/ion/src/simulator/init.cpp @@ -24,7 +24,6 @@ void init_platform() { int margin = 10; int screen_width = SCREEN_WIDTH; int screen_height = SCREEN_HEIGHT; - // keyboard_width == screen_width int keyboard_height = screen_width; Fl_Window * window = new Fl_Window(screen_width+2*margin, margin+screen_height+margin+keyboard_height+margin); @@ -35,10 +34,10 @@ void init_platform() { sKeyboard = new FltkKbd(margin, margin+screen_height+margin, screen_width, keyboard_height); window->end(); - window->show(NULL, NULL); + window->show(0, NULL); } -void ion_set_pixel(uint8_t x, uint8_t y, uint8_t color) { +void ion_set_pixel(uint16_t x, uint16_t y, uint8_t color) { assert(x <= SCREEN_WIDTH); assert(y <= SCREEN_HEIGHT); char * byte = (char *)(FRAMEBUFFER_ADDRESS) + ((y*SCREEN_WIDTH)+x);