From fd589d4e0013645ffc66f0b396c3afee8434d656 Mon Sep 17 00:00:00 2001 From: sirlilpanda <33928689+sirlilpanda@users.noreply.github.com> Date: Mon, 25 Aug 2025 10:42:47 +1200 Subject: [PATCH] added comments and fixed import string --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 54bc497..26d1936 100644 --- a/src/main.c +++ b/src/main.c @@ -1,7 +1,6 @@ #include #include -#include "command.h " #include "command.h" #include "input.h" @@ -11,19 +10,21 @@ int printButton(const char* string) { return printf(string); } +// this should live in the app logic void commandWrapper(void* args, void* ret) { // we cast ret to a int and then place the return val in to it *(int*)(ret) = printButton(*(const char**)(args)); } +// this should be in your input driver, so in here you may have a task +// that is getting these inputs and adding them to a queue static Inputs_e current_input = BUTTON_DOWN; Inputs_e getinput() { return current_input; } -// this is the only part i dont like const char* button_up_cmd_args = "up button pressed\n"; int button_up_cmd_return_val = 0; // dont leave thing uninstalised @@ -36,6 +37,7 @@ int button_right_cmd_return_val = 0; // dont leave thing uninstalised const char* button_down_cmd_args = "down button pressed\n"; int button_down_cmd_return_val = 0; // dont leave thing uninstalised +// this should be implemented with your app logic static Input_t input_device = (Input_t){ .button_up_cmd = (Command_t){ .args = (void*)(&button_up_cmd_args),