From a259d2e0ee5e28237f967f1683cc0b9c2a295c27 Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Sun, 12 May 2019 14:35:16 +0300 Subject: Add stub to read dispenser type + LS status --- Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index c6f2526db..c3b94c01f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -25,6 +25,12 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) ProgressResponse response = PROGRESS_RESPONSE__INIT; + if((request->amount == 0xDE) && (request->delay < 8) && (request->delay >= 0)) // read dispenser type + LS status + { + response.progress = ((Dispenser_struct[request->delay].Type) << 8) + Dispenser_struct[request->delay].Status; + response.has_progress = true; + } + else if((request->amount == 0xCF) && (request->delay == 0xCF)) //Create File System on the Drive { FRESULT iFResult = Init_Flash_File_System(true); -- cgit v1.3.1 From 092660c6bb1a30856ae03241ceb63faac8f59a57 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 12 May 2019 18:17:09 +0300 Subject: Version 1.3.9.12 keep alive related changes, + faster dispenser init --- .../Embedded_SW/Embedded/Common/SW_Info/SW_Info.c | 2 +- .../Embedded/Common/report/distributor.c | 5 ++++ .../Embedded/Communication/Connection.c | 9 ++++-- .../Embedded/Modules/Control/MillisecTask.c | 34 +++++++++++++++++----- .../Embedded/Modules/Control/MillisecTask.h | 1 + .../Embedded/Modules/General/GeneralHardware.c | 1 + .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 9 ++++-- .../Embedded/Modules/Thread/Thread_Winder.c | 4 +-- .../StateMachines/Initialization/InitSequence.c | 2 +- .../Embedded/StateMachines/Printing/JobSTM.c | 6 ++-- 10 files changed, 53 insertions(+), 20 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') 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 81a34b7ac..bb9972f9b 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,3,9,10}; +TangoVersion_t _gTangoVersion = {1,3,9,12}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; char _gTangoName [MAX_STRING_LEN] = "Tango01 ";//d diff --git a/Software/Embedded_SW/Embedded/Common/report/distributor.c b/Software/Embedded_SW/Embedded/Common/report/distributor.c index f011653ec..84a49fde3 100644 --- a/Software/Embedded_SW/Embedded/Common/report/distributor.c +++ b/Software/Embedded_SW/Embedded/Common/report/distributor.c @@ -618,6 +618,11 @@ STATUS ReportFunc(ReportFunction func, uint32_t SwitchAddRemove, DistributorHand } if (SwitchAddRemove == REPORT_ADD) { + if ((ReportFunc1 == func)||(ReportFunc2 == func)) + { + return OK; + } + if (ReportFunc1 == NULL) { ReportFunc1 = func; diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index 1d9f43cd1..3063e1ebe 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -146,11 +146,12 @@ void KeepAliveOneSecondCall(void) if (KeepAliveActive == false) return; KeepAliveOneSecondCounter++; - if (KeepAliveOneSecondCounter > KEEPALIVE_COMMUNICATION_ABORT_LIMIT) + if (KeepAliveOneSecondCounter > 5) { - LOG_ERROR(KeepAliveOneSecondCounter, "Communication keepalive failed"); + Report("keepalive ",__FILE__,__LINE__,KeepAliveOneSecondCounter,RpWarning,msec_millisecondCounter, 0); + //LOG_ERROR(KeepAliveOneSecondCounter, "Communication keepalive failed"); KeepAliveOneSecondCounter = 0; - KeepAliveActive = false; + /*KeepAliveActive = false; ReportStopReporting(); DiagnosticsStop(); JobStopReporting(); @@ -158,5 +159,7 @@ void KeepAliveOneSecondCall(void) //CommunicationMailboxFlush(); USBCDCD_Reinit(); //UART_ResetBuffers(); + * + */ } } diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 916d33772..cb1be7fa5 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -477,6 +477,11 @@ int MillisecGetTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId) { return TemperatureCalc[SensorId]; } +bool RapidPressureRead = false; +void setRapidPressureRead(bool value) +{ + RapidPressureRead = value; +} uint32_t MillisecLowLoop(uint32_t tick) { uint8_t Motor_i,Disp_i,Heater_i,temp; @@ -528,24 +533,36 @@ uint32_t MillisecLowLoop(uint32_t tick) //LOG_ERROR (1111, "Control_WD"); } } + if (RapidPressureRead == true) + { + for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + { + CalculateDispenserPressure(Disp_i); + //Read_MidTank_Pressure_Sensor(Disp_i); + } + ADC_TriggerCollection(); + } } - if (O900Millisecond_Tick) + if ((O900Millisecond_Tick)&&(RapidPressureRead == false)) { ADC_TriggerCollection(); } if (Onesecond_Tick) { - for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + if (RapidPressureRead == false) { - CalculateDispenserPressure(Disp_i); - //Read_MidTank_Pressure_Sensor(Disp_i); + for (Disp_i = 0;Disp_i < MAX_SYSTEM_DISPENSERS;Disp_i++) + { + CalculateDispenserPressure(Disp_i); + //Read_MidTank_Pressure_Sensor(Disp_i); + } } FPGA_GetAllDispensersValveBusyOCD(); temp = Read_Fans_Tacho(); DrawerFansStatus = temp & 0x1F; SystemFansStatus = temp & 0xE0; - KeepAliveOneSecondCall(); + //KeepAliveOneSecondCall(); for (Motor_i = 0;Motor_i < NUM_OF_MOTORS;Motor_i++) { if (Motor_i == HARDWARE_MOTOR_TYPE__MOTO_SCREW) @@ -553,9 +570,12 @@ uint32_t MillisecLowLoop(uint32_t tick) if (isMotorConfigured(Motor_i)) MotorGetStatusFromFPGA(Motor_i); } - for (Heater_i = 0;Heater_i < NUM_OF_CURRENT_HEATERS;Heater_i++) + if (!(OneMinute_Tick)) { - Read_Heaters_Current(Heater_i); + for (Heater_i = 0;Heater_i < NUM_OF_CURRENT_HEATERS;Heater_i++) + { + Read_Heaters_Current(Heater_i); + } } Gas_PPM = Calculate_Gas_Power_Consumption(); for (Sensor_i = 0;Sensor_i < MAX_TEMPERATURE_SENSOR_ID;Sensor_i++) diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h index be82d9e98..4edc1a8ed 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.h @@ -34,6 +34,7 @@ uint32_t getDrawerFansStatus(void); uint32_t getSystemFansStatus(void); uint8_t getGasReading(void); int MillisecGetTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId); +void setRapidPressureRead(bool value); void MillisecInit(void); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index f0edc56ab..781a48692 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -273,6 +273,7 @@ uint32_t HWConfiguration(UploadHardwareConfigurationRequest* UploadRequest) if (JobIsActive()) { + LOG_ERROR(1,"JobIsActive"); return ERROR; } if (watchdogCriticalAlarm == true) diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index cd748fd5c..40591a76d 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -553,6 +553,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. double PrepeareSpeed = 0; int NumOfActiveDispensers = 0; int DispenserBuildTimeCounter = 0; +#define PRESSURE_READ_TIME_GAP 100 //******************************************************************************************************************** uint32_t IDS_Prepare_Callback(uint32_t DispenserId, uint32_t ReadValue) { @@ -561,7 +562,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. int NumofReadyDispensers = 0; //REPORT_MSG((int)DispenserPrepareControlId, "Prepare Callback"); - DispenserBuildTimeCounter+=500; + DispenserBuildTimeCounter+=PRESSURE_READ_TIME_GAP; if (DispenserBuildTimeCounter<(2*eOneSecond)) { @@ -578,7 +579,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. } } - if (NumofReadyDispensers) + if ((NumofReadyDispensers)&&(DispenserBuildTimeCounter%10 == 0)) Report("IDS_Prepare_Callback",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); if (NumofReadyDispensers>=NumOfActiveDispensers) @@ -587,6 +588,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. if ((DispenserBuildTimeCounter >= DispenserPrepareTimeout)||(pressureReady == true)) { SafeRemoveControlCallback(DispenserPrepareControlId, IDS_Prepare_Callback ); + setRapidPressureRead(false); //DispenserPrepareReady(); PrepareReady(Module_IDS,ModuleDone); } @@ -679,7 +681,8 @@ c. Go to step 2.a x Segment.BrushStopsCount. } } DispenserBuildTimeCounter = 0; - DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, 500,TemplateDataReadCBFunction ,0, 0, 0 ); + DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, PRESSURE_READ_TIME_GAP,TemplateDataReadCBFunction ,0, 0, 0 ); + setRapidPressureRead(true); } //******************************************************************************************************************** diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index df88db3f9..06597ee84 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -289,7 +289,7 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) WinderReferenceSpeed = Averagewinderspeed; } screw_horizontal_speed = ScrewNumberOfSteps / Rotations;//InternalWinderCfg.NumberOfRotationPerPassage; - if (Rotations > 7.0) + if (Rotations > 6.4)//7.0) Rotations = 6.0; RotationsPerSecond = WinderReferenceSpeed / (double)MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_WINDER].pulseperround; tempScrewSpeed = screw_horizontal_speed*RotationsPerSecond; @@ -479,7 +479,7 @@ void ScrewTimerInterrupt(int ARG0) TimerDisable(Screw_timerBase, TIMER_A); } ROM_IntMasterEnable(); - Rotations+=0.03; + Rotations+=0.005; return ; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index eb36dae1a..05606faff 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -118,7 +118,7 @@ void InitSequenceResetReason(void) */ RESET_Cause = SysCtlResetCauseGet (); LOG_ERROR(RESET_Cause,"Reset Reason Register"); - SysCtlResetCauseClear(RESET_Cause); + //SysCtlResetCauseClear(RESET_Cause); InitStages++; //InitSequenceStateMachine(InitStages); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 66473a3f8..3da59e412 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -183,7 +183,7 @@ static ReturnCode PrepareState(void *JobDetails) if (Configured[Module_IDS]) { PrepareWaiting[Module_IDS] = ModuleWaiting; - REPORT_MSG(Module_IDS,"Dispenser prepare waiting"); +// REPORT_MSG(Module_IDS,"Dispenser prepare waiting"); } if (Configured[Module_Thread]) { @@ -203,7 +203,7 @@ static ReturnCode PrepareState(void *JobDetails) //check thread type if (Configured[Module_IDS]) { - REPORT_MSG(Module_IDS,"Dispenser prepare called"); + //REPORT_MSG(Module_IDS,"Dispenser prepare called"); IDSPrepareState(JobDetails); } /* if (Configured[Module_Heaters]) @@ -647,7 +647,7 @@ void JobRequestFunc(MessageContainer* requestContainer) usnprintf(ErrorMsg, 100, "Hardware Parameters Not Set"); } } - REPORT_MSG(0,"Process parameters in job request are not handled. push separately for now"); + //REPORT_MSG(0,"Process parameters in job request are not handled. push separately for now"); if (Ticket->spool) { if (InternalWindingConfigMessage(Ticket->spool)!= OK) -- cgit v1.3.1