aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
index 4e573cb82..33af819f1 100644
--- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
+++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c
@@ -77,6 +77,44 @@ FPGA_GPI_ENUM Motor_Id_to_LS_Id[NUM_OF_MOTORS] = {
MAX_GPI, //MOTO_SPARE2_2 = 28
};
+typedef enum {
+ MotorHomingDirectionUp,
+ MotorHomingDirectionDown,
+ MotorHomingDirectionNoHoming
+}MotorHomingDirectionEnum;
+
+MotorHomingDirectionEnum Motor_Id_to_LS_Direction[NUM_OF_MOTORS] = {
+ MotorHomingDirectionNoHoming, //MOTO_DH_CLEANHEAD = 0,
+ MotorHomingDirectionNoHoming, //MOTO_DH_CLEANMECH = 1,
+ MotorHomingDirectionNoHoming, //MOTO_DH_LID = 2,
+ MotorHomingDirectionNoHoming, //MOTO_DRYER_DRIVING = 3,
+ MotorHomingDirectionNoHoming, //MOTO_DRYER_LID = 4,
+ MotorHomingDirectionNoHoming, //MOTO_DRYER_LOADARM = 5,
+ MotorHomingDirectionDown, //MOTO_DISPENSER_1 = 6,
+ MotorHomingDirectionDown, //MOTO_DISPENSER_2 = 7,
+ MotorHomingDirectionDown, //MOTO_DISPENSER_3 = 8,
+ MotorHomingDirectionDown, //MOTO_DISPENSER_4 = 9,
+ MotorHomingDirectionDown, //MOTO_DISPENSER_5 = 10,
+ MotorHomingDirectionDown, //MOTO_DISPENSER_6 = 11,
+ MotorHomingDirectionDown, //MOTO_DISPENSER_7 = 12,
+ MotorHomingDirectionDown, //MOTO_DISPENSER_8 = 13,
+ MotorHomingDirectionUp, //MOTO_SCREW = 14,
+ MotorHomingDirectionNoHoming, //MOTO_WINDER = 15,
+ MotorHomingDirectionDown, //MOTO_LDANCER1 = 16,
+ MotorHomingDirectionDown, //MOTO_LDANCER2 = 17,
+ MotorHomingDirectionNoHoming, //MOTO_LDRIVING = 18,
+ MotorHomingDirectionUp, //MOTO_LLOADING = 19,
+ MotorHomingDirectionUp, //MOTO_LPIVOT1 = 20,
+ MotorHomingDirectionDown, //MOTO_RDANCER = 21,
+ MotorHomingDirectionNoHoming, //MOTO_RDRIVING = 22,
+ MotorHomingDirectionUp, //MOTO_RLOADARM = 23,
+ MotorHomingDirectionDown, //MOTO_RLOADING = 24,
+ MotorHomingDirectionNoHoming, //MOTO_SPARE1_1 = 25,
+ MotorHomingDirectionNoHoming, //MOTO_SPARE1_2 = 26,
+ MotorHomingDirectionNoHoming, //MOTO_SPARE2_1 = 27,
+ MotorHomingDirectionNoHoming, //MOTO_SPARE2_2 = 28
+
+};
char HomingToken[NUM_OF_MOTORS][36+1]={0};
/********************************************************************************
@@ -87,13 +125,13 @@ uint32_t MotorHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue)
MessageContainer responseContainer;
MotorHomingResponse response = MOTOR_HOMING_RESPONSE__INIT;
- responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, HomingToken[deviceID], false, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size);
- responseContainer.continuous = false;
- HomingToken[deviceID][0] = 0;
+ responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, HomingToken[deviceID], true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size);
+ responseContainer.continuous = true;
uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer));
size_t container_size = message_container__pack(&responseContainer, container_buffer);
free(responseContainer.data.data);
SendChars(container_buffer, container_size);
+ HomingToken[deviceID][0] = 0;
return OK;