From bee3522e23c95021a9637669a8091069af98e0c4 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 4 Feb 2020 18:51:57 +0200 Subject: Version 1.4.6.8: remove most of head/whs ifdefs, checked to be working. fix control for missed milliseconds calls and more --- Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index bac3ba1d0..a629afc50 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -401,9 +401,7 @@ CallbackCounter++; //MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].directionthreadwize, 200, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000); MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, 0, Motor_Id_to_LS_IdUp[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000); -#ifdef Use_Head_Card - HeadCard_Actuators_Control(ACTOT, LOW,true); -#endif + Trigger_Head_Actuators_Control(ACTOT, LOW,true); return OK; } uint32_t Thread_Load_Lift_Dancers(void) @@ -511,9 +509,7 @@ CallbackCounter++; // MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID].directionthreadwize, 200, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000); MotorGotoWithCallback(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID, 2, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID], Thread_Load_HomingCallback,10000); -#ifdef Use_Head_Card - HeadCard_Actuators_Control(ACTOT, LOW,false); -#endif + Trigger_Head_Actuators_Control(ACTOT, LOW,false); return OK; } uint32_t Thread_Load_Resume_Heating(void) @@ -538,7 +534,7 @@ { REPORT_MSG(LoadStages, "Thread Load State Machine step"); CallbackCounter++; - MotorMovetoDancerPosition (HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].directionthreadwize, 100, FEEDER_DANCER ,true, Thread_Load_Jog_Feeder_To_Middle_Point_Callback,4000); + MotorMovetoDancerPosition (HARDWARE_MOTOR_TYPE__MOTO_RDRIVING,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDRIVING].directionthreadwize, 400, FEEDER_DANCER ,true, Thread_Load_Jog_Feeder_To_Middle_Point_Callback,4000); return OK; } -- cgit v1.3.1 From b3589be05166fdd15692a9a835262d6e04e56bd2 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 5 Feb 2020 16:00:59 +0200 Subject: fix continuous bug, alarm handling timing, control timing, initialization. --- .../Embedded/Common/SWUpdate/FirmwareUpgrade.c | 4 ++- .../Embedded/Common/report/reportInit.c | 3 ++ .../Embedded/Drivers/I2C_Communication/I2C.h | 1 + .../Embedded/Drivers/I2C_Communication/I2C_Task.c | 8 ++--- Software/Embedded_SW/Embedded/Main.c | 7 +++-- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 9 ++++-- .../Embedded/Modules/Control/MillisecTask.c | 4 +++ .../Embedded_SW/Embedded/Modules/Control/control.c | 36 ++++++++++++++++++---- .../Embedded/Modules/Diagnostics/Diagnostics.c | 4 ++- .../Modules/Diagnostics/DiagnosticsHoming.c | 6 +++- .../Embedded/Modules/General/GeneralHardware.c | 1 + .../Embedded/Modules/General/MachineStatus.c | 6 ++-- .../Embedded/Modules/Heaters/Heaters_init.c | 2 -- .../Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 6 ++-- .../Embedded/Modules/Thread/ThreadLoad.c | 1 + .../Initialization/PowerOffSequence.c | 2 ++ .../Embedded/StateMachines/Printing/JobSTM.c | 3 ++ 17 files changed, 78 insertions(+), 25 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c index c42dc6695..79bbb4df8 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c @@ -61,6 +61,7 @@ uint32_t ActivateVersionCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) if (CurrentRunningFiletoken, false, &response, &activate_version_response__pack, &activate_version_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; if (Fresult!= OK) { @@ -197,7 +200,6 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) responseContainer.errormessage = "Activate Version Request error"; responseContainer.continuous = false; } - responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); my_free(responseContainer.data.data); diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c index a9e940c8c..c8a11ce10 100644 --- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c +++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c @@ -158,6 +158,7 @@ int ReportResponseFunc(char *message, /* The formatted message } response.message = message; responseContainer = /*Report*/createContainer(MESSAGE_TYPE__StartDebugLogResponse, protobufToken, false, &response, &start_debug_log_response__pack, &start_debug_log_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; //if (responseContainer.data.data) { @@ -376,6 +377,7 @@ uint32_t SetDebugLogCategoryFunc(MessageContainer* requestContainer) } responseContainer = createContainer(MESSAGE_TYPE__SetDebugLogCategoryResponse, requestContainer->token, true, &response, &set_debug_log_category_response__pack, &set_debug_log_category_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = false; if (status != OK) { @@ -404,6 +406,7 @@ uint32_t StopReportInitMessage(MessageContainer* requestContainer) //TODO Handle the request!!!! ReportStopReporting(); responseContainer = createContainer(MESSAGE_TYPE__StopDebugLogResponse, protobufToken, false, &response, &stop_debug_log_response__pack, &stop_debug_log_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h index a6599cbe8..c04c6de7f 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C.h @@ -15,6 +15,7 @@ extern uint32_t Arb_Loss_Count; uint32_t I2C_control(uint32_t I2C_ID, uint32_t Slave_Add, bool RW,uint32_t Byte2Write ); void Init_All_I2C(); +void I2C_ReadingTask_Init(void); //------------------------------------------------------------------------------------------------------------- diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c index a82c04a3a..7bfd8612d 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -373,16 +373,16 @@ void Trigger_WHS_I2C_EEprom_Read(uint32_t address, uint16_t size, uint8_t *p_dat Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); return; } +void I2C_ReadingTask_Init(void) +{ + I2C_ReadingMsgQ = Mailbox_create(sizeof(I2C_ReadingMessageStruc), 40, NULL,NULL); +} void I2C_ReadingTask(UArg arg0, UArg arg1) { I2C_ReadingMessageStruc I2C_ReadingMessage; - Error_Block eb; - Error_init(&eb); Semaphore_post(I2C_Sem); TEMPERATURE_SENSOR_ID_ENUM Sensor_i; - I2C_ReadingMsgQ = Mailbox_create(sizeof(I2C_ReadingMessageStruc), 40, NULL,&eb); - while(1) { Mailbox_pend(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_WAIT_FOREVER); diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index 05c3d8c04..04ab6e57d 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -261,6 +261,9 @@ int main(void) SysCtlUSBPLLEnable(); + if (Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) + Head_IO_Init(); + #ifndef EVALUATION_BOARD DeActivateAllSSR(); Control_Dryer_Fan(STOP,0);//Preventing unwanted movement at power up, since the default from FPGA is "0" (= START) @@ -278,7 +281,7 @@ int main(void) ActivateChiller();//WHS Cooler SSR9 //ActivateHeadMagnet(); #endif - + I2C_ReadingTask_Init(); //EMAC_initEMAC(); ControlInit(); @@ -324,8 +327,6 @@ int main(void) //Read_Speed_Sensor_TypeII();//must be delay between Set_Speed_Sensor_TypeII_Registers to Read_Speed_Sensor_TypeII //Test_ADS120_Internal_Temperature_Sensor(0); - if (Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) - Head_IO_Init(); #ifndef EVALUATION_BOARD Main_EEPROM_Read_Main_Card_SN(); diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index c2e121348..9fe67d773 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -924,10 +924,12 @@ uint32_t AlarmHandling_ControlTrigger(uint32_t IfIndex, uint32_t ReadValue) { AlarmHandlingMessageStruc Message; + if (AlarmHandlingActive == false) + return; //send message to the Millisec task Message.messageId = AlarmHandlingTrigger; Message.msglen = sizeof(AlarmHandlingMessageStruc); - AlarmHandlingTick +=10; + AlarmHandlingTick +=100; Message.tick = AlarmHandlingTick; if (AlarmHandlingMsgQ != NULL) Mailbox_post(AlarmHandlingMsgQ , &Message, BIOS_NO_WAIT); @@ -1007,7 +1009,7 @@ uint32_t AlarmHandlingStart(void) if ( AlarmHandlingActive == false) { AlarmHandlingActive = true; - AlarmHandlingControlId = AddControlCallback("Alarm Handling",AlarmHandling_ControlTrigger,eHundredMillisecond,TemplateDataReadCBFunction,0,0,0); + //AlarmHandlingControlId = AddControlCallback("Alarm Handling",AlarmHandling_ControlTrigger,eHundredMillisecond,TemplateDataReadCBFunction,0,0,0); } return OK; } @@ -1466,7 +1468,9 @@ uint32_t AlarmHandlingLoop(uint32_t tick) ReportWithPackageFilter(AlarmFilter,"Error in alarms data!!!!!!!!! ", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, RpFatalError, 0, Alarm_i); if ((tick%eOneSecond == 0)&&(EventsNotificationRequestAccepted==true)) + { SendEventNotifications(); + } return OK; } /****************************************************************************** @@ -1567,6 +1571,7 @@ void SendEventNotifications(void) } Task_restore(Key); responseContainer = createAllocatedContainer(MESSAGE_TYPE__StartEventsNotificationResponse, AlarmHandlingToken, false, &EventsResponse, &start_events_notification_response__pack, &start_events_notification_response__get_packed_size,&alarm_response_buffer); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index fdd5feef9..a9b539690 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -623,6 +623,10 @@ uint32_t MillisecLowLoop(uint32_t tick) Trigger_PT100_Read();//call every 50mSec (minimum delay 30mSec) //Set_HeadCard_PT100();//call every 50mSec (minimum delay 30mSec) } + if(m70msecTick) + { + AlarmHandling_ControlTrigger(0,0); + } if (m90msecTick) { for (Sensor_i = StartPT100;Sensor_i < MAX_HEAD_CARD_TEMP_SENS_ID;Sensor_i++) diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index e85a36057..02a216ba6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -65,9 +65,10 @@ #include "MillisecTask.h" - +//#define CONTROL_DEBUG +#define DURATION_LIMIT 5 /******************** Definitions ********************************************/ -#define MAX_TANGO_CONTROL_DEVICES 120 +#define MAX_TANGO_CONTROL_DEVICES 100 /******************** STRUCTURES AND ENUMs ********************************************/ @@ -383,6 +384,7 @@ uint32_t AddControlCallback(char* Name, ControlCBFunction Callback, uint32_t Ct if (deviceId == 0xFF) { LOG_ERROR(deviceId, "Add Callback failed"); + AlarmHandlingSetAlarm(EVENT_TYPE__FPGA_WATCHDOG_ACTIVATED,true); return 0xFF; } key = GateMutex_enter(gateControlDB); @@ -564,12 +566,16 @@ void ResetControlTime(void) } uint32_t ControlLowLoop(uint32_t tick) { - uint32_t tempp,tempq,delta; uint32_t skipped_ticks = 0; +#ifdef CONTROL_DEBUG + uint32_t tempp,tempq,delta; + uint32_t sys_ticks_start = msec_millisecondCounter,sys_ticks_end,max = 0,dev = 0; +#endif if (tick-prevtick>1) { skipped_ticks = tick-prevtick-1; - //Report("ControlLowLoop skipped",__FILE__,tick,(int)prevtick,RpWarning,(int)skipped_ticks,0); + if (tick-prevtick>10) + Report("ControlLowLoop skipped",__FILE__,tick,(int)prevtick,RpWarning,(int)skipped_ticks,0); } prevtick = tick; @@ -586,8 +592,9 @@ uint32_t ControlLowLoop(uint32_t tick) ControlBacklog[backlogindex]=ControlLowDevice_i; if ( ++backlogindex >= MAX_BACKLOG_SIZE) backlogindex = 0; - +#ifdef CONTROL_DEBUG tempp = HibernateRTCSSGet(); +#endif if(ControlArray[ControlLowDevice_i].ControlDataReadPtr) ControlDatalog[ControlLowDevice_i] = ControlArray[ControlLowDevice_i].ControlDataReadPtr( ControlArray[ControlLowDevice_i].Parameter1); else @@ -596,6 +603,7 @@ uint32_t ControlLowLoop(uint32_t tick) ControlArray[ControlLowDevice_i].ControlCallbackPtr(ControlArray[ControlLowDevice_i].IfIndex, ControlDatalog[ControlLowDevice_i]); else LOG_ERROR (ControlLowDevice_i, "Invalid callback ptr"); +#ifdef CONTROL_DEBUG tempq = HibernateRTCSSGet(); if (tempq < tempp) { @@ -603,14 +611,30 @@ uint32_t ControlLowLoop(uint32_t tick) } else delta = tempq - tempp; - if (ControlTime[ControlLowDevice_i] DURATION_LIMIT) + { + Report("ControlLowLoop long",__FILE__,sys_ticks_end-sys_ticks_start,(int)sys_ticks_end,RpWarning,(int)sys_ticks_start,0); + for (ControlLowDevice_i = 0; ControlLowDevice_i < MAX_TANGO_CONTROL_DEVICES;ControlLowDevice_i++) + { + if (ControlTime[ControlLowDevice_i]>max) + { + max = ControlTime[ControlLowDevice_i]; + dev = ControlLowDevice_i; + } + } + Report(ControlArray[dev].Name,__FILE__,__LINE__,dev,RpWarning,max,0); + } +#endif //ROM_IntMasterEnable(); return OK; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index e63314bac..5a0432389 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -524,6 +524,8 @@ void DiagnosticOneMinuteCollection(void) void DiagnosticOneSecCollection(void) { int i; + memset(HeaterCounterIndex,0,sizeof(HeaterCounterIndex)); + if (Head_Type == HEAD_TYPE_SYLKO_WITHOUT_CARD) { DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__MixerHeater, MillisecGetTemperatures( MIXER_PT100)); @@ -625,7 +627,6 @@ void DiagnosticsReset(void) memset(MotorCounterIndex,0,sizeof(MotorCounterIndex)); memset(DancerErrorCounterIndex,0,sizeof(DancerErrorCounterIndex)); SpeedCounterIndex = 0; - memset(HeaterCounterIndex,0,sizeof(HeaterCounterIndex)); DiagnosticsIndex = 0; DiagnosticsMonitor.n_dancer1angle = 0; DiagnosticsMonitor.n_dancer2angle = 0; @@ -912,6 +913,7 @@ void SendDiagnostics(void) // diagnosticsresponseContainer = createContainer(MESSAGE_TYPE__StartDiagnosticsResponse, DiagnosticsToken, false, &response, &start_diagnostics_response__pack, &start_diagnostics_response__get_packed_size); diagnosticsresponseContainer = createAllocatedContainer(MESSAGE_TYPE__StartDiagnosticsResponse, DiagnosticsToken, false, &response, &start_diagnostics_response__pack, &start_diagnostics_response__get_packed_size,diagnostics_response_ptr); + diagnosticsresponseContainer.has_continuous = true; diagnosticsresponseContainer.continuous = true; if (diagnosticsresponseContainer.data.data) diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index c58d54a8c..674135180 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -45,6 +45,7 @@ uint32_t MotorHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue) MotorHomingResponse response = MOTOR_HOMING_RESPONSE__INIT; responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, HomingToken[deviceID], true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); @@ -141,6 +142,7 @@ uint32_t MotorHomingRequestFunc(MessageContainer* requestContainer) responseContainer.error = ERROR_CODE__INVALID_PROCESS_ID; responseContainer.errormessage = "Job Active or incorrect motor ID"; responseContainer = createContainer(MESSAGE_TYPE__MotorHomingResponse, requestContainer->token, true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); @@ -186,6 +188,7 @@ uint32_t DispenserHomingRequestCallback(uint32_t deviceID, uint32_t ReadValue) //MotorSetMicroStep(deviceID, MotorsCfg[deviceID].microstep); responseContainer = createContainer(MESSAGE_TYPE__DispenserHomingResponse, HomingToken[MotorId], true, &response, &motor_homing_response__pack, &motor_homing_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); @@ -212,7 +215,8 @@ uint32_t DispenserHomingRequestFunc(MessageContainer* requestContainer) if (speed == 0) speed = 150; responseContainer = createContainer(MESSAGE_TYPE__DispenserHomingResponse, requestContainer->token, false, &response, &dispenser_homing_response__pack, &dispenser_homing_response__get_packed_size); - responseContainer.continuous = true; + responseContainer.has_continuous = true; +responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); my_free(responseContainer.data.data); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index b05cb61e1..828961d17 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -145,6 +145,7 @@ uint32_t HWConfigurationInit(void) if (buffer) free (buffer); + Trigger_Head_Init_PT100();//OK //EmbeddedParametersInit(); IDS_Dispenser_Content_Init(); //ProcessParamsInit(); diff --git a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c index 157841365..3f557496c 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c +++ b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c @@ -48,10 +48,10 @@ int MachineUpdateResponseFunc(void) return OK; StartMachineStatusUpdateResponse response = START_MACHINE_STATUS_UPDATE_RESPONSE__INIT; - MachineStatus MachineStatus; + MachineStatus MachineStatus = MACHINE_STATUS__INIT; response.status = &MachineStatus; - machine_status__init(&MachineStatus); + //machine_status__init(&MachineStatus); MachineStatus.has_state = true; MachineStatus.state = StoredMachineStatus; MachineStatus.n_idspackslevels = 0; @@ -83,6 +83,7 @@ int MachineUpdateResponseFunc(void) responseContainer = /*MachineUpdate*/createContainer(MESSAGE_TYPE__StartMachineStatusUpdateResponse, MachineUpdateToken, false, &response, &start_machine_status_update_response__pack, &start_machine_status_update_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; //if (responseContainer.data.data) { @@ -138,6 +139,7 @@ uint32_t StopMachineUpdateFunc(MessageContainer* requestContainer) //TODO Handle the request!!!! MachineUpdateStopReporting(); responseContainer = createContainer(MESSAGE_TYPE__StopMachineStatusUpdateResponse, MachineUpdateToken, false, &response, &stop_machine_status_update_response__pack, &stop_machine_status_update_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c index a91919bc4..237722779 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c @@ -63,8 +63,6 @@ uint32_t Heaters_Init(void) int i; //ROM_TimerDisable(Heater_timerBase, TIMER_A); - Trigger_Head_Init_PT100();//OK - FPGA_SensorInitConfig(); memset(HeaterControl,0,sizeof(HeaterControl)); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index ad0f29392..e1be0358b 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -275,9 +275,9 @@ uint32_t IDS_HomeDispenser (uint32_t DispenserId, uint32_t speed , callback_fptr IDS_Dispenser_RefillStarted(DispenserId,1); if (DispenserId== LUBRICANT_DISPENSER) { - MotorMovetoLimitSwitch (MotorId,1-MotorsCfg[MotorId].directionthreadwize, speed/2, Dispenser_Id_to_LS_Id[DispenserId], IDS_HomeDispenserCallback,0); - CurrentDispenserSpeed[DispenserId] = speed/2; - Report("IDS_HomeDispenser ",__FILE__,__LINE__,(int)DispenserId,RpWarning,speed/2,0); + MotorMovetoLimitSwitch (MotorId,1-MotorsCfg[MotorId].directionthreadwize, speed/4, Dispenser_Id_to_LS_Id[DispenserId], IDS_HomeDispenserCallback,0); + CurrentDispenserSpeed[DispenserId] = speed/4; + Report("IDS_HomeDispenser ",__FILE__,__LINE__,(int)DispenserId,RpWarning,speed/4,0); } else { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index a629afc50..5dc354785 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -1356,6 +1356,7 @@ uint32_t ThreadLoadingReport(void) //------------------------------------------------------------------------------------------- responseContainer = createContainer(MESSAGE_TYPE__StartThreadLoadingResponse, ThreadLoadingToken, last, &response, &start_thread_loading_response__pack, &start_thread_loading_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 03909bb56..1e8511fb1 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -618,6 +618,7 @@ uint32_t PowerDownUpdate(POWER_OFF_STAGES_ENUM stage) } Report("PowerDownUpdate",__FILE__,last,(int)response.progresspercentage,RpWarning,(int)stage,0); responseContainer = createContainer(MESSAGE_TYPE__StartPowerDownResponse, PowerDownToken, last, &response, &start_power_down_response__pack, &start_power_down_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); @@ -670,6 +671,7 @@ uint32_t AbortPowerDownFunc(MessageContainer* requestContainer) //TODO Handle the request!!!! //PowerDownStopReporting(); responseContainer = createContainer(MESSAGE_TYPE__AbortPowerDownResponse, requestContainer->token, false, &response, &abort_power_down_response__pack, &abort_power_down_response__get_packed_size); + responseContainer.has_continuous = true; responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index b1edd61b0..d36de9bd7 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -942,6 +942,9 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes responseContainer.error = ERROR_CODE__CONTINUOUS_RESPONSE_ABORTED; } } + responseContainer.has_continuous = true; + responseContainer.continuous = true; + if (container_buffer) { size_t container_size = message_container__pack(&responseContainer, container_buffer); -- cgit v1.3.1 From 589bffe306db793987c17cd46f1dcac81f47bdcb Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Fri, 7 Feb 2020 13:03:22 +0200 Subject: remove some warnings --- .../Embedded/Common/SWUpdate/FirmwareUpgrade.c | 1 + .../Embedded/Common/Utilities/idle_task.c | 6 +- .../Embedded_SW/Embedded/Common/report/report.h | 1 + .../Embedded/Common/report/reportInit.c | 13 ++-- .../Head_Card/IO_Ports/Heaters/Head_Heaters.h | 2 +- .../Embedded/Drivers/I2C_Communication/I2C_Task.c | 21 ++---- .../Embedded_SW/Embedded/Drivers/Valves/Valve.c | 4 +- .../Embedded/Drivers/flash_ram/FlashProgram.c | 2 +- Software/Embedded_SW/Embedded/Main.c | 1 + .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 5 +- .../Embedded/Modules/AlarmHandling/AlarmHandling.h | 2 + .../Embedded/Modules/Control/MillisecTask.c | 8 +- .../Embedded_SW/Embedded/Modules/Control/control.c | 2 + .../Modules/Diagnostics/DiagnosticActions.c | 4 +- .../Embedded/Modules/General/GeneralHardware.c | 1 + .../Embedded_SW/Embedded/Modules/Heaters/Heaters.h | 1 + .../Embedded/Modules/Heaters/Heaters_init.c | 1 + .../Embedded/Modules/Heaters/Heaters_print.c | 88 ++++++++++++++++++++-- .../Modules/Stubs_Handler/StubRealTimeUsage.c | 2 +- .../Embedded/Modules/Thread/ThreadLoad.c | 2 +- .../Embedded/Modules/Thread/Thread_print.c | 8 +- 21 files changed, 124 insertions(+), 51 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c index bf1151d6e..24f02f60c 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c @@ -24,6 +24,7 @@ #include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #include "drivers/FPGA/Full_Vme/FPGA_Programming_Up.h" #include "drivers/FPGA/Full_Vme/ispvme/vmopcode.h" +#include "drivers/Flash_ram/FlashProgram.h" #include "Common/Utilities/Utils.h" #include "Common/SWUpdate/FileSystem.h" diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c b/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c index 8d1040ea2..9a1de790e 100644 --- a/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c +++ b/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c @@ -202,9 +202,9 @@ uint32_t unload_max_count=0; void IdleTaskGetLoadTable (uint32_t *aBuffer) { int i; - for (i=0;i<100;i++) - aBuffer[i] = idle_load_table[i]; - //memcpy (aBuffer,idle_load_table,sizeof(idle_load_table)); + //for (i=0;i<100;i++) + // aBuffer[i] = idle_load_table[i]; + memcpy (aBuffer,idle_load_table,sizeof(idle_load_table)); } uint32_t MillisecCounter = 0; uint32_t ControlCounter = 0; diff --git a/Software/Embedded_SW/Embedded/Common/report/report.h b/Software/Embedded_SW/Embedded/Common/report/report.h index 35253ce80..2d7e93ca5 100644 --- a/Software/Embedded_SW/Embedded/Common/report/report.h +++ b/Software/Embedded_SW/Embedded/Common/report/report.h @@ -130,6 +130,7 @@ void ReportResetReason(void); uint32_t OpenLogFile(void); uint32_t CloseLogFile(void); bool isReportActive(void); +uint32_t LogToFile(char *message, char *FileName, int LineNumber,int errorCode,int Severity,int parameter); /*************************************************************************** diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c index c8a11ce10..6ed149039 100644 --- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c +++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c @@ -79,9 +79,9 @@ bool isReportActive(void) } uint32_t OpenLogFile(void) { - uint32_t Bytes = 0; - int len; - /*LogFresult = f_open(LogFileHandle,LogPath,FA_OPEN_ALWAYS | FA_WRITE | FA_READ); + /*int len; + uint32_t Bytes = 0; + LogFresult = f_open(LogFileHandle,LogPath,FA_OPEN_ALWAYS | FA_WRITE | FA_READ); if (LogFresult == FR_OK) { if (LogFileHandle->fsize < 100000) @@ -105,11 +105,12 @@ uint32_t LogToFile(char *message, /* The formatted message int Severity, /* user parameter no. 1 */ int parameter) { - uint32_t Bytes = 0; - int len; /* print user supplied error code */ - /* len = usnprintf(message, 300, "\r\n %s, file %s line %d code %d sev %d,param %d",message,FileName, LineNumber,errorCode, Severity, parameter); + /* uint32_t Bytes = 0; + int len; + + len = usnprintf(message, 300, "\r\n %s, file %s line %d code %d sev %d,param %d",message,FileName, LineNumber,errorCode, Severity, parameter); LogFresult = f_write(LogFileHandle,message,len,&Bytes );*/ return LogFresult; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Heaters/Head_Heaters.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Heaters/Head_Heaters.h index fc3f88057..32a0dd8e0 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Heaters/Head_Heaters.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/IO_Ports/Heaters/Head_Heaters.h @@ -8,7 +8,7 @@ #ifndef DRIVERS_I2C_COMMUNICATION_HEAD_CARD_HEATERS_HEAD_HEATERS_H_ #define DRIVERS_I2C_COMMUNICATION_HEAD_CARD_HEATERS_HEAD_HEATERS_H_ -#warning move to heaters enum + typedef enum { HEADCARD_HIT_ZN1, diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c index 8670a56b4..f659d965a 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -74,21 +74,12 @@ void Trigger_Heater_Current_Read(void) { I2C_ReadingMessageStruc I2C_ReadingMessage; uint8_t Heater_i=0; - uint8_t Heater_Lim=0; - if(Head_Type == HEAD_TYPE_SYLKO_WITHOUT_CARD) - Heater_Lim = NUM_OF_CURRENT_HEATERS; - if(Head_Type == HEAD_TYPE_SYLKO) - Heater_Lim = HEAD_NUM_OF_ADC; - if(Head_Type == HEAD_TYPE_STAPLE_SPUN) - Heater_Lim = HEAD_NUM_OF_ADC; - - // for (Heater_i = 0;Heater_i < Heater_Lim;Heater_i++)//No need - reads all inputs at the same time - { - I2C_ReadingMessage.messageId = Heater_Current_Reading; - I2C_ReadingMessage.parameter = Heater_i; - if (I2C_ReadingMsgQ != NULL) - Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); - } + + 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; } diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index 59405be76..cf54019c5 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -417,7 +417,7 @@ uint32_t Valve3WayCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callback_fptr callback) //direction: MidTank_Dispenser or Dispenser_Mixer { - uint32_t busy = false; + //uint32_t busy = false; //Report("Control3WayValvesWithCallback ",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)direction,0); if (Valve3WayControlId[_ValveId] != 0xFF) { @@ -432,7 +432,7 @@ uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callb Report("Add control callback failed",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0); //else // Report("Add control callback",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0); - busy = FPGA_GetDispenserValveBusyOCD(_ValveId,0); + /*busy = */FPGA_GetDispenserValveBusyOCD(_ValveId,0); //Report("Set valve id, dir, busy",__FILE__,_ValveId,(int)direction,RpWarning,(int)busy,0); EnableDisableDispenserValve(_ValveId, ENABLE); diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c index 37c2280c9..bef2b1727 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c @@ -132,7 +132,7 @@ uint32_t ReadAppAndProgram(uint32_t ui32FlashStart,uint32_t ui32FileSize,void* b uint32_t EraseFlashSection(uint32_t ui32FlashStart,uint32_t ui32FileSize) { volatile uint32_t ui32Idx; - uint32_t status; + //uint32_t status; #ifdef FLASH_DEBUG Address[RxIndex] = ui32FlashStart; Size[RxIndex] = ui32FileSize; diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index da92b6fdf..393a366ac 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -53,6 +53,7 @@ #include "Modules/Control/MillisecTask.h" #include "Modules/Heaters/Heaters_ex.h" #include "Modules/Ids/Ids_ex.h" +#include "Modules/AlarmHandling/AlarmHandling.h" #include "StateMachines/Printing/PrintingSTM.h" #include "StateMachines/Initialization/InitSequence.h" diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 9fe67d773..03135c0d5 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -876,7 +876,6 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) { if (HeaterCheckReady()==false) { -#warning fit to new head with new alarms for (Heater_i=HEATER_TYPE__DryerAirHeater;Heater_i - +#include "Drivers/I2C_Communication/I2C_Task.h" +#include "Drivers/I2C_Communication/I2C.h" #include "modules/ids/ids_ex.h" /******************************************************************************** diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 35065cc2a..ec7650f3d 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -40,6 +40,7 @@ #include "drivers/I2C_Communication/DAC/Blower.h" #include "drivers/Valves/Valve.h" #include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" +#include "Drivers/I2C_Communication/I2C.h" #include "drivers/Flash_ram/MCU_E2Prom.h" #include "StateMachines/Printing/PrintingSTM.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h index 05425cc45..b1d870919 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h @@ -17,6 +17,7 @@ extern int DCTimeSliceAllocation[HEATER_TYPE_MAX_HEATERS]; extern int NumberOFSlicesInUse; extern uint32_t MillisecondsPerChange; +void initializeArrays(void); typedef struct HeaterPIDControlConfigstruc { diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c index 237722779..0f6cb5124 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_init.c @@ -68,6 +68,7 @@ uint32_t Heaters_Init(void) memset(HeaterControl,0,sizeof(HeaterControl)); for (i = 0;i HEAD_TYPE_SYLKO_WITHOUT_CARD) + { + HeaterId2PT100Id[HEATER_TYPE__DryerAirHeater] = DRYER_AIR_PT100; + HeaterId2PT100Id[HEATER_TYPE__DryerMainHeater] = DRYER_MAIN_PT100; + HeaterId2PT100Id[HEATER_TYPE__DryerSecondaryHeater] = DRYER_SECONDARY_PT100; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone1] = HEAD_PT100_ZONE_1_0X80_0; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone2] = HEAD_PT100_ZONE_2_0X80_1; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone3] = HEAD_PT100_ZONE_3_0X82_0; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone4] = HEAD_PT100_ZONE_4_0X82_1; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone5] = HEAD_PT100_ZONE_5_0X84_0; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone6] = HEAD_PT100_ZONE_6_0X84_1; + HeaterId2PT100Id[HEATER_TYPE__MixerHeater] = HEAD_PT100_MIXER_0X8E_0; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone7] = HEAD_PT100_ZONE_7_0X86_0; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone8] = HEAD_PT100_ZONE_8_0X86_1; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone9] = HEAD_PT100_ZONE_9_0X88_0; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone10] = HEAD_PT100_ZONE_10_0X88_1; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone11] = HEAD_PT100_ZONE_11_0X8A_0; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone12] = HEAD_PT100_ZONE_12_0X8A_1; + HeaterId2PT100Id[HEATER_TYPE__HeadCoverHeater1] = HEAD_PT100_AIR_HEATER_2_0X8C_1; + HeaterId2PT100Id[HEATER_TYPE__HeadCoverHeater2] = HEAD_PT100_AIR_HEATER_1_0X8C_0 ; + + HeaterId2CurrentId[HEATER_TYPE__DryerAirHeater] = NUM_OF_CURRENT_HEATERS; + HeaterId2CurrentId[HEATER_TYPE__DryerMainHeater] = HEATER_DRYER_CURRENT_1; + HeaterId2CurrentId[HEATER_TYPE__DryerSecondaryHeater] = HEATER_DRYER_CURRENT_2; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone1] = HEAD_CURRENT_ZONE_1; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone2] = HEAD_CURRENT_ZONE_2; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone3] = HEAD_CURRENT_ZONE_3; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone4] = HEAD_CURRENT_ZONE_4; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone5] = HEAD_CURRENT_ZONE_5; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone6] = HEAD_CURRENT_ZONE_6; + HeaterId2CurrentId[HEATER_TYPE__MixerHeater] = HEAD_CURRENT_MIXER; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone7] = HEAD_CURRENT_ZONE_7; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone8] = HEAD_CURRENT_ZONE_8; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone9] = HEAD_CURRENT_ZONE_9; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone10] = HEAD_CURRENT_ZONE_10; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone11] = HEAD_CURRENT_ZONE_11; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone12] = HEAD_CURRENT_ZONE_12; + HeaterId2CurrentId[HEATER_TYPE__HeadCoverHeater1] = HEAD_CURRENT_HTIN_1; + HeaterId2CurrentId[HEATER_TYPE__HeadCoverHeater2] = HEAD_CURRENT_HTOT_1; + + } + else + { + HeaterId2PT100Id[HEATER_TYPE__DryerAirHeater] = DRYER_AIR_PT100; + HeaterId2PT100Id[HEATER_TYPE__DryerMainHeater] = DRYER_MAIN_PT100; + HeaterId2PT100Id[HEATER_TYPE__DryerSecondaryHeater] = DRYER_SECONDARY_PT100; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone1] = TEMP_SENSE_ANALOG_DYEINGH_TEMP1; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone2] = TEMP_SENSE_ANALOG_DYEINGH_TEMP2; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone3] = TEMP_SENSE_ANALOG_DYEINGH_TEMP3; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone4] = TEMP_SENSE_ANALOG_DYEINGH_TEMP4; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone5] = TEMP_SENSE_ANALOG_DYEINGH_TEMP5; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone6] = HEAD6_PT100; + HeaterId2PT100Id[HEATER_TYPE__MixerHeater] = MIXER_PT100; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone7] = 0xFF; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone8] = 0xFF; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone9] = 0xFF; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone10] = 0xFF; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone11] = 0xFF; + HeaterId2PT100Id[HEATER_TYPE__HeaterZone12] = 0xFF; + HeaterId2PT100Id[HEATER_TYPE__HeadCoverHeater1] = 0xFF; + HeaterId2PT100Id[HEATER_TYPE__HeadCoverHeater2] = 0xFF; + + HeaterId2CurrentId[HEATER_TYPE__DryerAirHeater] = NUM_OF_CURRENT_HEATERS; + HeaterId2CurrentId[HEATER_TYPE__DryerMainHeater] = HEATER_DRYER_CURRENT_1; + HeaterId2CurrentId[HEATER_TYPE__DryerSecondaryHeater] = HEATER_DRYER_CURRENT_2; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone1] = HEATER_HEAD_CURRENT_ZONE_1; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone2] = HEATER_HEAD_CURRENT_ZONE_2; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone3] = HEATER_HEAD_CURRENT_ZONE_3; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone4] = HEATER_HEAD_CURRENT_ZONE_4; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone5] = HEATER_HEAD_CURRENT_ZONE_5_6; + HeaterId2CurrentId[HEATER_TYPE__HeaterZone6] = HEATER_HEAD_CURRENT_ZONE_5_6; + HeaterId2CurrentId[HEATER_TYPE__MixerHeater] = HEATER_MIXCHIP_CURRENT; + + } +} uint32_t DryerInternalPT100Id = DRYER_AIR_PT100; bool HeatersRestart = false; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c index 2091b3bc5..765e183cb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/StubRealTimeUsage.c @@ -46,7 +46,7 @@ void Stub_RealTimeUsageRequest(MessageContainer* requestContainer) StubRealTimeUsageResponse response = STUB_REAL_TIME_USAGE_RESPONSE__INIT; - response.n_percentile = 100; + response.n_percentile = 101; response.percentile = my_malloc(sizeof(response.percentile)*response.n_percentile); if (response.percentile) IdleTaskGetLoadTable(response.percentile); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 5dc354785..2a83f8425 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -31,7 +31,7 @@ #include "drivers/SSI_Comm/Dancer/Dancer.h" #include "drivers/motors/motor.h" #include "drivers/Flash_ram/MCU_E2Prom.h" - +#include "Drivers/I2C_Communication/I2C.h" #include "PMR/Stubs/StubHeatingTestRequest.pb-c.h" #include "PMR/Stubs/StubHeatingTestResponse.pb-c.h" #include "PMR/Stubs/StubHeatingTestPollRequest.pb-c.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 59b5642fb..fd53d6da2 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -910,7 +910,7 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) void SetOriginMotorSpeed(float process_speed) { - int i,Motor_i, HW_Motor_Id; + int Motor_i, HW_Motor_Id; for (Motor_i = 0; Motor_i <= WINDER_MOTOR; Motor_i++) { HW_Motor_Id = ThreadMotorIdToMotorId[Motor_i]; @@ -1108,7 +1108,7 @@ char Endstr[150]; { int Motor_i; ThreadControlActive = false; - uint32_t status = OK,tempCtl; + uint32_t status = OK; usnprintf(Endstr, 100, "Total _processed length: Feeder: %d Pooler %d",(int)TotalProcessedLength,(int)PoolerTotalProcessedLength); SendJobProgress(0.0,0,false, Endstr); ReportWithPackageFilter(ThreadFilter,Endstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); @@ -1122,7 +1122,7 @@ char Endstr[150]; if (SpeedControlId != 0xFF) { if(RemoveControlCallback(SpeedControlId,ThreadLengthCBFunction)!=OK) - ReportWithPackageFilter(ThreadFilter,"Remove Control Failed.",__FILE__,__LINE__,(int)Motor_i,RpError,(int)SpeedControlId,0); + ReportWithPackageFilter(ThreadFilter,"Remove Control Failed.",__FILE__,__LINE__,(int)ThreadLengthCBFunction,RpError,(int)SpeedControlId,0); SpeedControlId = 0xFF; } if (PoolerSpeedControlId != 0xFF) @@ -1134,7 +1134,6 @@ char Endstr[150]; for ( Motor_i = 0;Motor_i <= WINDER_MOTOR;Motor_i++) { - tempCtl = ControlIdtoMotorId[Motor_i]; if (ControlIdtoMotorId[Motor_i] != 0xFF) { status = RemoveControlCallback(ControlIdtoMotorId[Motor_i],ThreadControlCBFunction); @@ -1143,7 +1142,6 @@ char Endstr[150]; else ReportWithPackageFilter(ThreadFilter,"Remove Control Failed.",__FILE__,__LINE__,(int)Motor_i,RpError,(int)ControlIdtoMotorId[Motor_i],0); } - //ReportWithPackageFilter(ThreadFilter,"Remove Control",__FILE__,Motor_i,(int)status,RpError,(int)tempCtl,0); } Task_sleep(100); -- cgit v1.3.1 From f00b1c08c2d9a05ada6b9adc9e25906e25ff80d9 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 11 Feb 2020 17:40:15 +0200 Subject: bug fixes, init handling --- .../Embedded_SW/Embedded/Common/report/report.h | 2 +- .../Embedded/Common/report/reportInit.c | 4 +- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 6 ++- .../Embedded/Drivers/I2C_Communication/I2C_Task.c | 15 ------- .../Embedded/Drivers/I2C_Communication/I2C_Task.h | 2 +- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 12 ++++-- .../Embedded/Modules/Control/MillisecTask.c | 4 +- .../Embedded/Modules/General/GeneralHardware.c | 19 -------- .../Embedded/Modules/Heaters/Heaters_print.c | 2 + .../Embedded/Modules/Stubs_Handler/Progress.c | 6 +-- .../Embedded/Modules/Thread/ThreadLoad.c | 1 + .../StateMachines/Initialization/InitSequence.c | 50 +++++++++++++++++++--- .../StateMachines/Initialization/PowerIdle.c | 1 + .../Initialization/PowerOffSequence.c | 5 +++ 14 files changed, 77 insertions(+), 52 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Common/report/report.h b/Software/Embedded_SW/Embedded/Common/report/report.h index 2d7e93ca5..a267bfc6b 100644 --- a/Software/Embedded_SW/Embedded/Common/report/report.h +++ b/Software/Embedded_SW/Embedded/Common/report/report.h @@ -126,7 +126,7 @@ extern uint32_t StopReportInitMessage(MessageContainer* requestContainer); uint32_t SetDebugLogCategoryFunc(MessageContainer* requestContainer); void SetupDebugDisributorsRequestFunc(MessageContainer* requestContainer); -void ReportResetReason(void); +uint32_t ReportResetReason(void); uint32_t OpenLogFile(void); uint32_t CloseLogFile(void); bool isReportActive(void); diff --git a/Software/Embedded_SW/Embedded/Common/report/reportInit.c b/Software/Embedded_SW/Embedded/Common/report/reportInit.c index 6ed149039..8f3cde15f 100644 --- a/Software/Embedded_SW/Embedded/Common/report/reportInit.c +++ b/Software/Embedded_SW/Embedded/Common/report/reportInit.c @@ -255,7 +255,7 @@ void SetupDebugDisributorsRequestFunc(MessageContainer* requestContainer) } -void ReportResetReason(void) +uint32_t ReportResetReason(void) { /* #define SYSCTL_CAUSE_HSRVREQ 0x00001000 // Hardware System Service Request @@ -300,6 +300,8 @@ void ReportResetReason(void) if ((RESC & SYSCTL_CAUSE_WDOG1)||(RESC & SYSCTL_CAUSE_WDOG0)||(RESC & SYSCTL_CAUSE_BOR)) AlarmHandlingSetAlarm (EVENT_TYPE__UNINTENDED_RESET,ON); //handle alarm detection and operation + return RESC; + } uint32_t ReportInitMessage(MessageContainer* requestContainer) 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 c620cebdb..f182ec09c 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 @@ -525,10 +525,11 @@ uint32_t MagnetCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) Report("MagnetCallBackFunction",__FILE__,__LINE__,(int)MagnetControlId,RpWarning,(int)MagnetCallBackFunction,0); return OK; } - +//double BlowerSetPoint; uint32_t ActivateHeadMagnet() { Report("ActivateHeadMagnet - Close the lid magnet",__FILE__,__LINE__,(int)HARDWARE_MOTOR_TYPE__MOTO_RLOADARM,RpWarning,(int)DH_LID_OPEN,0); + //WHS_Start_Blower_Control_Closed_Loop(BlowerSetPoint); //Task_sleep(500); if(Head_Type == HEAD_TYPE_SYLKO) HeadCard_ActivateHeadMagnet(); @@ -551,6 +552,9 @@ uint32_t HeadCard_HeadMagnet_Disable(); */ uint32_t DeActivateHeadMagnet() { + //BlowerSetPoint = WHS_Get_Blower_Control_Closed_Loop_SetPoint(); + + //WHS_Start_Blower_Control_Closed_Loop(0.0); if(Head_Type == HEAD_TYPE_SYLKO) { diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c index 4308a7913..cc876a45a 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -41,7 +41,6 @@ typedef enum Actuators_Control, /* enum for WHS :*/ - DetectNewWHS, WHS_start, WHS_init_I2C_IO, WHS_init_fan, @@ -161,16 +160,6 @@ void Trigger_InputsReading(void) } -void Trigger_Check_WHS_Type_Via_EEPROM() -{ - I2C_ReadingMessageStruc I2C_ReadingMessage; - - I2C_ReadingMessage.messageId = DetectNewWHS; - if (I2C_ReadingMsgQ != NULL) - Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); - return; -} - void Trigger_WHS_init_IO(void) { I2C_ReadingMessageStruc I2C_ReadingMessage; @@ -461,10 +450,6 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) } break; - case DetectNewWHS: - Check_WHS_Type_Via_EEPROM(); - break; - case WHS_init_I2C_IO: WHS_IO_Init(); break; diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h index 4f5712442..bc58e2450 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h @@ -10,7 +10,7 @@ #define DRIVERS_I2C_COMMUNICATION_I2C_TASK_H_ -void Trigger_Check_WHS_Type_Via_EEPROM(void); + void Trigger_WHS_init_IO(void); void Trigger_WHS_init_fan(void); void Trigger_WHS_init_PT100(void); diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 03135c0d5..d1fd48b32 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -636,7 +636,8 @@ uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Sever { if (AlarmItem == NULL) return ERROR; - //DebugLogCategory reprocessedSeverity = Severity; + + DebugLogCategory reprocessedSeverity = Severity; //ProcessParameters ProcessParameterZero; switch (AlarmItem[AlarmId].AlarmSource) { @@ -691,14 +692,19 @@ uint32_t AlarmHandlingConsequentActions(uint32_t AlarmId, DebugLogCategory Sever Valve_Set(IDS_Id_to_AirValve[AlarmItem[AlarmId].DeviceId], AlarmItem[AlarmId].DeviceId ); //AlarmItem[AlarmId].DeviceId/ON Valve_Set(IDS_Id_to_CartrideValve[AlarmItem[AlarmId].DeviceId], AlarmItem[AlarmId].DeviceId ); //Atm_MidTank_OFF/ON } + if ((JobIsActive())&&(DispenserUsedInJob[AlarmItem[AlarmId].DeviceId] == false)) + { + reprocessedSeverity = DEBUG_LOG_CATEGORY__Warning; + } + } break; default: break; } - /*switch (reprocessedSeverity)*/ - switch (Severity) + switch (reprocessedSeverity) + /*switch (Severity)*/ { case DEBUG_LOG_CATEGORY__Warning: //raise flag fr next job diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index b24970ea0..48c7c3f5e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -720,8 +720,8 @@ uint32_t MillisecLowLoop(uint32_t tick) } Trigger_WHS_PT100_Read_All(); Trigger_WHS_MAX11614_Read_allADC(); - WHS_Blower_Avarege_ORF1(); - WHS_Blower_Avarege_ORF3(); +// WHS_Blower_Avarege_ORF1(); //drier + WHS_Blower_Avarege_ORF3(); //head Trigger_WHSReadAllFanTacho (); } if (OneMinute_Tick) diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index ec7650f3d..2c6040bab 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -518,25 +518,6 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) } } } - //from now on starting blower on INIT, so that the chiller does not freeze - /*if (BlowerCfg.enabled == true) - { - Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.heatingvoltage) - Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); - else - Control_Voltage_To_Blower(BlowerCfg.voltage-500); - - }*/ - -/* - for (Dispenser_i = 0;Dispenser_i < MAX_SYSTEM_DISPENSERS;Dispenser_i++) - { - Enable_MidTank_Pressure_Reading(Dispenser_i); - Valve_Set(IDS_Id_to_AirValve[Dispenser_i], Atm_MidTank_ON ); //Atm_MidTank_OFF/ON - } - GenHWControlId = AddControlCallback(NULL, GenHWInitCallBackFunction, 2* eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); -*/ ControlStart(); AlarmHandlingStart(); //ThreadInitialTestStub(request); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index d84098469..079903a1c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -694,6 +694,7 @@ void PrepareACHeater(int HeaterId,uint32_t Frequency, uint32_t SetTemperatue) HeaterAtTemp[HeaterId] = false; if (BlowerCfg.enabled == true) { + //WHS_Start_Blower_Control_Closed_Loop(2.5); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); @@ -1161,6 +1162,7 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) AlarmHandlingSetAlarm(HeaterUnderEventType[index], false); if (BlowerCfg.enabled == true) { + //WHS_Start_Blower_Control_Closed_Loop(5.0); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.voltage) //Gradual_Increase_Blower(BlowerCfg.heatingvoltage,BlowerCfg.voltage); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 56e314967..f87aa2eda 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -506,7 +506,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) } else - if(request->amount == 0x0CC) //Cùøàøïâò÷ Vùêïâùàïíî ø÷ãôíîã÷ + if(request->amount == 0x0CC) //Cartridge Validation Response Demo { LOG_ERROR(request->delay,"ResponseDemo"); ResponseDemo(request->delay); @@ -550,7 +550,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.has_progress = true; } else - if(request->amount == 0xB2) //fast refresh for pressure + if(request->amount == 0xB2) //Set loading arm cycles { LOG_ERROR(request->delay,"Set loading arm cycles"); @@ -567,7 +567,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) } else - if(request->amount == 0xB4) //fast refresh for pressure + if(request->amount == 0xB4) //IDS_Dispenser_Content_Init { LOG_ERROR(request->amount,"IDS_Dispenser_Content_Init"); IDS_Dispenser_Content_Init(); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 2a83f8425..aa090625c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -191,6 +191,7 @@ } else { + //WHS_Start_Blower_Control_Closed_Loop(2.5); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 937e348b0..d1f667405 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -39,6 +39,7 @@ INIT_SEQUENCE_BUILT_IN_TEST, INIT_SEQUENCE_INITIAL_BLOWER_ACTIVATION, //INIT_SEQUENCE_DISPENSER_PRESSURE_BUILDUP_TEST, + INIT_SEQUENCE_WAIT_FOR_COOLER, INIT_SEQUENCE_THREAD_DETECTION, INIT_SEQUENCE_START_HEATING, INIT_SEQUENCE_MACHINE_READY_TO_DYE, @@ -120,9 +121,10 @@ uint32_t Start_InitSequence(void) InitSchedulerControlId = AddControlCallback("InitScheduler", InitScheduler, eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); return OK; } +uint32_t ResetReason = 0; void InitSequenceResetReason(void) { - ReportResetReason(); + ResetReason = ReportResetReason(); InitStages++; //InitSequenceStateMachine(InitStages); @@ -198,7 +200,7 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); else Control_Voltage_To_Blower(3000); - + //WHS_Start_Blower_Control_Closed_Loop(2.5); AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_INITIAL_BLOWER_FAILED,OFF); //handle alarm detection and operation Safety_Init(); @@ -209,11 +211,12 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) uint32_t InitSequenceInitialBlowerActivation(void) { MachineStateDetail = MACHINE_STATE_INITIAL_BLOWER_ACTIVATION; + //WHS_Start_Blower_Control_Closed_Loop(0.0); Turn_the_Blower_On();//Turn on with the Default_Voltage - if (BlowerCfg.voltage) - Control_Voltage_To_Blower(BlowerCfg.voltage); - else - Control_Voltage_To_Blower(3000); +// if (BlowerCfg.voltage) +// Control_Voltage_To_Blower(BlowerCfg.voltage); +// else + Control_Voltage_To_Blower(4200); HWControlId = AddControlCallback("Init Blower", InitSequenceBlowerCallBackFunction, 10* eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); /*if (RdInkCartridgeSensor()) //if there is a cartridge in the ink slot skip the valves procedure { @@ -255,6 +258,39 @@ uint32_t InitSequenceDispenserPressureBuildUpTest(void) return OK; } +uint32_t InitSequenceWaitForCoolerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) +{ + InitStages++; + MachineStateDetail = INIT_SEQUENCE_WAIT_FOR_COOLER; + + if (SafeRemoveControlCallback(HWControlId, InitSequenceWaitForCoolerCallBackFunction )==OK) + HWControlId = 0xFF; + else + Report("Remove control callback failed",__FILE__,__LINE__,(int)HWControlId,RpWarning,(int)InitSequenceWaitForCoolerCallBackFunction,0); + return OK; +} +uint32_t InitSequenceWaitForCooler(void) +{ + if (WHS_Type == WHS_TYPE_UNKNOWN) + { + InitStages++; + MachineStateDetail = INIT_SEQUENCE_WAIT_FOR_COOLER; + return OK; + } + if ((ResetReason & SYSCTL_CAUSE_SW)||(ResetReason & SYSCTL_CAUSE_WDOG1)||(ResetReason & SYSCTL_CAUSE_WDOG0)) + { + //soft-warm reset + InitStages++; + MachineStateDetail = INIT_SEQUENCE_WAIT_FOR_COOLER; + } + else + { + //cold reset, wait 2 minutes for cooler start + HWControlId = AddControlCallback("Init Cooler", InitSequenceWaitForCoolerCallBackFunction, 2*eOneMinute, TemplateDataReadCBFunction,0,0, 0 ); + } + //InitSequenceStateMachine(InitStages); + return OK; +} uint32_t InitSequenceThreadDetection(void) { InitStages++; @@ -352,6 +388,8 @@ uint32_t InitSequenceStateMachine( INIT_SEQUENCE_STAGES_ENUM ReadValue) /*case INIT_SEQUENCE_DISPENSER_PRESSURE_BUILDUP_TEST: InitSequenceDispenserPressureBuildUpTest(); break;*/ + case INIT_SEQUENCE_WAIT_FOR_COOLER: + InitSequenceWaitForCooler(); case INIT_SEQUENCE_THREAD_DETECTION: InitSequenceThreadDetection(); break; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c index 051d6c9cd..70e713420 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerIdle.c @@ -100,6 +100,7 @@ void PowerIdleSetIdle(void) } if (BlowerCfg.enabled == true) { + //WHS_Start_Blower_Control_Closed_Loop(2.5); Turn_the_Blower_On();//Turn on with the Default_Voltage if (BlowerCfg.heatingvoltage) Control_Voltage_To_Blower(BlowerCfg.heatingvoltage); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 4218c64a1..0d45b8477 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -442,6 +442,7 @@ uint32_t PowerOffTurnOffCooler(void) /*******************************************************************************************************/ uint32_t PowerOffTurnOffBlower(void) { + //WHS_Start_Blower_Control_Closed_Loop(0.0); Turn_the_Blower_Off();//Turn off PowerOffMachineState++; return OK; @@ -455,6 +456,10 @@ uint32_t PowerOffPowerOff(void) REPORT_MSG (10-i, "Power off in x seconds"); Task_sleep (1000); } + ControlStop(); + MillisecStop(); + HeatersEnd(); + ROM_IntMasterDisable(); Power_Off(); return OK; } -- cgit v1.3.1 From 3deccf0347b1aaaf9f8d2f25e592b6cefe32451b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 12 Feb 2020 15:21:06 +0200 Subject: Veraion 1.4.6.10 improve current reading, fir I2C interface, improve (?) task priorities --- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Drivers/I2C_Communication/ADC_MUX/ADC_MUX.c | 10 +-- .../I2C_Communication/Head_Card/IO_Ports/Head_IO.c | 2 +- .../Embedded/Drivers/I2C_Communication/I2C.h | 1 + .../Embedded/Drivers/I2C_Communication/I2C_Comm.c | 73 +++++++++++--------- .../Embedded/Drivers/I2C_Communication/I2C_Task.c | 26 +++----- .../Embedded/Drivers/Motors/MotorActions.c | 5 ++ .../Embedded/Drivers/flash_ram/FlashProgram.c | 2 +- Software/Embedded_SW/Embedded/Embedded.cfg | 78 +++++++++++----------- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 43 +++++++----- .../Embedded/Modules/Control/MillisecTask.c | 16 ++--- .../Embedded_SW/Embedded/Modules/Control/control.c | 4 +- .../Embedded/Modules/Diagnostics/Diagnostics.c | 13 +++- .../Embedded/Modules/Heaters/Heaters_print.c | 4 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 6 +- .../Embedded/Modules/Stubs_Handler/Progress.c | 18 +++++ .../Embedded/Modules/Thread/ThreadLoad.c | 8 +++ .../Initialization/PowerOffSequence.c | 2 + 18 files changed, 183 insertions(+), 130 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index 20dc627e8..e0dc92e1b 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {1,4,6,9}; +TangoVersion_t _gTangoVersion = {1,4,6,10}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d 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 123f3f1e9..e39d690aa 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 @@ -404,7 +404,7 @@ int Get_MidTank_Int1000_Sensor(MidTank_t MidTank_ID) //0-7 ///////////////////////// Head_MixChip_Heaters_Current ////////////////////////////// -bool Heaters_Current_Read_Enable[9] = {false,false,false,false,false,false,false,false,false}; +bool Heaters_Current_Read_Enable[9] = {false,false,false,false,false,false,true,true,false}; double Heaters_Current[9] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0}; @@ -412,21 +412,21 @@ uint32_t Heaters_Current_Bits[9];//just for debug void Enable_Reading_Heaters_Current(HEATERS_CURRENT Heater_ID) //0-8 { - if(Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) + if((Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD)&&(Heater_ID>=HEATER_DRYER_CURRENT_3)) return; assert (Heater_ID HEAD_TYPE_SYLKO_WITHOUT_CARD) + if((Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD)&&(Heater_ID>=HEATER_DRYER_CURRENT_3)) return; assert (Heater_ID HEAD_TYPE_SYLKO_WITHOUT_CARD) + if((Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD)&&(Heater_ID>=HEATER_DRYER_CURRENT_3)) return false; assert (Heater_ID HEAD_TYPE_SYLKO_WITHOUT_CARD) + if((Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD)&&(Heater_ID>=HEATER_DRYER_CURRENT_3)) return 0; assert (Heater_ID 10) - { - Arb_Loss_Count= 0; - Init_All_I2C(); - ReportWithPackageFilter(CommFilter,"Reinitializing I2C master", __FILE__,__LINE__,status, RpMessage, Task_self(), 0); - } - } - else - { - if (Arb_Loss_Count) - ReportWithPackageFilter(CommFilter,"Resetting count", __FILE__, Arb_Loss_Count, status, RpMessage, Task_self(), 0); - - // Arb_Loss_Count = 0; - } return status; } @@ -190,23 +174,6 @@ uint32_t I2C_ReadBuff(uint32_t I2C_BASE, unsigned char addr, unsigned char* data //return I2CMasterErr(I2C_BASE) == I2C_MASTER_ERR_NONE; status |= I2CMasterErr(I2C_BASE); } - if (status == I2C_MASTER_ERR_ARB_LOST) - { - if (Arb_Loss_Count++ > 10) - { - Arb_Loss_Count= 0; - Init_All_I2C(); - ReportWithPackageFilter(CommFilter,"Reinitializing I2C master", __FILE__,__LINE__, status, RpMessage, Task_self(), 0); - - } - } - else - { - if (Arb_Loss_Count) - ReportWithPackageFilter(CommFilter,"Resetting count", __FILE__, Arb_Loss_Count, status, RpMessage, Task_self(), 0); - - //Arb_Loss_Count = 0; - } return status; } @@ -228,6 +195,10 @@ uint32_t I2C_Write(uint32_t I2C_ID, uint32_t Slave_Add, uint32_t *I2C_Write_buf, else return ERROR; + /* if (Task_self()!=I2C_Task_Handle) + { + ReportWithPackageFilter(CommFilter,"I2C_Write called from different task", __FILE__,__LINE__, I2C_Task_Handle, RpMessage, Task_self(), 0); + }*/ /* if ( (Slave_Add != 0xE0) && (Slave_Add != 0xE4) && (Slave_Add != 0xE3) & (Slave_Add != 0x40) && (Slave_Add != 0x44) && (Slave_Add != 0x46) & (Slave_Add != 0x98) && (Slave_Add != 0xA0) ) @@ -254,6 +225,22 @@ uint32_t I2C_Write(uint32_t I2C_ID, uint32_t Slave_Add, uint32_t *I2C_Write_buf, // } status = I2C_WriteBuff(I2C_BASE, Slave_Add, I2C_Write_buf, No_BytesToWrite); + if (status) + { + if (Arb_Loss_Count++ > 10) + { + Arb_Loss_Count= 0; + Init_All_I2C(); + ReportWithPackageFilter(CommFilter,"Reinitializing I2C master", __FILE__,__LINE__, status, RpMessage, Task_self(), 0); + + } + } + /*else + { + if (Arb_Loss_Count) + ReportWithPackageFilter(CommFilter,"Resetting count", __FILE__, Arb_Loss_Count, status, RpMessage, Task_self(), 0); + //Arb_Loss_Count = 0; + }*/ return status; } @@ -280,6 +267,10 @@ uint32_t I2C_Read(uint32_t I2C_ID, uint32_t Slave_Add, uint32_t *I2C_Read_buf, u (Slave_Add != 0x40) && (Slave_Add != 0x44) && (Slave_Add != 0x46) & (Slave_Add != 0x98) && (Slave_Add != 0xA0) ) return ERROR;*/ + /*if (Task_self()!=I2C_Task_Handle) + { + ReportWithPackageFilter(CommFilter,"I2C_Write called from different task", __FILE__,__LINE__, I2C_Task_Handle, RpMessage, Task_self(), 0); + }*/ Slave_Add = Slave_Add>>1; @@ -303,6 +294,22 @@ uint32_t I2C_Read(uint32_t I2C_ID, uint32_t Slave_Add, uint32_t *I2C_Read_buf, u //status = I2C_WriteBuff(I2C_BASE, Slave_Add, Bytes2Write, No_BytesTWrite); status = I2C_ReadBuff(I2C_BASE, Slave_Add, I2C_Read_buf, No_BytesToRead); + if (status) + { + if (Arb_Loss_Count++ > 10) + { + Arb_Loss_Count= 0; + Init_All_I2C(); + ReportWithPackageFilter(CommFilter,"Reinitializing I2C master", __FILE__,__LINE__, status, RpMessage, Task_self(), 0); + + } + } + /*else + { + if (Arb_Loss_Count) + ReportWithPackageFilter(CommFilter,"Resetting count", __FILE__, Arb_Loss_Count, status, RpMessage, Task_self(), 0); + //Arb_Loss_Count = 0; + }*/ return status; } diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c index 4308a7913..c2097dbef 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -28,6 +28,7 @@ #include "modules/ids/ids_ex.h" extern Semaphore_Handle I2C_Sem; +Task_Handle I2C_Task_Handle; Mailbox_Handle I2C_ReadingMsgQ = NULL; typedef enum { @@ -41,7 +42,6 @@ typedef enum Actuators_Control, /* enum for WHS :*/ - DetectNewWHS, WHS_start, WHS_init_I2C_IO, WHS_init_fan, @@ -78,7 +78,10 @@ void Trigger_Heater_Current_Read(void) uint8_t Heater_i=0; I2C_ReadingMessage.messageId = Heater_Current_Reading; - I2C_ReadingMessage.parameter = Heater_i; + I2C_ReadingMessage.parameter = HEATER_DRYER_CURRENT_1; + if (I2C_ReadingMsgQ != NULL) + Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); + I2C_ReadingMessage.parameter = HEATER_DRYER_CURRENT_2; if (I2C_ReadingMsgQ != NULL) Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); @@ -161,16 +164,6 @@ void Trigger_InputsReading(void) } -void Trigger_Check_WHS_Type_Via_EEPROM() -{ - I2C_ReadingMessageStruc I2C_ReadingMessage; - - I2C_ReadingMessage.messageId = DetectNewWHS; - if (I2C_ReadingMsgQ != NULL) - Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); - return; -} - void Trigger_WHS_init_IO(void) { I2C_ReadingMessageStruc I2C_ReadingMessage; @@ -398,6 +391,7 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) I2C_ReadingMessageStruc I2C_ReadingMessage; Semaphore_post(I2C_Sem); TEMPERATURE_SENSOR_ID_ENUM Sensor_i; + I2C_Task_Handle = Task_self(); while(1) { @@ -425,7 +419,7 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) break; case Heater_Current_Reading: //Report("Read_Heaters_Current",__FILE__,__LINE__,255,RpWarning,0,0); - if(Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) + if((Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD)&&(I2C_ReadingMessage.parameter>=HEATER_DRYER_CURRENT_3)) Read_Head_ADC(I2C_ReadingMessage.parameter); else Read_Heaters_Current(I2C_ReadingMessage.parameter); @@ -440,7 +434,7 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) HeadADCPT100_SensorInitConfig(); break; case Actuators_Control: - HeadCard_Actuators_Control(I2C_ReadingMessage.parameter, (bool)I2C_ReadingMessage.parameter2,(bool)I2C_ReadingMessage.parameter2); + HeadCard_Actuators_Control(I2C_ReadingMessage.parameter, (bool)I2C_ReadingMessage.parameter2,(bool)I2C_ReadingMessage.parameter3); break; case Inputs_Reading: Head_Read_IO_Reg(0x46, HIGH);//READ HEAD CARD LS @@ -461,10 +455,6 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) } break; - case DetectNewWHS: - Check_WHS_Type_Via_EEPROM(); - break; - case WHS_init_I2C_IO: WHS_IO_Init(); break; diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index ddd0d293c..9fe7a67cc 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -839,6 +839,11 @@ void MotorActionsInit(void) MotorDriverResponse[i].Status = 0xFFFFFFFF; StoredMotorPosition[i] = 0; } + if (Head_Type == HEAD_TYPE_SYLKO)//adjust the limit switches + { + Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DH_LID] = HEADCARD_COVER_LS_REAR; + Motor_Id_to_LS_IdUp [HARDWARE_MOTOR_TYPE__MOTO_DH_LID] = HEADCARD_COVER_LS_FRONT; + } } diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c index bef2b1727..240585e43 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c @@ -106,7 +106,7 @@ uint32_t ReadAppAndProgram(uint32_t ui32FlashStart,uint32_t ui32FileSize,void* b status = FlashProgram((uint32_t *)ui32BufferAddr, ui32ProgAddr,(ui32DataSize + 3) & ~3); if (status) - Report("FlashProgram Error", __FILE__,status,ui32FlashStart , RpMessage, (ui32DataSize + 3) & ~3, 0); + Report("FlashProgram Error", __FILE__,status,ui32ProgAddr , RpMessage, (ui32DataSize + 3) & ~3, 0); // // If there is more image to program, then update the programming diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg index 26fd2a980..734902ce7 100644 --- a/Software/Embedded_SW/Embedded/Embedded.cfg +++ b/Software/Embedded_SW/Embedded/Embedded.cfg @@ -99,66 +99,60 @@ Program.global.ReconnectSem = Semaphore.create(null, semaphore7Params); var MillisecTaskParams = new Task.Params(); MillisecTaskParams.instance.name = "MilliSecond"; MillisecTaskParams.stackSize = 4096; -MillisecTaskParams.priority = 12; +MillisecTaskParams.priority = 14; Program.global.millisec = Task.create("&MillisecTask", MillisecTaskParams); -var FPGALoad = new Task.Params(); -FPGALoad.instance.name = "FPGALoad"; -FPGALoad.stackSize = 4096; -FPGALoad.priority = 4; -Program.global.FPGALoad = Task.create("&FPGALoadTask", FPGALoad); - -var I2C_Reading = new Task.Params(); -I2C_Reading.instance.name = "I2C_Reading"; -I2C_Reading.stackSize = 2048; -I2C_Reading.priority = 8; -Program.global.I2C_Reading = Task.create("&I2C_ReadingTask", I2C_Reading); - var ControlTaskParams = new Task.Params(); ControlTaskParams.instance.name = "control"; ControlTaskParams.stackSize = 2048; -ControlTaskParams.priority = 11; +ControlTaskParams.priority = 13; Program.global.control = Task.create("&controlTask", ControlTaskParams); -var AlarmHandlingTaskParams = new Task.Params(); -AlarmHandlingTaskParams.instance.name = "AlarmHandling"; -AlarmHandlingTaskParams.stackSize = 4096; -AlarmHandlingTaskParams.priority = 9; -Program.global.AlarmHandling = Task.create("&AlarmHandlingTask", AlarmHandlingTaskParams); - var CommTxTaskParams = new Task.Params(); CommTxTaskParams.instance.name = "communicationTx"; -CommTxTaskParams.priority = 10; +CommTxTaskParams.priority = 12; CommTxTaskParams.stackSize = 4096; Program.global.communicationTx = Task.create("&communicationTxTask", CommTxTaskParams); +var CommRxTaskParams = new Task.Params(); +CommRxTaskParams.instance.name = "communicationRx"; +CommRxTaskParams.priority = 11; +CommRxTaskParams.stackSize = 8192; +Program.global.communication = Task.create("&communicationTask", CommRxTaskParams); + +var AlarmHandlingTaskParams = new Task.Params(); +AlarmHandlingTaskParams.instance.name = "AlarmHandling"; +AlarmHandlingTaskParams.stackSize = 4096; +AlarmHandlingTaskParams.priority = 10; +Program.global.AlarmHandling = Task.create("&AlarmHandlingTask", AlarmHandlingTaskParams); + var ProcessTaskParams = new Task.Params(); ProcessTaskParams.instance.name = "process"; ProcessTaskParams.stackSize = 4096; -ProcessTaskParams.priority = 8; +ProcessTaskParams.priority = 9; Program.global.process = Task.create("&jobTask", ProcessTaskParams); +var I2C_Reading = new Task.Params(); +I2C_Reading.instance.name = "I2C_Reading"; +I2C_Reading.stackSize = 2048; +I2C_Reading.priority = 8; +Program.global.I2C_Reading = Task.create("&I2C_ReadingTask", I2C_Reading); + var HeaterControlTaskParams = new Task.Params(); HeaterControlTaskParams.instance.name = "HeatersControl"; HeaterControlTaskParams.priority = 7; Program.global.HeatersControl = Task.create("&HeatersControlTask", HeaterControlTaskParams); -var CommRxTaskParams = new Task.Params(); -CommRxTaskParams.instance.name = "communicationRx"; -CommRxTaskParams.priority = 9; -CommRxTaskParams.stackSize = 8192; -Program.global.communication = Task.create("&communicationTask", CommRxTaskParams); - -var MillisecLowTaskParams = new Task.Params(); -MillisecLowTaskParams.instance.name = "MilliSecondLow"; -MillisecLowTaskParams.stackSize = 2048; -MillisecLowTaskParams.priority = 5; -Program.global.millisecLow = Task.create("&MillisecLowTask", MillisecLowTaskParams); +var ReportTaskParams = new Task.Params(); +ReportTaskParams.instance.name = "report"; +ReportTaskParams.stackSize = 4096; +ReportTaskParams.priority = 6; +Program.global.report = Task.create("&reportService", ReportTaskParams); var ControlLowTaskParams = new Task.Params(); ControlLowTaskParams.instance.name = "controlLow"; ControlLowTaskParams.stackSize = 4096; -ControlLowTaskParams.priority = 6; +ControlLowTaskParams.priority = 5; Program.global.controlLow = Task.create("&controlLowTask", ControlLowTaskParams); var DiagnosticsTaskParams = new Task.Params(); @@ -167,17 +161,23 @@ DiagnosticsTaskParams.priority = 4; DiagnosticsTaskParams.stackSize = 8192; Program.global.Diagnostics = Task.create("&DiagnosticsTask", DiagnosticsTaskParams); +var MillisecLowTaskParams = new Task.Params(); +MillisecLowTaskParams.instance.name = "MilliSecondLow"; +MillisecLowTaskParams.stackSize = 2048; +MillisecLowTaskParams.priority = 3; +Program.global.millisecLow = Task.create("&MillisecLowTask", MillisecLowTaskParams); + var ADCProcessTaskParams = new Task.Params(); ADCProcessTaskParams.instance.name = "adcProcess"; ADCProcessTaskParams.stackSize = 512; ADCProcessTaskParams.priority = 2; Program.global.adcProcess = Task.create("&ADCProcessTask", ADCProcessTaskParams); -var ReportTaskParams = new Task.Params(); -ReportTaskParams.instance.name = "report"; -ReportTaskParams.stackSize = 4096; -ReportTaskParams.priority = 7; -Program.global.report = Task.create("&reportService", ReportTaskParams); +var FPGALoad = new Task.Params(); +FPGALoad.instance.name = "FPGALoad"; +FPGALoad.stackSize = 4096; +FPGALoad.priority = 2; +Program.global.FPGALoad = Task.create("&FPGALoadTask", FPGALoad); var updateTaskParams = new Task.Params(); updateTaskParams.instance.name = "update"; diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index d1fd48b32..caa3e8df4 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -66,7 +66,6 @@ uint32_t AlarmHandlingControlId = 0xFF; uint32_t AlarmHandlingTick = 0; double CurrentAlarmHighLimit ,CurrentAlarmLowLimit; - bool CheckHardLimitAlarms = false,CheckCurrentAlarms = false,CheckTamperAlarms = false,CheckMotorAlarms = false; uint8_t alarm_response_buffer[500]; @@ -837,6 +836,13 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) } for (Alarm_i = 0;Alarm_i= (float)(AlarmItem[Alarm_i].AlarmValue*CurrentAlarmHighLimit)) || (doubleValue <= (float)(AlarmItem[Alarm_i].AlarmValue*CurrentAlarmLowLimit))) + if (AlarmItem[Alarm_i].AlarmDirection == true) { - Status = true; - if (AlarmState[Alarm_i].Status == false) - ReportWithPackageFilter(AlarmFilter,"OverCurrent Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,(int)(AlarmItem[Alarm_i].AlarmValue*100), RpMessage, (int)(doubleValue*100), 0); + if ((doubleValue >= (float)(AlarmItem[Alarm_i].AlarmValue*CurrentAlarmHighLimit)) || (doubleValue <= (float)(AlarmItem[Alarm_i].AlarmValue*CurrentAlarmLowLimit))) + { + Status = true; + if (AlarmState[Alarm_i].Status == false) + ReportWithPackageFilter(AlarmFilter,"OverCurrent Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,(int)(AlarmItem[Alarm_i].AlarmValue*100), RpMessage, (int)(doubleValue*100), 0); + } } - } - else - { - if (doubleValue <= 0.1) + else { - Status = true; - if (AlarmState[Alarm_i].Status == false) - ReportWithPackageFilter(AlarmFilter,"loop break Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,(int)(AlarmItem[Alarm_i].AlarmValue*100), RpMessage, (int)(doubleValue*100), 0); + if (doubleValue <= 0.1) + { + Status = true; + if (AlarmState[Alarm_i].Status == false) + ReportWithPackageFilter(AlarmFilter,"loop break Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,(int)(AlarmItem[Alarm_i].AlarmValue*100), RpMessage, (int)(doubleValue*100), 0); + } } } } @@ -1266,7 +1279,7 @@ uint32_t AlarmHandlingLoop(uint32_t tick) case ALARM_SOURCE_TYPE__TachoAlarm: // add by shai Status = false; - if (CheckCurrentAlarms) + if (CheckTamperAlarms) { // ReportWithPackageFilter(AlarmFilter,"------------FANS_RPM[Alarm_i]----------------", __FILE__,__LINE__,Alarm_i, RpMessage, value, 0); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 48c7c3f5e..e5064ef70 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -579,7 +579,7 @@ uint32_t MillisecLowLoop(uint32_t tick) //test dancers and speed encoders //check all callback units (state machine waiting for completion of a change) bool Ten_msTick, Fifty_msTick, Hundred_msTick , m20msecTick,m70msecTick,m90msecTick, Onesecond_Tick,OneMinute_Tick,OneHourTick,Gradient_Tick; - bool O100Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick; + bool O700Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick; //bool O100Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick,O800Millisecond_Tick,O900Millisecond_Tick; Ten_msTick = (tick%eTenMillisecond == 0) ?true:false; Fifty_msTick = (tick%eHundredMillisecond == 40) ?true:false; //eFiftyMillisecond @@ -587,7 +587,7 @@ uint32_t MillisecLowLoop(uint32_t tick) m20msecTick = (tick%eHundredMillisecond == 20) ?true:false; m70msecTick = (tick%eHundredMillisecond == 70) ?true:false; m90msecTick = (tick%eHundredMillisecond == 90) ?true:false; - O100Millisecond_Tick = (tick%eOneSecond == 100) ?true:false; + O700Millisecond_Tick = (tick%eOneSecond == 700) ?true:false; O200Millisecond_Tick = (tick%eOneSecond == 200) ?true:false; O400Millisecond_Tick = (tick%eOneSecond == 400) ?true:false; O500Millisecond_Tick = (tick%eOneSecond == 500) ?true:false; @@ -663,7 +663,7 @@ uint32_t MillisecLowLoop(uint32_t tick) } if (Gradient_Tick) DispensersCollectionCall(); - if (O100Millisecond_Tick) + if (O700Millisecond_Tick) { Trigger_Heater_Current_Read(); } @@ -705,8 +705,8 @@ uint32_t MillisecLowLoop(uint32_t tick) MachineUpdateResponseFunc(); //KeepAliveOneSecondCall(); - TemperatureListString(Lenstr); - ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,__LINE__,(int)Counter++,RpWarning,(int) msec_millisecondCounter,0); + //TemperatureListString(Lenstr); + //ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,__LINE__,(int)Counter++,RpWarning,(int) msec_millisecondCounter,0); for (Sensor_i = StartPT100;Sensor_i < MAX_HEAD_CARD_TEMP_SENS_ID;Sensor_i++) { TemperatureCalc[Sensor_i] = MillisecCalculateTemperatures ( Sensor_i); @@ -718,10 +718,10 @@ uint32_t MillisecLowLoop(uint32_t tick) PressureCalc[Disp_i] = MillisecCalculatePressures(Disp_i); } } - Trigger_WHS_PT100_Read_All(); - Trigger_WHS_MAX11614_Read_allADC(); + Trigger_WHS_PT100_Read_All(); + Trigger_WHS_MAX11614_Read_allADC(); // WHS_Blower_Avarege_ORF1(); //drier - WHS_Blower_Avarege_ORF3(); //head + WHS_Blower_Avarege_ORF3(); //head Trigger_WHSReadAllFanTacho (); } if (OneMinute_Tick) diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 5adf6f83d..a6540bc81 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -576,8 +576,8 @@ uint32_t ControlLowLoop(uint32_t tick) if (tick-prevtick>1) { skipped_ticks = tick-prevtick-1; - if (tick-prevtick>10) - Report("ControlLowLoop skipped",__FILE__,tick,(int)prevtick,RpWarning,(int)skipped_ticks,0); + //if (tick-prevtick>10) + // Report("ControlLowLoop skipped",__FILE__,tick,(int)prevtick,RpWarning,(int)skipped_ticks,0); } prevtick = tick; diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index bb8f5d994..f1538197b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -461,7 +461,7 @@ void DiagnosticOneMinuteCollection(void) for (i=0;i DispenserPreparePressure) + if (GetDispenserPressure(i) > DispenserPreparePressure*1.02) { NumofReadyDispensers++; CurrentDispenserSpeed[i] = 0; @@ -528,7 +528,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) //Report("IDS stopped ready",__FILE__,i,(int)(DispenserPreparePressure*100),RpWarning,(int)NumofReadyDispensers,0); #else tempSpeed = CurrentDispenserSpeed[i]; - updatedSpeed = (tempSpeed*0.985>100)?tempSpeed*0.985:100; + updatedSpeed = (tempSpeed*0.992>100)?tempSpeed*0.992:100; MotorSetSpeed(HW_Motor_Id, updatedSpeed); CurrentDispenserSpeed[i] = updatedSpeed; //Report("IDS reduce speed",__FILE__,i,(int)tempSpeed,RpWarning,(int)updatedSpeed,0); @@ -543,7 +543,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) #else tempSpeed = CurrentDispenserSpeed[i]; #endif - updatedSpeed = (tempSpeed*1.02amount == 0xC3) //suspend I2C task + { + if (request->delay == 0) + { + LOG_ERROR(request->delay,"Suspend I2C"); + PowerOffHeatersOff(); + Task_sleep(1000); + Task_setPri (I2C_Task_Handle,-1); + } + else + { + LOG_ERROR(request->delay,"Resume"); + Task_setPri (I2C_Task_Handle,8); + } + response.progress = request->delay; + response.has_progress = true; + } else if((request->amount == 0xDF) && (request->delay == 0xDF)) //Power off { diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index aa090625c..4ab59ec19 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -180,6 +180,14 @@ ProcessParametersClear.headzone4temp = 0; ProcessParametersClear.headzone5temp = 0; ProcessParametersClear.headzone6temp = 0; + ProcessParametersClear.headzone7temp = 0; + ProcessParametersClear.headzone8temp = 0; + ProcessParametersClear.headzone9temp = 0; + ProcessParametersClear.headzone10temp = 0; + ProcessParametersClear.headzone11temp = 0; + ProcessParametersClear.headzone12temp = 0; + ProcessParametersClear.stspzone1temp = 0; + ProcessParametersClear.stspzone2temp = 0; ProcessParametersClear.dyeingspeed = 40; ProcessParametersClear.dryerbufferlength = ProcessParametersKeep.dryerbufferlength; if (HandleProcessParameters(&ProcessParametersClear,false)!= OK) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 0d45b8477..5cc94a909 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -250,6 +250,8 @@ uint32_t PowerOffHeatersOff(void) ProcessParametersClear.headzone10temp = 0; ProcessParametersClear.headzone11temp = 0; ProcessParametersClear.headzone12temp = 0; + ProcessParametersClear.stspzone1temp = 0; + ProcessParametersClear.stspzone2temp = 0; ProcessParametersClear.dyeingspeed = 40; if (HandleProcessParameters(&ProcessParametersClear,false)!= OK) { -- cgit v1.3.1 From ef657b4a3ae76e99ab077d6b4fc19691c2a0da4a Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Mon, 17 Feb 2020 16:07:38 +0200 Subject: merge --- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded/Drivers/I2C_Communication/I2C_Task.c | 22 ++++++++ .../Embedded/Drivers/I2C_Communication/I2C_Task.h | 2 +- .../WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c | 62 ++++++++++++++++---- .../WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h | 7 ++- .../Embedded_SW/Embedded/Drivers/Valves/Valve.c | 4 +- Software/Embedded_SW/Embedded/Main.c | 12 ++-- .../Embedded/Modules/General/GeneralHardware.c | 8 +-- .../Embedded_SW/Embedded/Modules/General/buttons.c | 66 ++++++++++++++-------- .../Embedded/Modules/Heaters/Heaters_print.c | 3 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 7 ++- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 29 +++++----- .../Embedded/Modules/Stubs_Handler/Progress.c | 12 +++- .../Embedded/Modules/Thread/ThreadLoad.c | 1 + .../Embedded/Modules/Thread/Thread_init.c | 5 +- 15 files changed, 173 insertions(+), 69 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c') diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index e0dc92e1b..6885ee3d8 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {1,4,6,10}; +TangoVersion_t _gTangoVersion = {1,4,6,11}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c index ce777f393..27ae72084 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.c @@ -55,6 +55,7 @@ typedef enum WHS_READ_FAN_TACHO, WHS_READ_ALL_FAN_TACHO, WHS_SET_VOLT_BLOWER_CONTROL, + WHS_SETPOINT_Q_BLOWER, WHS_SET_VAlVE_CARTRIDGE, WHS_SET_PUMP, WHS_READ_ADC, @@ -301,6 +302,19 @@ void Trigger_SetWHSBlowerVoltage (uint16_t voltage) return; } +void Trigger_WHS_Set_Blower_Control_Closed_Loop (uint32_t setpoint_Q) +{ + I2C_ReadingMessageStruc I2C_ReadingMessage; + + I2C_ReadingMessage.messageId = WHS_SETPOINT_Q_BLOWER; + I2C_ReadingMessage.parameter = setpoint_Q; + + if (I2C_ReadingMsgQ != NULL) + Mailbox_post(I2C_ReadingMsgQ , &I2C_ReadingMessage, BIOS_NO_WAIT); + return; +} + + //void Trigger_WHS_Set_Valve(uint8_t valve_number, bool status) void Trigger_SetWHSValveWatseCartridge(uint8_t Cart_Id) { @@ -389,12 +403,14 @@ void I2C_ReadingTask_Init(void) { I2C_ReadingMsgQ = Mailbox_create(sizeof(I2C_ReadingMessageStruc), 40, NULL,NULL); } + void I2C_ReadingTask(UArg arg0, UArg arg1) { I2C_ReadingMessageStruc I2C_ReadingMessage; Semaphore_post(I2C_Sem); TEMPERATURE_SENSOR_ID_ENUM Sensor_i; I2C_Task_Handle = Task_self(); + double dbl_setpoint_Q = 0.0; while(1) { @@ -498,6 +514,12 @@ void I2C_ReadingTask(UArg arg0, UArg arg1) WHS_Set_Volt_Blower_Control(I2C_ReadingMessage.parameter); //(fan_number, 0x20) break; + case WHS_SETPOINT_Q_BLOWER: + + dbl_setpoint_Q = (double)(I2C_ReadingMessage.parameter / 100) ; + WHS_Set_Blower_Control_Closed_Loop(dbl_setpoint_Q); + break; + case WHS_SET_VAlVE_CARTRIDGE: // Set_WHS_valve(VALVE_0, I2C_ReadingMessage.parameter, 0); Write_WHS_Valve_reg(); diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h index 03edea5d9..b16e87766 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_Task.h @@ -27,7 +27,7 @@ void Trigger_WHS_PT100_Read_All(void); void Trigger_ReadWHSPT100(uint8_t PT100_Id); //void Trigger_WHS_Set_Volt_Blower_Control(uint16_t volt); void Trigger_SetWHSBlowerVoltage (uint16_t voltage); - +void Trigger_WHS_Set_Blower_Control_Closed_Loop (uint32_t setpoint_Q); //void Trigger_WHS_Set_Valve(uint8_t valve_number, bool status); void Trigger_SetWHSValveWatseCartridge(uint8_t Cart_Id); //void Trigger_WHS_Set_Pump(bool status); diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c index 310ad9163..28b4f8598 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.c @@ -109,8 +109,15 @@ int16_t Write_Max5805_LDACn(bool value) bool WHS_Set_Volt_Blower_Control(uint16_t volt) { bool status = OK; - MAX5805_CODE_LOAD( volt); - ReportWithPackageFilter(WasteFilter,"------------ WHS_Set_Volt_Blower_Control (volt)-----------------", __FILE__,__LINE__, volt, RpMessage, 0, 0); + if (volt > 0xFFF ) //the max value is 0xFFF + { + ReportWithPackageFilter(WasteFilter,"------------ WHS_Set_Volt_Blower_Control (volt) high > 0xFFF-----------------", __FILE__,__LINE__, volt, RpMessage, 0, 0); + } + else + { + MAX5805_CODE_LOAD( volt); + ReportWithPackageFilter(WasteFilter,"------------ WHS_Set_Volt_Blower_Control (volt)-----------------", __FILE__,__LINE__, volt, RpMessage, 0, 0); + } return status; } @@ -221,6 +228,7 @@ double WHS_Blower_Avarege_ORF3() sum_orifice_Q += average_orf3_Q_buff[i]; average_Q_orifice3 = sum_orifice_Q /ORF_BUFF_SIZE; + ReportWithPackageFilter(WasteFilter,"------------ average_Q_orifice3 hex head -----------------", __FILE__,__LINE__,(int)orifice_hex_value, RpMessage, (average_Q_orifice3*1000), 0); return OK; } @@ -252,24 +260,26 @@ bool Test_WHS_blower() return status; } -#define SET_DYEING_HEAD_ORRIFFICE_SENSOR 0 //todo +#define SET_DYEING_HEAD_ORRIFFICE_SENSOR headairflow //todo #define LARGE_STEP 10 //todo define the correct number #define SMALL_STEP 1 //todo define the correct number -bool WHS_Set_Blower_Control_Closed_Loop() +bool WHS_Set_Blower_Control_Closed_Loop(double SetPoint_Q) { //double average_ORF1_Q = 0; - double current_dying_head_flow = 0; + double current_dying_head_flow_Q = 0; uint16_t volt; - //average_ORF1_Q = get_Q((int16_t) average_ORF1); - current_dying_head_flow = get_average_ORF1_Q(); - if (abs(current_dying_head_flow - SET_DYEING_HEAD_ORRIFFICE_SENSOR) > 0.2) + + current_dying_head_flow_Q = get_average_ORF3_Q(); + ReportWithPackageFilter(WasteFilter,"------------ current_dying_head_flow_Q =-----------------", __FILE__,__LINE__, current_dying_head_flow_Q, RpMessage, 0, 0); + ReportWithPackageFilter(WasteFilter,"------------ SET_DYEING_HEAD_ORRIFFICE_SENSOR =-----------------", __FILE__,__LINE__, SET_DYEING_HEAD_ORRIFFICE_SENSOR, RpMessage, current_dying_head_flow_Q, 0); + if (abs(current_dying_head_flow_Q - SetPoint_Q) > 0.2) { volt = getBlowerState(); - if (current_dying_head_flow < SET_DYEING_HEAD_ORRIFFICE_SENSOR) + if (current_dying_head_flow_Q < SetPoint_Q) { - if (( SET_DYEING_HEAD_ORRIFFICE_SENSOR - current_dying_head_flow) > 0.5) + if (( SetPoint_Q - current_dying_head_flow_Q) > 0.5) { /* increase blower voltage by large step: */ ReportWithPackageFilter(WasteFilter,"------------ increase blower voltage by large step:-----------------", __FILE__,__LINE__, volt, RpMessage, LARGE_STEP, 0); @@ -284,7 +294,7 @@ bool WHS_Set_Blower_Control_Closed_Loop() } else { - if (( current_dying_head_flow -SET_DYEING_HEAD_ORRIFFICE_SENSOR) > 0.5) + if (( current_dying_head_flow_Q - SetPoint_Q) > 0.5) { /* decrease blower voltage by large step: */ ReportWithPackageFilter(WasteFilter,"------------ decrease blower voltage by large step:-----------------", __FILE__,__LINE__, volt, RpMessage, LARGE_STEP, 0); @@ -301,6 +311,36 @@ bool WHS_Set_Blower_Control_Closed_Loop() return OK; } +void WHS_Start_Blower_Control_Closed_Loop (double SetPoint_Q) +{ + // use 0 to STOP +// uint16_t mVSetpoint = 0; + + if(SetPoint_Q) + { + WHS_Set_Blower_Control_Closed_Loop(SetPoint_Q); + } + else + { + // blower off? + } + + +} +double WHS_Get_Blower_Control_Closed_Loop_SetPoint(void) +{ + double SetPoint = 0; + // to do return the setpoint + return SetPoint; +} + +/* +uint16_t Convert_SetPoint_to_mV(double SetPoint) +{ + uint16_t value = (uint16_t)SetPoint; //todo convert function +return value; +} +*/ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h index 2b776fbc9..9f79034bb 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_Max5805_ADC_Blower/WHS_Blower.h @@ -22,7 +22,12 @@ double WHS_Blower_Avarege_ORF1(void); double WHS_Blower_Avarege_ORF3(void); double get_average_ORF1_Q(void); double get_average_ORF3_Q(void); -bool WHS_Set_Blower_Control_Closed_Loop(); +bool WHS_Set_Blower_Control_Closed_Loop(double SetPoint); +void WHS_Start_Blower_Control_Closed_Loop (double SetPoint); +double WHS_Get_Blower_Control_Closed_Loop_SetPoint(void); + + +extern double headairflow; /* from Blower.h * uint32_t Turn_the_Blower_On(); diff --git a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c index cf54019c5..dc92b6683 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c +++ b/Software/Embedded_SW/Embedded/Drivers/Valves/Valve.c @@ -430,8 +430,8 @@ uint32_t Control3WayValvesWithCallback (Valves_t _ValveId, bool direction, callb 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 - // Report("Add control callback",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0); + else + Report("Add control callback",__FILE__,__LINE__,(int)_ValveId,RpWarning,(int)Valve3WayControlId[_ValveId],0); /*busy = */FPGA_GetDispenserValveBusyOCD(_ValveId,0); //Report("Set valve id, dir, busy",__FILE__,_ValveId,(int)direction,RpWarning,(int)busy,0); diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index 393a366ac..6b5424d74 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -143,7 +143,7 @@ Void errHook(Error_Block *eb) CloseLogFile(); if (UpdateFlag == true) return; - FileHandle = my_malloc(sizeof(FIL)); + /*FileHandle = my_malloc(sizeof(FIL)); if (FileHandle == 0) Fresult = FR_DENIED; else @@ -155,19 +155,19 @@ Void errHook(Error_Block *eb) strncpy(File,site->file,49); len = usnprintf(message, 80, "\r\n%s %s",__DATE__, __TIME__); Fresult = f_write(FileHandle,message,len,&Bytes ); - /* print user supplied error code */ + // print user supplied error code len = usnprintf(message, 300, "\r\nerror %d, eid %d mod %d file %s line %d", eCode, eid,site->mod, site->file,site->line); Fresult = f_write(FileHandle,message,len,&Bytes ); //LOG_ERROR (eCode, "error # "); - /* check originator's mod id against known mods */ + // check originator's mod id against known mods if (site->mod == Main_Module_id()) { Fresult = f_write(FileHandle,"\r\napp error: ",12,&Bytes ); } - /* check error id against known errors */ + // check error id against known errors if (eid == Error_E_generic) { Fresult = f_write(FileHandle,"generic: ",10,&Bytes ); } @@ -176,12 +176,12 @@ Void errHook(Error_Block *eb) Fresult = f_write(FileHandle,"\r\nassertion violation: ",22,&Bytes ); } - /* perform default error output */ + // perform default error output f_close(FileHandle); } Task_sleep (200); my_free(FileHandle); - } + }*/ #ifdef WATCHDOG //Power_Reset(); SysCtlReset(); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 2c6040bab..4f6a40c90 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -187,7 +187,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters->has_initialdispenserpressure = true; EmbeddedParameters->initialdispenserpressure = 0.25; EmbeddedParameters->has_initialdispensertimeout = true; - EmbeddedParameters->initialdispensertimeout = 60000; + EmbeddedParameters->initialdispensertimeout = 180000; EmbeddedParameters->has_initialdispensertimelag = true; EmbeddedParameters->initialdispensertimelag = 100; EmbeddedParameters->has_dispenserbuildpressurespeed = true; @@ -209,7 +209,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters->has_midtankpressurecorrection = true; EmbeddedParameters->midtankpressurecorrection = 0.0; EmbeddedParameters->has_dispenserpresegmentwfcf = true; - EmbeddedParameters->dispenserpresegmentwfcf = 80; + EmbeddedParameters->dispenserpresegmentwfcf = 40; EmbeddedParameters->has_startheatingoninitsequence = true; EmbeddedParameters->startheatingoninitsequence = true; //set to true shlomo 14/5/2019 EmbeddedParameters->n_generalparameters = 8; @@ -252,7 +252,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters->has_idlemixertemperature = true; EmbeddedParameters->idlemixertemperature = 0; EmbeddedParameters->has_powerofftemperaturelimit = true; - EmbeddedParameters->powerofftemperaturelimit = 50; + EmbeddedParameters->powerofftemperaturelimit = 90; EmbeddedParameters->has_ids_presegment_wfcf_timebeforesegment = true; EmbeddedParameters->ids_presegment_wfcf_timebeforesegment = 20000; uint8_t* response_buffer = my_malloc(configuration_parameters__get_packed_size(EmbeddedParameters)); @@ -494,7 +494,7 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) } BlowerCfg.enabled = true; - BlowerCfg.voltage = 3000; + BlowerCfg.voltage = 2650; BlowerCfg.heatingvoltage = 3000; if (WHS_Type == WHS_TYPE_UNKNOWN) blowerType = HARDWARE_BLOWER_TYPE__WHSBlower2; diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.c b/Software/Embedded_SW/Embedded/Modules/General/buttons.c index 50fd0ad16..7326dc039 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/buttons.c +++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.c @@ -280,36 +280,57 @@ uint32_t ButtonJogCBFunction(uint32_t IfIndex, uint32_t ReadValue) case sttDISABLE: if (JobIsActive() == false) { + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: jog.state=sttDISABLE , JobIsActive() == false-----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); jog.color = colorON; Pannel_Leds(THREAD_JOGGING, MODE_ON); jog.state = sttENABLE; } break; case sttENABLE: - if (jog.Action == COUNTPB) + if (JobIsActive() == true) { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is sttENABLE and PRESS-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); jog.state = sttJOGGING; - jog.color = colorON; - jog.color = BLINK; - ThreadJoggingFunc(40); - jog.state = sttJOGGING; + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is Disable -----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); + jog.Action = OFFPB; + jog.color = colorOFF; + Pannel_Leds(THREAD_JOGGING,MODE_OFF); + jog.state = sttDISABLE; } else { - if (JobIsActive() == true) + if (jog.Action == COUNTPB) { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is Disable -----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); - jog.Action = OFFPB; - jog.color = colorOFF; - Pannel_Leds(THREAD_JOGGING,MODE_OFF); - jog.state = sttDISABLE; + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is sttENABLE and PRESS-----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); + jog.color = colorON; + jog.color = BLINK; + ThreadJoggingFunc(40); + jog.state = sttJOGGING; } } + +// if (jog.Action == COUNTPB) +// { +// ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is sttENABLE and PRESS-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); +// jog.color = colorON; +// jog.color = BLINK; +// ThreadJoggingFunc(40); +// jog.state = sttJOGGING; +// } +// else +// { +// if (JobIsActive() == true) +// { +// ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is Disable -----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); +// jog.Action = OFFPB; +// jog.color = colorOFF; +// Pannel_Leds(THREAD_JOGGING,MODE_OFF); +// jog.state = sttDISABLE; +// } +// } break; case sttJOGGING: if (jog.Action == SHORTPB) //PB is OFF { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttJOGGING action->SHORTPB-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); jog.state = sttJOGGING; + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttJOGGING action SHORTPB, sttJOGGING -> sttENABLE, stop JOGGING----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); ThreadAbortJoggingFunc(); jog.color = colorON; Pannel_Leds(THREAD_JOGGING, MODE_ON); @@ -317,26 +338,25 @@ uint32_t ButtonJogCBFunction(uint32_t IfIndex, uint32_t ReadValue) } else if (jog.Action == LONGPB) { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttJOGGING action->LONGPB-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); jog.state = sttJOGGING; + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttJOGGING action LONGPB, sttJOGGING -> sttLONG_JOGGING-----------------", __FILE__,__LINE__, jog.state, RpMessage, jog.Action, 0); jog.state = sttLONG_JOGGING; - if (JobIsActive() == false) // added because sometimes the jog stops because of another reason and the button s stucked blinking - { - jog.color = colorON; - Pannel_Leds(THREAD_JOGGING, MODE_ON); - jog.state = sttENABLE; - } - } break; case sttLONG_JOGGING: if (jog.Action == COUNTPB) { - ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttLONG_JOGGING action->COUNTPB-----------------", __FILE__,__LINE__,0, RpMessage, 0, 0); jog.state = sttJOGGING;ThreadAbortJoggingFunc(); // to do!!!! + ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: sttLONG_JOGGING action COUNTPB, sttLONG_JOGGING -> sttENABLE, stop JOGGING-----------------", __FILE__,__LINE__, jog.state, RpMessage, jog.Action, 0); ThreadAbortJoggingFunc(); jog.color = colorON; Pannel_Leds(THREAD_JOGGING, MODE_ON); jog.state = sttENABLE; } + if (JobIsActive() == false) // added because sometimes the jog stops because of another reason and the button s stucked blinking + { + jog.color = colorON; + Pannel_Leds(THREAD_JOGGING, MODE_ON); + jog.state = sttENABLE; + } break; default: break; @@ -556,7 +576,7 @@ return OK; uint32_t LoadStatMachine( button *pBtn) { - ReportWithPackageFilter(GeneralFilter,"------------ start loading -----------------", __FILE__,__LINE__,pBtn->state, RpMessage, pBtn->color, 0); + ReportWithPackageFilter(GeneralFilter,"------------ (state) (color) -----------------", __FILE__,__LINE__,pBtn->state, RpMessage, pBtn->color, 0); switch (pBtn->state) { case sttRDY : diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index 82f7e300f..290e65fa9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -1492,14 +1492,13 @@ uint32_t DrierHeaterVlotageSetup(double voltage) if (Head_Type > HEAD_TYPE_SYLKO_WITHOUT_CARD) //rapid/pp machines { DrierAcVoltage = ReadVAC(); - //if () } else { UseSecondaryDrierHeater = true; } - +return OK; } uint32_t HeatersControlLoop(uint32_t tick) { diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index 9ad8d485b..68da1317b 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -90,7 +90,11 @@ AutoHoming_Config_enum AutoHoming_Config = AutoHoming_off; void IDS_Dispenser_SetAutoHoming_Config(AutoHoming_Config_enum Config) { Report("IDS_Dispenser_SetAutoHoming_Config ",__FILE__,__LINE__,Config,RpWarning,AutoHoming_Config,0); +#ifdef SPECIAL_DISPENSERS + AutoHoming_Config = AutoHoming_off; +#else AutoHoming_Config = Config; +#endif } void IDS_Dispenser_SetBackLashValues(double initialdispenserpressure, uint32_t initialdispensertimeout, uint32_t initialdispensertimelag, uint32_t initialdispenserspeed) @@ -544,7 +548,8 @@ void IDS_Dispenser_Init(uint8_t DispenserId) PrimingActive[DispenserId]= false; Valve_Set(IDS_Id_to_AirValve[DispenserId], Atm_MidTank_OFF); Control3WayValvesWithCallback ((Valves_t)DispenserId, MidTank_Dispenser, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer +#ifdef SPECIAL_DISPENSERS if (ControlIdtoInactiveDispenserId[DispenserId] == 0xFF) ControlIdtoInactiveDispenserId[DispenserId] = AddControlCallback("IDS_Check_Pressure", IDS_Check_Pressure_Callback, eOneMinute,TemplateDataReadCBFunction ,DispenserId, 0, 0 ); - +#endif } diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 04abb6870..14718ab0e 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1033,6 +1033,8 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback); if (CurrentDispenserSpeed[CLEANER_DISPENSER]>0) IDS_Cleaning_Stop_Cleaning_Solution (NULL); setRapidPressureRead(false); + if (JobEndSequence == true) + DistanceToSpoolReady(Module_IDS,ModuleDone); } if (EnableCleaning == true) { @@ -1510,7 +1512,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) #else Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Head); #endif - //IDS_Cleaning_Stop_Cleaning_Solution(NULL); + IDS_Cleaning_Stop_Cleaning_Solution(NULL); SegmentNumOfBrushStops = Segment->n_brushstops; BrushStopTime = Segment->length*1000/(double)SegmentNumOfBrushStops; //brushstop in meters //brushstop in millisecond BrushStopTime = ((BrushStopTime*100)/dyeingspeed);//brushstop in seconds @@ -1537,7 +1539,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) if (DispenserPreSegmentControlId != 0xFF) { Report("IDS presegment not yet ended!!",__FILE__,__LINE__,(int)InterSegmentStepsCount,RpWarning,(int)lInterSegmentLength,0); - IDS_Cleaning_Stop_Cleaning_Solution (NULL); + //IDS_Cleaning_Stop_Cleaning_Solution (NULL); RemoveControlCallback(DispenserPreSegmentControlId, IDSPreSegmentStateCallbackRunner ); DispenserPreSegmentControlId = 0xFF; } @@ -1601,17 +1603,18 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) for (Dispenser_i = 0;Dispenser_i < MAX_DYE_DISPENSERS;Dispenser_i++) { DispenserDistanceToSpoolReady[Dispenser_i] = true; - if (DispenserUsedInJob[Dispenser_i]==false)//unconfigured dispenser - continue; - DispenserDistanceToSpoolReady[Dispenser_i] = false; -#ifdef SPECIAL_DISPENSERS - IDS_Dispenser_Close_Valve_And_Stop_Motor(Dispenser_i,NULL); -#else - MotorStop(DispenserIdToMotorId[Dispenser_i],Hard_Hiz); -#endif - Control3WayValvesWithCallback ((Valves_t)Dispenser_i, MidTank_Dispenser, IDS_Valve_DistanceToSpoolValveReady); //direction: MidTank_Dispenser or Dispenser_Mixer - CurrentDispenserSpeed[Dispenser_i] = 0; - //IDS_Dispenser_Close_Valve_And_Stop_Motor(Dispenser_i,IDS_Valve_DistanceToSpoolValveReady); + if (DispenserUsedInJob[Dispenser_i]==true)//unconfigured dispenser + { + DispenserDistanceToSpoolReady[Dispenser_i] = false; + #ifdef SPECIAL_DISPENSERS + IDS_Dispenser_Close_Valve_And_Stop_Motor(Dispenser_i,NULL); + #else + MotorStop(DispenserIdToMotorId[Dispenser_i],Hard_Hiz); + #endif + Control3WayValvesWithCallback ((Valves_t)Dispenser_i, MidTank_Dispenser, IDS_Valve_DistanceToSpoolValveReady); //direction: MidTank_Dispenser or Dispenser_Mixer + CurrentDispenserSpeed[Dispenser_i] = 0; + //IDS_Dispenser_Close_Valve_And_Stop_Motor(Dispenser_i,IDS_Valve_DistanceToSpoolValveReady); + } } //cleaning diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 76c6579da..677d3fa5f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -10,6 +10,7 @@ #include "Drivers/USB_Communication/USBCDCD.h" #include "StateMachines/Initialization/PowerOffSequence.h" +#include "StateMachines/Initialization/PowerIdle.h" #include "drivers/Flash_Memory/FATFS/ff.h" #include "drivers/Flash_Memory/FATFS/Control_File_System.h" @@ -116,7 +117,16 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) } //Trigger_WHS_Set_Volt_Blower_Control(request->delay); } else - if(request->amount == 0x3EA) + if (request->amount == 0x3E7) // set WHS Blower speed by Q value + { + if (WHS_Type == WHS_TYPE_NEW) + { + Trigger_WHS_Set_Blower_Control_Closed_Loop (request->delay); + response.progress = 0; + response.has_progress = true; + } //Trigger_WHS_Set_Volt_Blower_Control(request->delay); + } + else if(request->amount == 0x3EA) { uint16_t tempu16 = 0; if (WHS_Type == WHS_TYPE_NEW) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 4ab59ec19..128564586 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -1422,6 +1422,7 @@ uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer) MessageContainer responseContainer; MessageState = 2; Thread_Load_End(); + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,numberOfCycles); Report("StopThreadLoadingFunc",__FILE__,__LINE__,0xFF,RpWarning,(int)LoadStages,0); responseContainer = createContainer(MESSAGE_TYPE__StopThreadLoadingResponse, requestContainer->token, true, &Cresponse, &stop_thread_loading_response__pack, &stop_thread_loading_response__get_packed_size); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index ec705c2d2..fb3b78752 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -73,15 +73,14 @@ uint32_t MotorsConfigMessage(HardwareConfiguration * HWrequest) MotorsCfg[Motor_i].pulseperround = request->pulseperround; MotorsCfg[Motor_i].pulleyradius = request->pulleyradius; MotorsCfg[Motor_i].configword = request->configword; - MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize;//L6470 + L6472 -/* if(MotorDriverResponse[Motor_i].DriverType != CombinrdMotDriver) + if(MotorDriverResponse[Motor_i].DriverType == CombinrdMotDriver) { MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize ^ 1;//PowerSTEP01 } else { MotorsCfg[Motor_i].directionthreadwize = request->directionthreadwize;//L6470 + L6472 - }*/ + } MotorsCfg[Motor_i].kvalhold = request->kvalhold; MotorsCfg[Motor_i].kvalrun = request->kvalrun; MotorsCfg[Motor_i].kvalacc = request->kvalacc; -- cgit v1.3.1