1#include "../../../Inc/Systems/Controller/Apps.h"
2#include "../../../Inc/Utils/Common.h"
19 if (pos1 > 100 || pos1 < 0 || pos2 > 100 || pos2 < 0) {
24 float difference = fabs(pos1 - pos2);
36 if (apps->
app[0] == NULL || apps->
app[1] == NULL) {
59 printf(
"APPs is not in a safe state\n");
71 return fabs(pos1 + pos2) / 2;
77 printf(
"No monitors set for Apps\n");
81 printf(
"Apps is not in a safe state\n");
float getAppPosition(App *app)
Gets the current position of the APP.
void initApp(App *app, int hz, int channel)
Initializes the APP with the given frequency and channel.
void updateApp(void *app)
Updates the APP data.
int appsSafetyCheck(void *apps)
Checks the safety of Apps.
void initApps(Apps *apps, int hz, int channel1, int channel2)
Initializes the APPs with the given frequency and channel.
void updateApps(void *apps)
Updates the APPS based on both sensor outputs.
float getAppsPosition(Apps *apps)
Averages app sensors to get pedal position.
void checkAppsLimit(Apps *apps)
Checks App limits for faults.
int defaultAddMonitor(void *self, MonitorSystem *monitor)
Adds a monitor to the controller.
void initControllerSystem(ControllerSystem *controller, const char *name, int hz, ControllerType type)
Initializes the Controller System with initial settings.
void initMonitorSystem(MonitorSystem *monitor, const char *name, int hz, MonitorType type, FaultType fault)
Initializes the Monitor System with initial settings.
int(* safety)(void *self)
void(* update)(void *self)