diff options
| author | 2019-04-13 12:40:52 -0400 | |
|---|---|---|
| committer | 2019-04-13 12:40:52 -0400 | |
| commit | 55bfff7cf6541caac172b43186cf14405185b14d (patch) | |
| tree | c1ae99d2b39f8df8933d81ec2e61e81050bdb410 /frontends/calculator/CEdev/examples/keypad_arrows/src | |
| parent | 761462861fc1228e65546c4e0f877d5212320082 (diff) | |
| download | cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.gz cetris-55bfff7cf6541caac172b43186cf14405185b14d.tar.bz2 cetris-55bfff7cf6541caac172b43186cf14405185b14d.zip | |
fix curses on linux
Diffstat (limited to 'frontends/calculator/CEdev/examples/keypad_arrows/src')
| -rw-r--r-- | frontends/calculator/CEdev/examples/keypad_arrows/src/main.c | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/frontends/calculator/CEdev/examples/keypad_arrows/src/main.c b/frontends/calculator/CEdev/examples/keypad_arrows/src/main.c index c4f7adf..e358faf 100644 --- a/frontends/calculator/CEdev/examples/keypad_arrows/src/main.c +++ b/frontends/calculator/CEdev/examples/keypad_arrows/src/main.c @@ -1,49 +1,49 @@ -#include <stdbool.h> -#include <stddef.h> -#include <stdint.h> -#include <tice.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <keypadc.h> - -/* Function Prototypes */ -void fill_screen(uint8_t color); - -void main(void) { - /* Key variable */ - kb_key_t key; - - /* Loop until 2nd is pressed */ - do { - /* Update kb_Data */ - kb_Scan(); - - /* Load group 7 registers */ - key = kb_Data[7]; - - switch (key) { - case kb_Down: /* Change screen color to black */ - fill_screen(0x00); - break; - case kb_Right: /* Change screen color to red */ - fill_screen(0xE0); - break; - case kb_Up: /* Change screen color to white */ - fill_screen(0xFF); - break; - case kb_Left: /* Change screen color to a different red */ - fill_screen(0xC0); - break; - default: - break; - } - } while (kb_Data[1] != kb_2nd); -} - -/* Simple way to fill the screen with a given color */ -void fill_screen(uint8_t color) { - memset(lcd_Ram, color, LCD_SIZE); -} +#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <tice.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <keypadc.h>
+
+/* Function Prototypes */
+void fill_screen(uint8_t color);
+
+void main(void) {
+ /* Key variable */
+ kb_key_t key;
+
+ /* Loop until 2nd is pressed */
+ do {
+ /* Update kb_Data */
+ kb_Scan();
+
+ /* Load group 7 registers */
+ key = kb_Data[7];
+
+ switch (key) {
+ case kb_Down: /* Change screen color to black */
+ fill_screen(0x00);
+ break;
+ case kb_Right: /* Change screen color to red */
+ fill_screen(0xE0);
+ break;
+ case kb_Up: /* Change screen color to white */
+ fill_screen(0xFF);
+ break;
+ case kb_Left: /* Change screen color to a different red */
+ fill_screen(0xC0);
+ break;
+ default:
+ break;
+ }
+ } while (kb_Data[1] != kb_2nd);
+}
+
+/* Simple way to fill the screen with a given color */
+void fill_screen(uint8_t color) {
+ memset(lcd_Ram, color, LCD_SIZE);
+}
|