From 6f8e84556dc6a4dcae9598df0685d81ea255269f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 11 Apr 2019 14:14:36 +0300 Subject: bug fix in control (uint16 timimg - not good for large segments) and heaters (increase band, handle job end) --- Software/Embedded_SW/Embedded/Modules/Control/control.c | 4 ++-- Software/Embedded_SW/Embedded/Modules/Control/control.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 52b52d93b..608d17a7b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -69,7 +69,7 @@ typedef struct uint32_t StartTick; DataReadCBFunction ControlDataReadPtr; ControlCBFunction ControlCallbackPtr; - uint16_t ControlTiming; + uint32_t ControlTiming; }ControlDeviceStruc; typedef enum @@ -224,7 +224,7 @@ void ControlStart(void) * both these callbacks can be removed. if a new call is arriving, it invalidates the previous one (no dual control or data) * ***************************************************************************************************************************************************/ -uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 ) +uint32_t AddControlCallback( ControlCBFunction Callback, uint32_t CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 ) { assert(Callback); assert(DriverfPtr); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.h b/Software/Embedded_SW/Embedded/Modules/Control/control.h index 8d7e219ac..380040e34 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.h @@ -19,7 +19,8 @@ typedef enum { eTenMillisecond = 10, eHundredMillisecond = 100, eOneSecond = 1000, - eOneMinute = 60000 + eOneMinute = 60000, + eOneHour = 3600000 }CTRL_TIMING_ENUM; typedef enum { @@ -37,7 +38,7 @@ typedef enum void ControlInit(void); void ControlStop(void); void ControlStart(void); -uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 ); +uint32_t AddControlCallback( ControlCBFunction Callback, uint32_t CtrlFrequency, DataReadCBFunction DriverfPtr, uint16_t IfIndex, uint32_t Parameter1, uint32_t Parameter2 ); int RemoveControlCallback(uint32_t deviceId, ControlCBFunction Callback ); //The safe remove command can be used ONLY when called from the control callback itself int SafeRemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback); -- cgit v1.3.1 From 0f028a9d82e4d7dbf5fb2c81e6d6ab204a2647a6 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Mon, 15 Apr 2019 16:17:04 +0300 Subject: Add blinkig mode for all the pannel leds --- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 8 +- .../Embedded_SW/Embedded/Modules/Control/control.c | 86 +++++++++++++++++++++- 2 files changed, 90 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') 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 f88438bd0..e219a3859 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 @@ -814,6 +814,7 @@ uint8_t Cartridges_LEDS(CARTREGE Cartridge, OPERATION_MODE LED_Mode) // CART1_LA uint8_t Pannel_Leds(PANEL_BUTTON_OR_CRAT_ID Pannel_Led_Id, OPERATION_MODE LED_Mode) { uint8_t Status = OK; + bool Flag = true; short Low_Reg; short High_Reg; @@ -828,12 +829,15 @@ uint8_t Pannel_Leds(PANEL_BUTTON_OR_CRAT_ID Pannel_Led_Id, OPERATION_MODE LED_Mo Low_Reg = MAX_PWM_Command +1; High_Reg = 1; break; + //case MODE_SLOW_BLINKING://Done in ControlActivityLed + //case MODE_FAST_BLINKING://Done in ControlActivityLed + //case MODE_BREATHING://Done in Machine_Idle_Breathing_Led on idle mode (only for POWER) default: - Status = ERROR; + Flag = false; break; } - if(Status == OK) + if(Flag == true) { switch(Pannel_Led_Id) { diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 608d17a7b..c94f0335f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -166,11 +166,51 @@ uint32_t ControlActivityLed( uint32_t Parameter1) ACTIVITY_RED_LED_OFF; // Heaters indication - all the Heaters OFF if(power.color == fastBILNK) Pannel_Leds(POWER_ON_OFF,MODE_OFF); - + else if((power.color == BLINK) && (counter % Blink_Freq == 0) ) { Pannel_Leds(POWER_ON_OFF,MODE_OFF); } + /////////////////////////////////////////////////////////// + if(jog.color == fastBILNK) + Pannel_Leds(POWER_ON_OFF,MODE_OFF); + else + if((jog.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(POWER_ON_OFF,MODE_OFF); + } + /////////////////////////////////////////////////////////// + if(load.color == fastBILNK) + Pannel_Leds(POWER_ON_OFF,MODE_OFF); + else + if((load.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(POWER_ON_OFF,MODE_OFF); + } + /////////////////////////////////////////////////////////// + if(cart1.color == fastBILNK) + Pannel_Leds(CART_1,MODE_OFF); + else + if((cart1.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(CART_1,MODE_OFF); + } + /////////////////////////////////////////////////////////// + if(cart2.color == fastBILNK) + Pannel_Leds(CART_2,MODE_OFF); + else + if((cart2.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(CART_2,MODE_OFF); + } + /////////////////////////////////////////////////////////// + if(cart3.color == fastBILNK) + Pannel_Leds(CART_3,MODE_OFF); + else + if((cart3.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(CART_3,MODE_OFF); + } flag = false; } else @@ -181,11 +221,53 @@ uint32_t ControlActivityLed( uint32_t Parameter1) if(power.color == fastBILNK) Pannel_Leds(POWER_ON_OFF,MODE_ON); - + else if((power.color == BLINK) && (counter % Blink_Freq == 0) ) { Pannel_Leds(POWER_ON_OFF,MODE_ON); } + /////////////////////////////////////////////////////////// + if(jog.color == fastBILNK) + Pannel_Leds(POWER_ON_OFF,MODE_ON); + else + if((jog.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(POWER_ON_OFF,MODE_ON); + } + /////////////////////////////////////////////////////////// + if(load.color == fastBILNK) + Pannel_Leds(POWER_ON_OFF,MODE_ON); + else + if((load.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(POWER_ON_OFF,MODE_ON); + } + /////////////////////////////////////////////////////////// + if(cart1.color == fastBILNK) + Pannel_Leds(CART_1,MODE_ON); + else + if((cart1.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(CART_1,MODE_ON); + } + /////////////////////////////////////////////////////////// + if(cart2.color == fastBILNK) + Pannel_Leds(CART_2,MODE_ON); + else + if((cart2.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(CART_2,MODE_ON); + } + /////////////////////////////////////////////////////////// + if(cart3.color == fastBILNK) + Pannel_Leds(CART_3,MODE_ON); + else + if((cart3.color == BLINK) && (counter % Blink_Freq == 0) ) + { + Pannel_Leds(CART_3,MODE_ON); + } + + flag = true; } -- cgit v1.3.1 From 58b58bc39201cd8702be1780d22e6340478feb43 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Mon, 15 Apr 2019 17:23:26 +0300 Subject: fix bug in ControlActivityLed --- Software/Embedded_SW/Embedded/Modules/Control/control.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index c94f0335f..b316fd73f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -173,19 +173,19 @@ uint32_t ControlActivityLed( uint32_t Parameter1) } /////////////////////////////////////////////////////////// if(jog.color == fastBILNK) - Pannel_Leds(POWER_ON_OFF,MODE_OFF); + Pannel_Leds(THREAD_JOGGING,MODE_OFF); else if((jog.color == BLINK) && (counter % Blink_Freq == 0) ) { - Pannel_Leds(POWER_ON_OFF,MODE_OFF); + Pannel_Leds(THREAD_JOGGING,MODE_OFF); } /////////////////////////////////////////////////////////// if(load.color == fastBILNK) - Pannel_Leds(POWER_ON_OFF,MODE_OFF); + Pannel_Leds(THREAD_LOAD,MODE_OFF); else if((load.color == BLINK) && (counter % Blink_Freq == 0) ) { - Pannel_Leds(POWER_ON_OFF,MODE_OFF); + Pannel_Leds(THREAD_LOAD,MODE_OFF); } /////////////////////////////////////////////////////////// if(cart1.color == fastBILNK) @@ -228,19 +228,19 @@ uint32_t ControlActivityLed( uint32_t Parameter1) } /////////////////////////////////////////////////////////// if(jog.color == fastBILNK) - Pannel_Leds(POWER_ON_OFF,MODE_ON); + Pannel_Leds(THREAD_JOGGING,MODE_ON); else if((jog.color == BLINK) && (counter % Blink_Freq == 0) ) { - Pannel_Leds(POWER_ON_OFF,MODE_ON); + Pannel_Leds(THREAD_JOGGING,MODE_ON); } /////////////////////////////////////////////////////////// if(load.color == fastBILNK) - Pannel_Leds(POWER_ON_OFF,MODE_ON); + Pannel_Leds(THREAD_LOAD,MODE_ON); else if((load.color == BLINK) && (counter % Blink_Freq == 0) ) { - Pannel_Leds(POWER_ON_OFF,MODE_ON); + Pannel_Leds(THREAD_LOAD,MODE_ON); } /////////////////////////////////////////////////////////// if(cart1.color == fastBILNK) -- cgit v1.3.1 From 363603ac89278995f8c7730c6fc92a8e19ed1f92 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Sun, 28 Apr 2019 15:55:09 +0300 Subject: change the blinking frequency of the machine panel leds to 300msec --- Software/Embedded_SW/Embedded/Modules/Control/control.c | 2 +- .../Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index b316fd73f..f1e19d851 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -158,7 +158,7 @@ uint32_t ControlActivityLed( uint32_t Parameter1) { static bool flag = false; static uint8_t counter; - const uint8_t Blink_Freq = 15;//odd number + const uint8_t Blink_Freq = 3;//odd number if (flag==true) { diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c index b0a1945db..6a1821f4b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticActions.c @@ -26,6 +26,7 @@ #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include "drivers/Valves/Valve.h" #include "drivers/Heater/Heater.h" +#include "modules/waste/waste.h" #include "modules/ids/ids_ex.h" @@ -243,12 +244,12 @@ uint32_t SetDigitalOutRequestRequestFunc(MessageContainer* requestContainer) /* case INTERFACE_IOS__GPO_LED4: DataUpdated = request->value; break;*/ - case INTERFACE_IOS__GPO_BLOWER_PWM: +/* case INTERFACE_IOS__GPO_BLOWER_PWM: if (request->value == true) Control_Dryer_Fan(START,75); else Control_Dryer_Fan(STOP, 0); - break; + break;*/ case INTERFACE_IOS__VALVE_WASTE_TANK: if (request->value == true) Valve_Set(VALVE_MIXCHIP_WASTECH,1); -- cgit v1.3.1 From be50a5b72cedd1afc0a14d36a468e8b04bf9a37f Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Tue, 30 Apr 2019 16:22:08 +0300 Subject: Add the funtion Ink_Cart_Led to control the Ink led --- Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 2 ++ Software/Embedded_SW/Embedded/Modules/General/buttons.c | 11 +++++++++++ Software/Embedded_SW/Embedded/Modules/General/buttons.h | 1 + 3 files changed, 14 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 193769265..916d33772 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -48,6 +48,7 @@ #include "Common/SWUpdate/FileSystem.h" #include "Communication/Connection.h" +#include "Modules/General/buttons.h" Task_Handle Millisecond_Task_Handle; /******************** Definitions ********************************************/ @@ -514,6 +515,7 @@ uint32_t MillisecLowLoop(uint32_t tick) { Speed_Data = Calculate_Speed_Sensor_Velocity(); Read_Buttons_Reg(); + Ink_Cart_Led(); for (Sensor_i = 0;Sensor_i < MAX_TEMPERATURE_SENSOR_ID;Sensor_i++) { MillisecUpdateTemperatures (Sensor_i,TemperatureSensorRead(Sensor_i)); diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.c b/Software/Embedded_SW/Embedded/Modules/General/buttons.c index 74cb81aac..cfd44a6fa 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/buttons.c +++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.c @@ -603,6 +603,17 @@ uint32_t LoadStatMachine( button *pBtn) return OK; } +void Ink_Cart_Led()//temporary for ITMA +{ + if(Is_Cartridge_Present(CART_1) == true) + { + Pannel_Leds( CART_1, MODE_ON); + } + else + { + Pannel_Leds( CART_1, MODE_OFF); + } +} void test_avi() { diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.h b/Software/Embedded_SW/Embedded/Modules/General/buttons.h index 2d14eb000..4d0df69e1 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/buttons.h +++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.h @@ -58,6 +58,7 @@ uint32_t Buttons_Init(void); uint32_t Button_load_Init(void); uint32_t Button_JOG_Init(void); bool SetPowerMachineState(PBmachineState state); +void Ink_Cart_Led(); -- cgit v1.3.1