From 55bfff7cf6541caac172b43186cf14405185b14d Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 13 Apr 2019 12:40:52 -0400 Subject: fix curses on linux --- .../CEdev/examples/gfx_hello_world/src/main.c | 92 +++++++++++----------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'frontends/calculator/CEdev/examples/gfx_hello_world/src') diff --git a/frontends/calculator/CEdev/examples/gfx_hello_world/src/main.c b/frontends/calculator/CEdev/examples/gfx_hello_world/src/main.c index 852120e..3843dca 100644 --- a/frontends/calculator/CEdev/examples/gfx_hello_world/src/main.c +++ b/frontends/calculator/CEdev/examples/gfx_hello_world/src/main.c @@ -1,46 +1,46 @@ -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#define FONT_HEIGHT 8 - -/* Function prototypes */ -void print_string_centered(const char *str); - -void main(void) { - const char *msg = "Hello World!"; - - /* Seed the random numbers */ - srand(rtc_Time()); - - /* Initialize the 8bpp graphics */ - gfx_Begin(); - - /* Fill the screen black */ - gfx_FillScreen(gfx_black); - - /* Set the random text color */ - gfx_SetTextFGColor(randInt(1, 255)); - - /* Print the message on the screen */ - print_string_centered(msg); - - /* Wait for a key to be pressed */ - while (!os_GetCSC()); - - /* Close the graphics */ - gfx_End(); -} - -/* Prints a screen centered string */ -void print_string_centered(const char *str) { - gfx_PrintStringXY(str, (LCD_WIDTH - gfx_GetStringWidth(str)) / 2, (LCD_HEIGHT - FONT_HEIGHT) / 2); -} +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define FONT_HEIGHT 8 + +/* Function prototypes */ +void print_string_centered(const char *str); + +void main(void) { + const char *msg = "Hello World!"; + + /* Seed the random numbers */ + srand(rtc_Time()); + + /* Initialize the 8bpp graphics */ + gfx_Begin(); + + /* Fill the screen black */ + gfx_FillScreen(gfx_black); + + /* Set the random text color */ + gfx_SetTextFGColor(randInt(1, 255)); + + /* Print the message on the screen */ + print_string_centered(msg); + + /* Wait for a key to be pressed */ + while (!os_GetCSC()); + + /* Close the graphics */ + gfx_End(); +} + +/* Prints a screen centered string */ +void print_string_centered(const char *str) { + gfx_PrintStringXY(str, (LCD_WIDTH - gfx_GetStringWidth(str)) / 2, (LCD_HEIGHT - FONT_HEIGHT) / 2); +} -- cgit v1.2.3-101-g0448