From f73b377911e0fa06463113e2c6f9ae16eff35548 Mon Sep 17 00:00:00 2001 From: sirlilpanda <33928689+sirlilpanda@users.noreply.github.com> Date: Mon, 1 Sep 2025 23:21:39 +1200 Subject: [PATCH] added some comments and removed the static keyword from the now exposed functions --- src/device.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/device.c b/src/device.c index 455f854..caa1d90 100644 --- a/src/device.c +++ b/src/device.c @@ -1,15 +1,21 @@ -#include "device.h" #include -static void pressPwrMethod(Device_t *device) { +#include "device.h" + + +// these functions are where the bulk of the ugliness happens +// these function just pass through and call the method that +// is defined within the state structs methods + +void pressPwrButton(Device_t *device) { device->state.methods.pressPwr(device); } -static void pressStrInputMethod(Device_t *device) { +void pressStrInputButton(Device_t *device) { device->state.methods.pressStrInput(device); } -static void pressLockMethod(Device_t *device) { +void pressLockButton(Device_t *device) { device->state.methods.pressLock(device); } @@ -17,12 +23,6 @@ void initDevice(Device_t* device) { *device = (Device_t){ .state = NULL, .entered_string = "frogs", - .entered_string_len = 6, - .methods = (DeviceInterface_t){ - .pressPwr = &pressPwrMethod, - .pressStrInput = &pressStrInputMethod, - .pressLock = &pressLockMethod, - }, }; }