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 --- .../examples/keypad_multiple_keys/autotester.json | 124 ++++++++++----------- .../CEdev/examples/keypad_multiple_keys/makefile | 30 ++--- .../CEdev/examples/keypad_multiple_keys/readme.md | 20 ++-- .../CEdev/examples/keypad_multiple_keys/src/main.c | 120 ++++++++++---------- 4 files changed, 147 insertions(+), 147 deletions(-) (limited to 'frontends/calculator/CEdev/examples/keypad_multiple_keys') diff --git a/frontends/calculator/CEdev/examples/keypad_multiple_keys/autotester.json b/frontends/calculator/CEdev/examples/keypad_multiple_keys/autotester.json index ea6581f..33e2115 100644 --- a/frontends/calculator/CEdev/examples/keypad_multiple_keys/autotester.json +++ b/frontends/calculator/CEdev/examples/keypad_multiple_keys/autotester.json @@ -1,62 +1,62 @@ -{ - "rom": "84pce_515.rom", - "transfer_files": [ - "bin/DEMO.8xp" - ], - "target": { - "name": "DEMO", - "isASM": true - }, - "sequence": [ - "action|launch", - "delay|500", - "key|down", - "hash|1", - "delay|200", - "key|right", - "hash|2", - "delay|200", - "key|up", - "hash|3", - "delay|200", - "key|left", - "hash|4", - "delay|200", - "key|2nd", - "delay|300", - "hashWait|5" - ], - "hashes": { - "1": { - "description": "The screen shows Down", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "2": { - "description": "The screen shows Right", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "3": { - "description": "The screen shows Up", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "4": { - "description": "The screen shows Left", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "349F4775" ] - }, - "5": { - "description": "Back to the home screen (exit check)", - "start": "vram_start", - "size": "vram_16_size", - "expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44" ] - } - } -} - +{ + "rom": "84pce_515.rom", + "transfer_files": [ + "bin/DEMO.8xp" + ], + "target": { + "name": "DEMO", + "isASM": true + }, + "sequence": [ + "action|launch", + "delay|500", + "key|down", + "hash|1", + "delay|200", + "key|right", + "hash|2", + "delay|200", + "key|up", + "hash|3", + "delay|200", + "key|left", + "hash|4", + "delay|200", + "key|2nd", + "delay|300", + "hashWait|5" + ], + "hashes": { + "1": { + "description": "The screen shows Down", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "349F4775" ] + }, + "2": { + "description": "The screen shows Right", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "349F4775" ] + }, + "3": { + "description": "The screen shows Up", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "349F4775" ] + }, + "4": { + "description": "The screen shows Left", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "349F4775" ] + }, + "5": { + "description": "Back to the home screen (exit check)", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44" ] + } + } +} + diff --git a/frontends/calculator/CEdev/examples/keypad_multiple_keys/makefile b/frontends/calculator/CEdev/examples/keypad_multiple_keys/makefile index 1f1b36b..d3deba8 100644 --- a/frontends/calculator/CEdev/examples/keypad_multiple_keys/makefile +++ b/frontends/calculator/CEdev/examples/keypad_multiple_keys/makefile @@ -1,15 +1,15 @@ -# ---------------------------- -# Set NAME to the program name -# Set ICON to the png icon file name -# Set DESCRIPTION to display within a compatible shell -# Set COMPRESSED to "YES" to create a compressed program -# ---------------------------- - -NAME ?= DEMO -COMPRESSED ?= NO -ICON ?= iconc.png -DESCRIPTION ?= "C SDK Demo" - -# ---------------------------- - -include $(CEDEV)/include/.makefile +# ---------------------------- +# Set NAME to the program name +# Set ICON to the png icon file name +# Set DESCRIPTION to display within a compatible shell +# Set COMPRESSED to "YES" to create a compressed program +# ---------------------------- + +NAME ?= DEMO +COMPRESSED ?= NO +ICON ?= iconc.png +DESCRIPTION ?= "C SDK Demo" + +# ---------------------------- + +include $(CEDEV)/include/.makefile diff --git a/frontends/calculator/CEdev/examples/keypad_multiple_keys/readme.md b/frontends/calculator/CEdev/examples/keypad_multiple_keys/readme.md index 170f907..4a34d2e 100644 --- a/frontends/calculator/CEdev/examples/keypad_multiple_keys/readme.md +++ b/frontends/calculator/CEdev/examples/keypad_multiple_keys/readme.md @@ -1,10 +1,10 @@ -### Keypad Multiple Keys Demo - -This demo shows how to interpret multiple keypresses at the same time - -![Screenshot](screenshot.gif) - ---- - -This demo is a part of the C SDK Toolchain for use on the CE. - +### Keypad Multiple Keys Demo + +This demo shows how to interpret multiple keypresses at the same time + +![Screenshot](screenshot.gif) + +--- + +This demo is a part of the C SDK Toolchain for use on the CE. + diff --git a/frontends/calculator/CEdev/examples/keypad_multiple_keys/src/main.c b/frontends/calculator/CEdev/examples/keypad_multiple_keys/src/main.c index fbe3ffa..715d437 100644 --- a/frontends/calculator/CEdev/examples/keypad_multiple_keys/src/main.c +++ b/frontends/calculator/CEdev/examples/keypad_multiple_keys/src/main.c @@ -1,60 +1,60 @@ -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* Function prototypes */ -void printText(int8_t xpos, int8_t ypos, const char *text); - -void main(void) { - /* Key variable */ - kb_key_t key; - const char *erase_string = " "; - - /* Clear the homescreen */ - os_ClrHome(); - - /* Loop until 2nd is pressed */ - do { - - /* Update kb_Data */ - kb_Scan(); - - key = kb_Data[7]; - - /* Print the current arrow key input */ - if (key & kb_Down) { - printText(0, 0, "Down"); - } else { - printText(0, 0, erase_string); - } - if (key & kb_Up) { - printText(0, 1, "Up"); - } else { - printText(0, 1, erase_string); - } - if (key & kb_Left) { - printText(0, 2, "Left"); - } else { - printText(0, 2, erase_string); - } - if (key & kb_Right) { - printText(0, 3, "Right"); - } else { - printText(0, 3, erase_string); - } - - } while (kb_Data[1] != kb_2nd); -} - -/* 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); + +void main(void) { + /* Key variable */ + kb_key_t key; + const char *erase_string = " "; + + /* Clear the homescreen */ + os_ClrHome(); + + /* Loop until 2nd is pressed */ + do { + + /* Update kb_Data */ + kb_Scan(); + + key = kb_Data[7]; + + /* Print the current arrow key input */ + if (key & kb_Down) { + printText(0, 0, "Down"); + } else { + printText(0, 0, erase_string); + } + if (key & kb_Up) { + printText(0, 1, "Up"); + } else { + printText(0, 1, erase_string); + } + if (key & kb_Left) { + printText(0, 2, "Left"); + } else { + printText(0, 2, erase_string); + } + if (key & kb_Right) { + printText(0, 3, "Right"); + } else { + printText(0, 3, erase_string); + } + + } while (kb_Data[1] != kb_2nd); +} + +/* 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