From 5d5ca12a57e86aa3f566eafa9c71663cdf563708 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 18 Jun 2018 17:15:02 +0300 Subject: basic IDS with valves handling --- Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 2 +- Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c | 3 ++- Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Drivers') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index cec8b74af..ef16e472f 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -13,7 +13,6 @@ #include "PMR/Hardware/HardwareDancerType.pb-c.h" extern TempSensorResponseStruct TempSensorResponse[MAX_TEMPERATURE_SENSOR_ID]; -void FPGA_SetMotStop(TimerMotors_t _motorId); #include /////////////////////////////////////////////////////////////////////////////// @@ -301,6 +300,7 @@ typedef enum MOTOR_CONFIG_HARD_HIZ, MOTOR_CONFIG_ACC, MOTOR_CONFIG_DEC, + MOTOR_CONFIG_MIN_SPEED, MOTOR_CONFIG_MAX_SPEED, MOTOR_CONFIG_STEP_MODE, MOTOR_CONFIG_CONFIG, diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index 8b375b311..4056f0175 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -311,7 +311,8 @@ uint32_t Valve3WayCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) RemoveControlCallback(Valve3WayControlId[ValveId], Valve3WayCallBackFunction ); //call the module callback - Valve3WayModuleCallback[ValveId](ValveId,BusyFlag); + if (Valve3WayModuleCallback[ValveId]) + Valve3WayModuleCallback[ValveId](ValveId,BusyFlag); } return OK; diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h index 7af24aed7..fc118f683 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.h @@ -12,7 +12,7 @@ typedef enum { //Dispenser Valves - // must be from ubdex 0-7 in order to use Valve3WayModuleCallback and Valve3WayControlId as array of 8 ! + // must be from index 0-7 in order to use Valve3WayModuleCallback and Valve3WayControlId as array of 8 ! VALVE_DISPENSER_1, VALVE_DISPENSER_2, VALVE_DISPENSER_3, @@ -53,5 +53,5 @@ void Valve_Command(Valves_t Valve_Id); void Valve_Set(Valves_t Valve_Id, bool Direction); void SetAllDispensersValves(bool Direction); void FPGA_GetDispenserValveBusyOCD();// OCD - Over Current Detection - +uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callback_fptr callback); //direction: MidTank_Dispenser or Dispenser_Mixer #endif /* DRIVERS_VALVES_VALVE_H_ */ -- cgit v1.3.1