diff options
author | David Phillips <david@yeah.nah.nz> | 2021-03-13 20:03:55 +1300 |
---|---|---|
committer | David Phillips <david@yeah.nah.nz> | 2021-03-13 20:03:55 +1300 |
commit | d9527ea3c5ab6f1e0776b86ecc43459eb1a706b2 (patch) | |
tree | 460b8dee91bc3d63a604d68d14745218e2cb7810 /altimeter.c | |
parent | 64a168c77568f8886662b535515ff25d056042e9 (diff) | |
download | altimeter-d9527ea3c5ab6f1e0776b86ecc43459eb1a706b2.tar.xz |
First cut of UI state machine
This patch adds a first skeleton/draft of the UI state machine, with the
altimeter setting logic implemented at a basic level. It also adds a Python
script which uses GDB/MI to simulate/inject UI events on a GDB remote (i.e.
qemu-avr running the sim copy of the firmware).
Diffstat (limited to 'altimeter.c')
-rw-r--r-- | altimeter.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/altimeter.c b/altimeter.c index df238da..b0148d9 100644 --- a/altimeter.c +++ b/altimeter.c @@ -68,3 +68,10 @@ int main(void) sleep_mode(); } } + + +/* FIXME remove these - handy for testing in gdb */ +void up(void){ui_input_event(&ui_ctx, &dctx, UI_INPUT_EVENT_UP);ui_update(&ui_ctx, &dctx);} +void down(void){ui_input_event(&ui_ctx, &dctx, UI_INPUT_EVENT_DOWN);ui_update(&ui_ctx, &dctx);} +void press(void){ui_input_event(&ui_ctx, &dctx, UI_INPUT_EVENT_PRESS);ui_update(&ui_ctx, &dctx);} +void hold(void){ui_input_event(&ui_ctx, &dctx, UI_INPUT_EVENT_HOLD);ui_update(&ui_ctx, &dctx);} |