Mid level control code

Dependencies:   ros_lib_kinetic

Revision:
9:cd3607ba5643
Parent:
8:d6657767a182
Child:
10:1b6daba32452
--- a/LLComms.cpp	Tue Aug 07 09:18:15 2018 +0000
+++ b/LLComms.cpp	Tue Aug 07 14:15:37 2018 +0000
@@ -27,6 +27,20 @@
     }
 }
 
+void LLComms::reset(void) {
+    // Initialise relevant variables
+    for(int i = 0; i<_n_channels; i++) {
+        // All chip selects in off state
+        *cs_LL[i] = 1;
+        *cs_ADC[i] = 1;
+    }
+    pinReset = 1; // Initialise reset pin to not reset the controllers.
+    wait(0.25);
+    pinReset=0; // Reset controllers to be safe
+    wait(0.25);
+    pinReset = 1; // Ready to go
+}
+
 double LLComms::ReadADCPosition_mtrs(int channel) {
     unsigned int outputA;
     unsigned int outputB;
@@ -74,4 +88,14 @@
     dblOutput = dblOutput-502.0;
     dblOutput = dblOutput/4095.0*8.0;
     return dblOutput;
-}
\ No newline at end of file
+}
+
+// Common fall handler functions
+/*void LLComms::dcommon_fall_handler(int channel) {
+    pinCheck = 0;
+    //queue.cancel(ThreadID[channel]); // Cancel relevant queued event
+}
+void LLComms::dfall0(void) { dcommon_fall_handler(0); }
+void LLComms::dSendReceiveData(int channel, int _intDemandPos_Tx[], bool (*_isDataReady)[8]) {
+    printf("%i\n\r",channel);
+}*/
\ No newline at end of file