This commit is contained in:
sirlilpanda
2025-08-28 21:19:47 +12:00
commit d4e72630e9
12 changed files with 2829 additions and 0 deletions

31
src/states/off_state.c Normal file
View File

@@ -0,0 +1,31 @@
#include "state.h"
#include "../device.h"
#include <stdio.h>
const char off_state_name[] = __FILE_NAME__;
static void pressPwrMethod(Device_t *device) {
printf("turning on device\n");
setLockState(device);
}
static void pressStrInputMethod(Device_t *device) {
printf("nothing happens\n");
}
static void pressLockMethod(Device_t *device) {
printf("nothing happens\n");
}
void setOffState(Device_t *device) {
device->state = (DeviceState_t){
.state_name = off_state_name,
.device = device,
.methods = (DeviceInterface_t){
.pressPwr = &pressPwrMethod,
.pressStrInput = &pressStrInputMethod,
.pressLock = &pressLockMethod,
},
};
}