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/fileio_detectany/src/main.c | 98 +++++++++++----------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'frontends/calculator/CEdev/examples/fileio_detectany/src') diff --git a/frontends/calculator/CEdev/examples/fileio_detectany/src/main.c b/frontends/calculator/CEdev/examples/fileio_detectany/src/main.c index 6809123..4262abe 100644 --- a/frontends/calculator/CEdev/examples/fileio_detectany/src/main.c +++ b/frontends/calculator/CEdev/examples/fileio_detectany/src/main.c @@ -1,49 +1,49 @@ -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* Function prototypes */ -void printText(int8_t xpos, int8_t ypos, const char *text); - -/* Main Function */ -void main(void) { - /* Declare some variables -- search_pos must be NULL to begin with */ - uint8_t *search_pos = NULL, type; - int8_t y = 0; - ti_var_t myVar; - char *var_name; - - /* First couple bytes of the LibLoad AppVar, which is known to exist * - /* Technically is a null-terminated string, if an odd looking one */ - const char search_string[] = { 0xBF, 0xFE, 0x00 }; - - /* Clear the homescreen */ - os_ClrHome(); - - /* Find all of the variables that start with this string */ - while ((var_name = ti_DetectAny(&search_pos, search_string, &type)) != NULL) { - if (type == TI_APPVAR_TYPE) { - /* Print the name of the variable (Should be LibLoad) */ - printText(0, y++, var_name); - } - } - - /* Wait for a key */ - while (!os_GetCSC()); - - /* Close all open files */ - ti_CloseAll(); -} - -/* Draw text on the homescreen at the given X/Y location */ -void printText(int8_t xpos, int8_t ypos, const char *text) { - os_SetCursorPos(ypos, xpos); - os_PutStrFull(text); -} +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* Function prototypes */ +void printText(int8_t xpos, int8_t ypos, const char *text); + +/* Main Function */ +void main(void) { + /* Declare some variables -- search_pos must be NULL to begin with */ + uint8_t *search_pos = NULL, type; + int8_t y = 0; + ti_var_t myVar; + char *var_name; + + /* First couple bytes of the LibLoad AppVar, which is known to exist * + /* Technically is a null-terminated string, if an odd looking one */ + const char search_string[] = { 0xBF, 0xFE, 0x00 }; + + /* Clear the homescreen */ + os_ClrHome(); + + /* Find all of the variables that start with this string */ + while ((var_name = ti_DetectAny(&search_pos, search_string, &type)) != NULL) { + if (type == TI_APPVAR_TYPE) { + /* Print the name of the variable (Should be LibLoad) */ + printText(0, y++, var_name); + } + } + + /* Wait for a key */ + while (!os_GetCSC()); + + /* Close all open files */ + ti_CloseAll(); +} + +/* Draw text on the homescreen at the given X/Y location */ +void printText(int8_t xpos, int8_t ypos, const char *text) { + os_SetCursorPos(ypos, xpos); + os_PutStrFull(text); +} -- cgit v1.2.3-101-g0448