aa

Dependencies:   mbed

Revision:
0:669ef71cba68
Child:
30:8f092276b2ba
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Safty/Safty.cpp	Sat Sep 08 06:05:22 2018 +0000
@@ -0,0 +1,18 @@
+#include "Safty.h"
+
+#include "../Communication/Controller/Controller.h"
+#include "../Input/Switch/Switch.h"
+
+using namespace SWITCH;
+
+
+namespace SAFTY {
+    ErrorStatus ErrorCheck::Check() {
+        ErrorStatus error = 0;
+        CONTROLLER::Controller::CheckControllerLost() ? error |= Error::ControllerLost : error &=~ Error::ControllerLost;
+        // #ifdef USE_DRIVECHECK
+        (DRIVECHECK_LIMITSW == SW_OFF) ? error |= Error::DrivePowerLost : error &=~ Error::DrivePowerLost;
+        // #endif
+        return error;
+    }
+}