diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2018-03-29 21:26:53 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2018-03-29 21:26:53 -0400 |
commit | 50233fff403da32473aa499ad45ab4770471966a (patch) | |
tree | 19986d0282dd3d1b585366362b7ac9bfc07e8c01 /src | |
parent | 93396d69eb71cb724d47dc927becf5a129baa168 (diff) |
new initrd format work, bigger keypad
Diffstat (limited to 'src')
-rw-r--r-- | src/keypad.c | 36 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/script.c | 5 |
3 files changed, 24 insertions, 19 deletions
diff --git a/src/keypad.c b/src/keypad.c index f76271c..5fe2537 100644 --- a/src/keypad.c +++ b/src/keypad.c @@ -23,17 +23,19 @@ #include <gpio.h> #include <task.h> -#define ROW_0 GPIO_PORT(A, 12) -#define ROW_1 GPIO_PORT(B, 12) -#define ROW_2 GPIO_PORT(B, 11) -#define ROW_3 GPIO_PORT(C, 4) -#define COL_0 GPIO_PORT(B, 13) -#define COL_1 GPIO_PORT(B, 14) -#define COL_2 GPIO_PORT(B, 15) -#define COL_3 GPIO_PORT(B, 1) -#define COL_4 GPIO_PORT(B, 2) +#define ROW_0 GPIO_PORT(B, 2) +#define ROW_1 GPIO_PORT(B, 1) +#define ROW_2 GPIO_PORT(B, 15) +#define ROW_3 GPIO_PORT(B, 14) +#define ROW_4 GPIO_PORT(B, 13) +#define ROW_5 GPIO_PORT(C, 4) +#define COL_0 GPIO_PORT(B, 11) +#define COL_1 GPIO_PORT(B, 12) +#define COL_2 GPIO_PORT(A, 11) +#define COL_3 GPIO_PORT(A, 12) +#define COL_4 GPIO_PORT(C, 5) -#define ROWS 4 +#define ROWS 6 #define COLS 5 typedef struct { @@ -42,17 +44,21 @@ typedef struct { } port_t; static const port_t keypad_rows[ROWS] = { - { ROW_0 }, { ROW_1 }, { ROW_2 }, { ROW_3 } + { ROW_0 }, { ROW_1 }, { ROW_2 }, + { ROW_3 }, { ROW_4 }, { ROW_5 } }; static const port_t keypad_cols[COLS] = { - { COL_0 }, { COL_1 }, { COL_2 }, { COL_3 }, { COL_4 } + { COL_0 }, { COL_1 }, { COL_2 }, + { COL_3 }, { COL_4 } }; static const int keypad_map[ROWS][COLS] = { - { '7', '8', '9', 'x', '/' }, - { '4', '5', '6', 'y', '*' }, - { '1', '2', '3', '=', '-' }, + { '&', '|', '^', ' ', ' ' }, + { 'x', 'y', 'z', '=', ' ' }, + { '7', '8', '9', '(', ')' }, + { '4', '5', '6', '/', '%' }, + { '1', '2', '3', '*', '-' }, { '.', '0', '\b', '\n', '+' } }; @@ -27,7 +27,7 @@ #include <initrd.h>
#include <keypad.h>
#include <lcd.h>
-#include <parser.h>
+#include <it/parser.h>
#include <random.h>
#include <script.h>
#include <serial.h>
diff --git a/src/script.c b/src/script.c index 518edc5..049608b 100644 --- a/src/script.c +++ b/src/script.c @@ -20,7 +20,7 @@ #include <script.h> -#include <builtins.h> +#include <it/builtins.h> #include <clock.h> #include <display.h> #include <display_draw.h> @@ -29,10 +29,9 @@ #include <random.h> #include <serial.h> #include <stdlib.h> +#include <it/string.h> #include <keypad.h> -#include <string.h> - #define igetarg_integer(it, n) ((int)igetarg(it, n)->value.f) int script_puts(instance *it); |