aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-05 16:53:33 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-05 16:53:33 +0300
commit2800ef294e92c6181c47ecf5bd556fcb25dc62ce (patch)
treebdf7d339b24bfe3fa6b64c5d42c8d34e8f1e1aef /Software/Embedded_SW/Embedded/Modules
parentdbb891b4456d3aff7b944302e363dad9b19a24c6 (diff)
parent65a9b21dce5cdb5e42b927e4cafd271432338b7c (diff)
downloadTango-2800ef294e92c6181c47ecf5bd556fcb25dc62ce.tar.gz
Tango-2800ef294e92c6181c47ecf5bd556fcb25dc62ce.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h2
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c53
3 files changed, 54 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h
index 7282974e6..ca46bf93b 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h
@@ -71,4 +71,6 @@ uint32_t HeaterRecalculateSharedHeatersParams(uint32_t deviceId, uint32_t new_ou
void HeatingTestSendResonse(uint32_t status, bool last,bool heater1Active,bool heater2Active, int temperature1, int temperature2,int Heater1Percentage,int Heater2Percentage, char* Message);
uint32_t HeaterRecalculateHeaterParams(uint32_t deviceId, uint32_t new_outputproportionalpowerlimit);
+uint32_t HeatersSingleHeaterEnd(HardwarePidControlType HeaterId);
+
#endif
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
index 962f9b651..6fd9fd8d8 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h
@@ -10,6 +10,8 @@ uint32_t HeaterCommandRequestMessage(int HeaterId, bool OnOff, int Temperature)
void HeatingTestRequest(MessageContainer* requestContainer);
void HeatingTestPollRequest(MessageContainer* requestContainer);
+bool HeaterCheckReady(void);
+
bool HeaterGetOverTemperatureState(uint8_t HeaterId);
uint32_t HeatersEnd(void);
diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
index b893be716..0f477a66f 100644
--- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c
@@ -47,7 +47,7 @@ uint32_t ControlIdtoHeaterId [MAX_HEATERS_NUM] = {0xFF,0xFF,0xFF,0xFF,0xFF,0x
uint32_t DryerHeaterMaxTempControl = 0xFF;
#warning the PT100 id for the dryer control is number2 - dryer internal ambient sensor.
#warning the PT100 for head 4 is number 5
-uint32_t HeaterId2PT100Id[MAX_HEATERS_NUM] = {TEMP_SENSE_ANALOG_DRYER_TEMP2,TEMP_SENSE_ANALOG_DRYER_TEMP1,TEMP_SENSE_ANALOG_DRYER_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,TEMP_SENSE_AN_ENCLOSURETEMP3,TEMP_SENSE_ANALOG_MIXCHIP_TEMP};
+uint32_t HeaterId2PT100Id[MAX_HEATERS_NUM] = {TEMP_SENSE_ANALOG_DRYER_TEMP2,TEMP_SENSE_ANALOG_DRYER_TEMP1,TEMP_SENSE_ANALOG_DRYER_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP1,TEMP_SENSE_ANALOG_DYEINGH_TEMP2,TEMP_SENSE_ANALOG_DYEINGH_TEMP3,TEMP_SENSE_ANALOG_DYEINGH_TEMP5,TEMP_SENSE_ANALOG_MIXCHIP_TEMP,TEMP_SENSE_ANALOG_MIXCHIP_TEMP};
uint32_t DryerInternalPT100Id = TEMP_SENSE_ANALOG_DRYER_TEMP1;
bool HeatersRestart = false;
@@ -112,13 +112,46 @@ void HeatersControlStart(void)
HeatersRestart = true;
HeatersStartControlTimer();
}
+uint32_t HeatersSingleHeaterEnd(HardwarePidControlType HeaterId)
+{
+ int status = OK;
+ if (HeaterId > HARDWARE_PID_CONTROL_TYPE__DryerHeater200w2) //DC Heaters
+ {
+ if (ControlIdtoHeaterId [HeaterId]!=0xFF)
+ {
+ status |= RemoveControlCallback(ControlIdtoHeaterId [HeaterId], DCHeaterControlCBFunction);
+ ControlIdtoHeaterId [HeaterId]=0xFF;
+ }
+ }
+ else if (HeaterId < HARDWARE_PID_CONTROL_TYPE__DryerHeater200w2) //AC Heaters
+ {
+ if (ControlIdtoHeaterId [HeaterId]!=0xFF)
+ {
+ status |=RemoveControlCallback(ControlIdtoHeaterId [HeaterId] ,HeaterControlCBFunction);
+ ControlIdtoHeaterId [HeaterId]=0xFF;
+ }
+ }
+ if (HeaterId == HARDWARE_PID_CONTROL_TYPE__DryerHeater1000w) //DC Heaters
+ if (DryerHeaterMaxTempControl)
+ {
+ status |=RemoveControlCallback(DryerHeaterMaxTempControl ,HeaterMaxTempCBFunction);
+ DryerHeaterMaxTempControl=0xFF;
+ }
+ DeActivateHeater(HeaterId);
+ return status;
+
+}
+
uint32_t HeatersEnd(void)
{
- int i,status = OK;
+ HardwarePidControlType i;
+ uint32_t status = OK;
HeatersControlStop();
for (i=0;i<MAX_HEATERS_NUM;i++)
{
+ status = HeatersSingleHeaterEnd(i);
+ /*
if (i > HARDWARE_PID_CONTROL_TYPE__DryerHeater200w2) //DC Heaters
{
if (ControlIdtoHeaterId [i]!=0xFF)
@@ -139,9 +172,10 @@ uint32_t HeatersEnd(void)
if (DryerHeaterMaxTempControl)
{
status |=RemoveControlCallback(DryerHeaterMaxTempControl ,HeaterMaxTempCBFunction);
- ControlIdtoHeaterId [i]=0xFF;
+ DryerHeaterMaxTempControl=0xFF;
}
DeActivateHeater(i);
+ */
}
return status;
@@ -218,6 +252,7 @@ uint32_t HeaterCommandRequestMessage(int HeaterId, bool OnOff, int Temperature)
else if ((HeaterState == HEATER_ON)&& (OnOff == HEATER_OFF)) //stop heating
{
//turn off the heater
+ HeatersSingleHeaterEnd(HeaterId);
//stop the control
HeaterPIDConfig[HeaterId].m_SetParam = HeaterId;
}
@@ -270,6 +305,18 @@ uint32_t PrepareHeater(int HeaterId, uint32_t SetTemperatue)
return OK;
}
+bool HeaterCheckReady(void)
+{
+ int i;
+ for (i=0;i<MAX_HEATERS_NUM;i++)
+ {
+ if (HeaterReady[i] == false)
+ {
+ return false; //not all configured heaters are ready
+ }
+ }
+ return true;
+}
void HeaterPrepareReady(void)
{
int i;