aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/StateMachines/Initialization
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/StateMachines/Initialization')
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
index 20780b8c1..92f22b0ac 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c
@@ -222,6 +222,7 @@ double MainCurrent,SecondaryCurrent,StableCurrent;
double InitDrierAcVoltage = 0.0;
int InitDrierAcVoltageCount = 0;
double Zone2Resistance = 0.0;
+int WaitForCurrentRaise = 0;//let the heater current raise
void InitCurrentReadingStable(void)
{
memset(Heater_Current,0,sizeof(Heater_Current));
@@ -229,8 +230,9 @@ void InitCurrentReadingStable(void)
count_Heater_Current = 0;
Maxcount_Heater_Current = 0;
StableCurrent = 0.0;
+ WaitForCurrentRaise = 0;
}
-
+#define MaxStabilization 10
bool DetectIfCurrentReadingStable(double HeaterCurrent)
{
bool ret = false;
@@ -268,6 +270,8 @@ uint32_t PowerManagementCallBack(uint32_t IfIndex, uint32_t BusyFlag)
{
ReportWithPackageFilter(InitFilter,"PowerManagementCallBack", __FILE__,MainHeaterStable,(int)(SecondaryHeaterStable), RpMessage, Maxcount_Heater_Current, 0);
ReportWithPackageFilter(InitFilter,"PowerManagementCallBack", __FILE__,GetHeaterState(HEATER_TYPE__DryerMainHeater),(int)(GetHeaterState(HEATER_TYPE__DryerSecondaryHeater)), RpMessage, Maxcount_Heater_Current, 0);
+ if (WaitForCurrentRaise++ < MaxStabilization)
+ return OK;
if ((MainHeaterStable == false)&&(Maxcount_Heater_Current<CURRENT_READING_ERROR_UNSTABLE))
{