aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-10-31 10:16:10 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-10-31 10:16:10 +0200
commitcd18fb27a2499072f18cb0320ddeb85a0500a93e (patch)
treeb1bf1984813bc70ea4784e0e956497fd4fd35805 /Software/Embedded_SW/Embedded/Drivers
parent4aca8247565596d6c12ba73242d599dc42887625 (diff)
downloadTango-cd18fb27a2499072f18cb0320ddeb85a0500a93e.tar.gz
Tango-cd18fb27a2499072f18cb0320ddeb85a0500a93e.zip
version 1.4.6.0 - going forward
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c11
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c22
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h6
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c4
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h1
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h2
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c85
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c14
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h1
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c30
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c2
12 files changed, 153 insertions, 27 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c
index 26996ad48..1f871a4cc 100644
--- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c
+++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c
@@ -547,17 +547,18 @@ bool Is_FPGA_WD_Occurred()
LOG_ERROR (FPGA_WD_Counter, "FPGA WD Occurred");
FPGA_WD_Counter = FPGA_WD_Counter+1;
FPGA_WD_Occurred = true;
-/*
+
//To recover:
//1. Disable all FPGA's WD:
Control_WD(DISABLE,0);
//2. Enqable all FPGA's WD:
Control_WD(ENABLE,250);
//3. Call FPGA_SetMotorsInit:
- FPGA_SetMotorsInit();
+ //FPGA_SetMotorsInit();
//4. Init Motor's Drivers:
- Init_Motors_Drivers_After_FPGA_WD();
-
+ //Init_Motors_Drivers_After_FPGA_WD();
+ Motor_ReconfigAllMotors();
+/*
//OR
//Reset MCU (will reset also the FPGA):
//Power_Reset();
@@ -789,7 +790,7 @@ uint32_t SecondaryPumpCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
void PumpActivation(uint32_t seconds)
{
Pumps_Control(WASTECH_PUMP2, OPEN);
- SecondaryPumpControlId = AddControlCallback( SecondaryPumpCallBackFunction, seconds*1000/*eHundredMillisecond*/, TemplateDataReadCBFunction,0,0, 0 );
+ SecondaryPumpControlId = AddControlCallback(NULL, SecondaryPumpCallBackFunction, seconds*1000/*eHundredMillisecond*/, TemplateDataReadCBFunction,0,0, 0 );
}
/*
uint8_t Buttons_LEDS(BUTTON Button, OPERATION_MODE LED_Mode)
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
index 331913816..fe8a96b32 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c
@@ -26,6 +26,7 @@
#include "ADC_MUX.h"
#include "Modules/AlarmHandling/AlarmHandling.h"
+#include "modules/ids/ids_ex.h"
bool MidTank_Pressure_Read_Enable[NUM_OF_MIDTANKS] = {true,true,true,true,true,true,true,true};
double MidTank_Pressure[NUM_OF_MIDTANKS] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0};
@@ -388,10 +389,10 @@ double Get_MidTank_Pressure_Sensor(MidTank_t MidTank_ID) //0-7
assert (MidTank_ID<NUM_OF_MIDTANKS);
return MidTank_Pressure[MidTank_ID];
}
-int Get_MidTank_Int100_Sensor(MidTank_t MidTank_ID) //0-7
+int Get_MidTank_Int1000_Sensor(MidTank_t MidTank_ID) //0-7
{
assert (MidTank_ID<NUM_OF_MIDTANKS);
- return (int)(MidTank_Pressure[MidTank_ID]*100);
+ return (int)(MidTank_Pressure[MidTank_ID]*1000);
}
///////////////////////// Head_MixChip_Heaters_Current //////////////////////////////
@@ -406,13 +407,18 @@ uint32_t Heaters_Current_Bits[9];//just for debug
void Enable_Reading_Heaters_Current(HEATERS_CURRENT Heater_ID) //0-8
{
assert (Heater_ID<NUM_OF_CURRENT_HEATERS);
- //Heaters_Current_Read_Enable[Heater_ID] = true;
+ Heaters_Current_Read_Enable[Heater_ID] = true;
}
void Disable_Reading_Heaters_Current(HEATERS_CURRENT Heater_ID) //0-8
{
assert (Heater_ID<NUM_OF_CURRENT_HEATERS);
Heaters_Current_Read_Enable[Heater_ID] = false;
}
+bool Get_Heater_Current_Reading_State(HEATERS_CURRENT Heater_ID) //0-8
+{
+ assert (Heater_ID<NUM_OF_CURRENT_HEATERS);
+ return Heaters_Current_Read_Enable[Heater_ID];
+}
uint32_t Read_Heaters_Current(HEATERS_CURRENT Heater_ID) //0-8
{
@@ -522,6 +528,16 @@ bool Get_Heaters_Current_Integer(HEATERS_CURRENT Heater_ID, int32_t* value ) //0
return OK;
}
+bool Get_Heaters_Current_float(HEATERS_CURRENT Heater_ID, double* value ) //0-8 //Shai add default value
+{
+ assert (Heater_ID<NUM_OF_CURRENT_HEATERS);
+ if (Heaters_Current_Read_Enable[Heater_ID] == false)
+ return ERROR; // Heaters_Current[Heater_ID]
+ else *value = Heaters_Current[Heater_ID]*100;
+ //Report("Get_Heaters_Current_Integer ",__FILE__,Heater_ID,*value,RpWarning,(int)(Heaters_Current[Heater_ID]*100),0);
+
+ return OK;
+}
void ADC_MUX_Init()
{
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h
index 8f7ed8a64..103e3e764 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/ADC_MUX/ADC_MUX.h
@@ -43,9 +43,11 @@ extern double Heaters_Current[9];
extern uint32_t Heaters_Current_Bits[9];
+void Trigger_MidTank_Current_Read(void);
+
double Read_MidTank_Pressure_Sensor(MidTank_t MidTank_ID);
double Get_MidTank_Pressure_Sensor(MidTank_t MidTank_ID); //0-7
-int Get_MidTank_Int100_Sensor(MidTank_t MidTank_ID); //0-7
+int Get_MidTank_Int1000_Sensor(MidTank_t MidTank_ID); //0-7
void MidTankPressureCorrection(double Offset);
void Enable_MidTank_Pressure_Reading(MidTank_t MidTank_ID); //0-7
@@ -53,9 +55,11 @@ void Disable_MidTank_Pressure_Reading(MidTank_t MidTank_ID); //0-7
void Enable_Reading_Heaters_Current(HEATERS_CURRENT Heater_ID);
void Disable_Reading_Heaters_Current(HEATERS_CURRENT Heater_ID); //0-5
+bool Get_Heater_Current_Reading_State(HEATERS_CURRENT Heater_ID); //0-8
uint32_t Read_Head_MixChip_Heaters_Current(HEATERS_CURRENT Heater_ID);
double Get_Heaters_Current(HEATERS_CURRENT Heater_ID);
bool Get_Heaters_Current_Integer(HEATERS_CURRENT Heater_ID,int32_t* value );
+bool Get_Heaters_Current_float(HEATERS_CURRENT Heater_ID, double* value );
//int Get_Heaters_Current_Integer(HEATERS_CURRENT Heater_ID); //0-8
uint32_t Read_Heaters_Current(HEATERS_CURRENT Heater_ID);
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c
index 1cbd88f3b..2edda0ce4 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/DAC/Blower.c
@@ -214,7 +214,7 @@ uint32_t Gradual_Increase_Blower(uint32_t Initial_mV,uint32_t Target_mV)
mInitial_mV = Initial_mV+100;
Control_Voltage_To_Blower(mInitial_mV);
Report("Increasing blower",__FILE__,__LINE__,(int)mInitial_mV,RpWarning,(int)millisecondCounter,0);
- BlowerControlId = AddControlCallback( Gradual_Increase_Blower_Callback, mInterval,getBlowerState ,0, 0, 0 );
+ BlowerControlId = AddControlCallback(NULL, Gradual_Increase_Blower_Callback, mInterval,getBlowerState ,0, 0, 0 );
if (BlowerControlId == 0xFF)
{
Report("Add control callback failed",__FILE__,__LINE__,(int)0,RpWarning,(int)BlowerControlId,0);
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c
index c86cb8bad..44ee2edd0 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.c
@@ -348,6 +348,10 @@ uint8_t Read_Dispensers_IO_Registers(/*TCA9534Regs* Regs*/)
}
+uint8_t Get_Notification_Disp_Full(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/)
+{
+ return Regs.Input[Dispenser_ID].Uchar;
+}
bool Get_Notification_Disp_UP(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/)
{
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h
index 9168843da..85e03a9ba 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Dispenser_Card/IO_Ports/Dispenser_IO.h
@@ -58,6 +58,7 @@ uint8_t TCA9534ReadInputReg(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/);
uint8_t TCA9534TestRelay(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/, bool EnableTestRelay);
uint8_t TCA9534ByPass(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/, bool EnableByPass);
uint8_t TCA9534TestByPassTestRelay(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/);
+uint8_t Get_Notification_Disp_Full(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/);
bool Get_Notification_Disp_UP(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/);
bool Get_Notification_Disp_Down(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/);
bool Get_Notification_Realy_On(uint8_t Dispenser_ID/*, TCA9534Regs* Regs*/);
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h
index fdeca7b85..b0da72345 100644
--- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h
@@ -22,5 +22,7 @@ uint32_t I2C_ReadBuff(uint32_t I2C_BASE, unsigned char addr, unsigned char* data
uint32_t I2C_Write(uint32_t I2C_ID, uint32_t Slave_Add, uint32_t *I2C_Write_buf, uint32_t No_BytesToWrite );
uint32_t I2C_Read(uint32_t I2C_ID, uint32_t Slave_Add, uint32_t *I2C_Read_buf, uint32_t No_BytesToRead );
+void Trigger_Heater_Current_Read(void);
+void Trigger_MidTank_Pressure_Read(void);
#endif /* DRIVERS_I2C_COMMUNICATION_I2C_H_ */
diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c
new file mode 100644
index 000000000..aa6bfccac
--- /dev/null
+++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c
@@ -0,0 +1,85 @@
+/*
+ * I2C_Task.c
+ *
+ * Created on: Oct 23, 2019
+ * Author: shlomo
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include "include.h"
+#include "inc/hw_memmap.h"
+
+#include "drivers/ADC_Sampling/adc.h"
+
+#include "ADC_MUX/ADC_MUX.h"
+#include "modules/ids/ids_ex.h"
+
+Mailbox_Handle I2C_ReadingMsgQ = NULL;
+typedef enum
+{
+ Midtank_Pressure_Reading,
+ Heater_Current_Reading
+}I2C_ReadingMessages;
+
+typedef struct I2C_ReadingMessage{
+ uint16_t messageId;
+ uint16_t parameter;
+}I2C_ReadingMessageStruc;
+
+void Trigger_Heater_Current_Read(void)
+{
+ I2C_ReadingMessageStruc I2C_ReadingMessage;
+ uint8_t Heater_i;
+
+ for (Heater_i = 0;Heater_i < NUM_OF_CURRENT_HEATERS;Heater_i++)
+ {
+ I2C_ReadingMessage.messageId = Heater_Current_Reading;
+ I2C_ReadingMessage.parameter = Heater_i;
+ if (I2C_ReadingMsgQ != NULL)
+ Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT);
+ }
+ return;
+
+}
+
+void Trigger_MidTank_Pressure_Read(void)
+{
+ I2C_ReadingMessageStruc I2C_ReadingMessage;
+ uint8_t Midtank_i;
+
+ for (Midtank_i = 0;Midtank_i < MAX_SYSTEM_DISPENSERS;Midtank_i++)
+ {
+ I2C_ReadingMessage.messageId = Midtank_Pressure_Reading;
+ I2C_ReadingMessage.parameter = Midtank_i;
+ if (I2C_ReadingMsgQ != NULL)
+ Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT);
+ }
+ return;
+
+}
+void I2C_ReadingTask(UArg arg0, UArg arg1)
+{
+ I2C_ReadingMessageStruc I2C_ReadingMessage;
+ Error_Block eb;
+ Error_init(&eb);
+ I2C_ReadingMsgQ = Mailbox_create(sizeof(I2C_ReadingMessageStruc), 40, NULL,&eb);
+
+ while(1)
+ {
+ Mailbox_pend(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_WAIT_FOREVER);
+ switch (I2C_ReadingMessage.messageId)
+ {
+ case Midtank_Pressure_Reading:
+ //Report("Read_MidTank_Pressure_Sensor",__FILE__,__LINE__,255,RpWarning,0,0);
+ Read_MidTank_Pressure_Sensor(I2C_ReadingMessage.parameter);
+ break;
+ case Heater_Current_Reading:
+ //Report("Read_Heaters_Current",__FILE__,__LINE__,255,RpWarning,0,0);
+ Read_Heaters_Current(I2C_ReadingMessage.parameter);
+ break;
+ default:
+ break;
+ }
+ }
+}
diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c
index 7ea2ea79a..4a5a48f04 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.c
@@ -86,7 +86,19 @@ uint32_t MotorConfig(TimerMotors_t _motorId, MotorDriverConfigStruc *MotorConfig
return FPGA_MotorConfig( _motorId, MotorConfig);
#endif
}
-
+uint32_t Motor_ReconfigAllMotors(void)
+{
+ TimerMotors_t Motor_i;
+ uint32_t status = PASSED;
+ for (Motor_i = 0; Motor_i < NUM_OF_MOTORS ; Motor_i++)
+ {
+ if (isMotorConfigured(Motor_i))
+ {
+ status |= MotorConfig( Motor_i, &MotorsCfg[Motor_i]);
+ }
+ }
+ return status;
+}
bool isMotorConfigured(TimerMotors_t _motorId)
{
return MotorConfigState[_motorId];
diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h
index afacb50c3..59a8726f3 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h
+++ b/Software/Embedded_SW/Embedded/Drivers/Motors/Motor.h
@@ -131,6 +131,7 @@ extern MotorDriverConfigStruc MotorsCfg[NUM_OF_MOTORS];
uint32_t MotorsInit(void);
//set the motor configuration
uint32_t MotorConfig(TimerMotors_t _motorId, MotorDriverConfigStruc *MotorConfig);
+uint32_t Motor_ReconfigAllMotors(void);
bool isMotorConfigured(TimerMotors_t _motorId);
diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
index 5c25a87ca..b39b9f325 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c
@@ -147,7 +147,7 @@ uint32_t MotorGotoWithCallback (TimerMotors_t MotorId, uint32_t Steps, uint32_t
MotorStop(MotorId,Hard_Hiz );
Task_sleep(100);
MotorGoTo(MotorId,Steps );
- MotorControlId[MotorId] = AddControlCallback( MotorMoveToLimitSwitchCallBackFunction, eTenMillisecond, FPGA_Read_limit_Switches,(IfTypeMotors*0x100+MotorId), LimitSwitchId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveToLimitSwitchCallBackFunction, eTenMillisecond, FPGA_Read_limit_Switches,(IfTypeMotors*0x100+MotorId), LimitSwitchId, 0 );
MotorControlCallback[MotorId] = MotorMoveToLimitSwitchCallBackFunction;
return MotorControlId[MotorId];
}
@@ -163,7 +163,7 @@ uint32_t MotorGotoWithBusyCallback (TimerMotors_t MotorId,bool direction, uint32
//MotorStop(MotorId,Hard_Hiz );
int sign = direction?1:-1;
MotorGoTo(MotorId,Steps*sign );
- MotorControlId[MotorId] = AddControlCallback( MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
MotorControlCallback[MotorId] = MotorMoveCallBackFunction;
return MotorControlId[MotorId];
}
@@ -184,7 +184,7 @@ uint32_t MotorMoveWithCallback (TimerMotors_t MotorId,bool direction, uint32_t S
//MotorStop(MotorId,Hard_Hiz );
MotorMove(MotorId,direction,Steps );
- MotorControlId[MotorId] = AddControlCallback( MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveCallBackFunction, /*eTenMillisecond*/20, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
MotorControlCallback[MotorId] = MotorMoveCallBackFunction;
return MotorControlId[MotorId];
}
@@ -284,7 +284,7 @@ uint32_t MotorMoveToStopper (TimerMotors_t MotorId,bool direction, uint32_t Spee
StoredMotorPosition[MotorId] = MotorGetPosition(MotorId);
REPORT_MSG(StoredMotorPosition[MotorId],"MotorMoveToStopper initial position");
MotorSetSpeed (MotorId, Speed);
- MotorControlId[MotorId] = AddControlCallback( MotorVerifiedCallBackFunction, 20,Control_Read_Dryer_Position,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorVerifiedCallBackFunction, 10,Control_Read_Dryer_Position,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
MotorControlCallback[MotorId] = MotorVerifiedCallBackFunction;
return MotorControlId[MotorId];
}
@@ -321,7 +321,7 @@ uint32_t MotorMoveToDrierPositionCallBackFunction(uint32_t IfIndex, uint32_t Rea
MotorStop(MotorId,Hard_Stop );
//possibly: start regular control (speed etc)
- //uint32_t ControlId = AddControlCallback(ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
+ //uint32_t ControlId = AddControlCallback(NULL,ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
//call the module callback
if (MotorCallback[MotorId])
@@ -359,7 +359,7 @@ uint32_t MotorMovetoEncoderPosition (TimerMotors_t MotorId, callback_fptr callb
//MotorSetDirection( MotorId, direction);
MotorSetSpeed (MotorId, 50);
- MotorControlId[MotorId] = AddControlCallback( MotorMoveToDrierPositionCallBackFunction, 2,Control_Read_Dryer_Position,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveToDrierPositionCallBackFunction, 2,Control_Read_Dryer_Position,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
MotorControlCallback[MotorId] = MotorMoveToDrierPositionCallBackFunction;
return MotorControlId[MotorId];
@@ -370,7 +370,7 @@ uint32_t MotorSetSpeedWithCallback (TimerMotors_t MotorId, uint32_t _freq, callb
//assert (callback);
MotorCallback[MotorId] = callback;
- MotorControlId[MotorId] = AddControlCallback( MotorSetSpeedCallBackFunction, eTenMillisecond, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorSetSpeedCallBackFunction, eTenMillisecond, MotorControlGetnBusyState,(IfTypeMotors*0x100+MotorId), MotorId, 0 );
MotorControlCallback[MotorId] = MotorSetSpeedCallBackFunction;
MotorSetSpeed(MotorId, _freq);
@@ -409,7 +409,7 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO
MotorControlCallback[MotorId] = 0;
MotorControlId[MotorId] = 0xFF;
//possibly: start regular control (speed etc)
- //uint32_t ControlId = AddControlCallback(ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
+ //uint32_t ControlId = AddControlCallback(NULL,ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
//call the module callback
if (MotorCallback[MotorId])
@@ -436,7 +436,7 @@ uint32_t MotorSetSpeedCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TO
MotorControlCallback[MotorId] = 0;
MotorControlId[MotorId] = 0xFF;
//possibly: start regular control (speed etc)
- //uint32_t ControlId = AddControlCallback(ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
+ //uint32_t ControlId = AddControlCallback(NULL,ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
//call the module callback
if (MotorCallback[MotorId])
@@ -483,7 +483,7 @@ uint32_t MotorMoveToLimitSwitchCallBackFunction(uint32_t IfIndex, uint32_t Limit
}
//possibly: start regular control (speed etc)
- //uint32_t ControlId = AddControlCallback(ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
+ //uint32_t ControlId = AddControlCallback(NULL,ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
if (MotorId == HARDWARE_MOTOR_TYPE__MOTO_DH_LID)
{
if (CloseMagnet == true)
@@ -542,7 +542,7 @@ uint32_t MotorMovetoLimitSwitch (TimerMotors_t MotorId,bool direction, uint32_t
MotorSetDirection( MotorId, direction);
MotorSetSpeed(MotorId, Freq);
- MotorControlId[MotorId] = AddControlCallback( MotorMoveToLimitSwitchCallBackFunction, MotorTimeLag[MotorId] , FPGA_Read_limit_Switches,(IfTypeMotors*0x100+MotorId), LimitSwitchId, 0 );
+ MotorControlId[MotorId] = AddControlCallback("MoveToLimitSwitch", MotorMoveToLimitSwitchCallBackFunction, MotorTimeLag[MotorId] , FPGA_Read_limit_Switches,(IfTypeMotors*0x100+MotorId), LimitSwitchId, 0 );
if ( MotorControlId[MotorId] == 0xFF)
return ERROR;
MotorCallback[MotorId] = callback;
@@ -575,7 +575,7 @@ uint32_t MotorMoveToBreakSensorCallBackFunction(uint32_t IfIndex, uint32_t Limit
MotorStop(MotorId,Hard_Hiz); //TODO in run time limit switch just reverse direction
//possibly: start regular control (speed etc)
- //uint32_t ControlId = AddControlCallback(ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
+ //uint32_t ControlId = AddControlCallback(NULL,ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
//call the module callback
if (MotorCallback[MotorId])
@@ -601,7 +601,7 @@ uint32_t MotorMovetoBreakSensor (TimerMotors_t MotorId,bool direction, uint32_t
MotorSetDirection( MotorId, direction);
MotorSetSpeed(MotorId, Freq);
- MotorControlId[MotorId] = AddControlCallback( MotorMoveToBreakSensorCallBackFunction, eOneMillisecond , ReadBreakSensor,(IfTypeMotors*0x100+MotorId), 0, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveToBreakSensorCallBackFunction, eOneMillisecond , ReadBreakSensor,(IfTypeMotors*0x100+MotorId), 0, 0 );
if ( MotorControlId[MotorId] == 0xFF)
return ERROR;
MotorCallback[MotorId] = callback;
@@ -646,7 +646,7 @@ uint32_t MotorMoveToDancerPositionCallBackFunction(uint32_t IfIndex, uint32_t Re
MotorStop(MotorId,Hard_Hiz); //TODO in run time limit switch just reverse direction
//possibly: start regular control (speed etc)
- //uint32_t ControlId = AddControlCallback(ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
+ //uint32_t ControlId = AddControlCallback(NULL,ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter );
//call the module callback
if (MotorCallback[MotorId])
@@ -669,7 +669,7 @@ uint32_t MotorMovetoDancerPosition (TimerMotors_t MotorId,bool direction, uint32
DancerId = dancerid;
MotorSetDirection( MotorId, direction);
MotorSetSpeed(MotorId, Freq);
- MotorControlId[MotorId] = AddControlCallback( MotorMoveToDancerPositionCallBackFunction, eTenMillisecond , Control_Read_Dancer_Position,(IfTypeMotors*0x100+MotorId), DancerId, 0 );
+ MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveToDancerPositionCallBackFunction, eTenMillisecond , Control_Read_Dancer_Position,(IfTypeMotors*0x100+MotorId), DancerId, 0 );
if ( MotorControlId[MotorId] == 0xFF)
return ERROR;
MotorCallback[MotorId] = callback;
diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c
index 66be6a21a..06e5b4b0d 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c
@@ -371,7 +371,7 @@ uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callb
Valve3WayModuleCallback[_ValveId] = callback;
- Valve3WayControlId[_ValveId] = AddControlCallback( Valve3WayCallBackFunction, eOneSecond/*eHundredMillisecond*/, FPGA_GetDispenserValveBusyOCD,(IfTypeDisopenser*0x100+_ValveId), _ValveId, 0 );
+ Valve3WayControlId[_ValveId] = AddControlCallback("Valve3WayControlId", Valve3WayCallBackFunction, eOneSecond/*eHundredMillisecond*/, FPGA_GetDispenserValveBusyOCD,(IfTypeDisopenser*0x100+_ValveId), _ValveId, 0 );
if (Valve3WayControlId[_ValveId] == 0xFF)
Report("Add control callback failed",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0);
//else