2011

Dependencies:   mbed FastPWM

Revision:
38:118df027d851
Parent:
36:a46e63505ed8
Child:
41:abbd4e2af68b
diff -r 60a116154383 -r 118df027d851 CAN/function_CAN.cpp
--- a/CAN/function_CAN.cpp	Mon Nov 25 05:04:12 2019 +0000
+++ b/CAN/function_CAN.cpp	Thu Nov 28 09:18:03 2019 +0000
@@ -693,9 +693,14 @@
                 //spi_eeprom_write(RID_I_GAIN_JOINT_TORQUE, (int16_t) I_GAIN_JOINT_TORQUE);
                 //spi_eeprom_write(RID_D_GAIN_JOINT_TORQUE, (int16_t) D_GAIN_JOINT_TORQUE);
             }
-
             break;
         }
+        case CRX_ASK_VALVE_MAX_MIN_POS: {
+            CAN_TX_DDV_VALVE_DEADZONE();
+            CAN_TX_DDV_VALVE_MAX_MIN_POS();
+            break;
+        }
+
     default:
         break;
     }
@@ -1240,6 +1245,22 @@
     can.write(temp_msg);
 }
 
+void CAN_TX_DDV_VALVE_MAX_MIN_POS(void) {
+    CANMessage temp_msg;
+    
+    temp_msg.id = CID_TX_INFO;
+    temp_msg.len = 7;
+    temp_msg.data[0] = (uint8_t) CTX_VALVE_MAX_MIN_POS;
+    temp_msg.data[1] = (uint8_t) VALVE_MAX_POS;
+    temp_msg.data[2] = (uint8_t) ((int) (VALVE_MAX_POS) >> 8);
+    temp_msg.data[3] = (uint8_t) (VALVE_MIN_POS);
+    temp_msg.data[4] = (uint8_t) ((int) (VALVE_MIN_POS) >> 8);
+    temp_msg.data[5] = (uint8_t) (DDV_CENTER);
+    temp_msg.data[6] = (uint8_t) ((int) (DDV_CENTER) >> 8);
+
+    can.write(temp_msg);
+}
+
 /******************************************************************************
  Sensor & State Transmission Functions
 *******************************************************************************/
@@ -1315,3 +1336,4 @@
 
 
 
+