diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c | 9 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/control.c | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index d366e8832..ad5a1d5ca 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -544,8 +544,12 @@ int MillisecCalculateTemperatures (TEMPERATURE_SENSOR_ID_ENUM SensorId) calc = TemperatureSum[SensorId] / (TemperatureCount[SensorId]-2); if (TemperatureSum[SensorId]>10) { + if(abs(TemperatureMax[SensorId]-TemperatureMin[SensorId])>2000) + { + if ((Head_Type == HEAD_TYPE_FLAT_WITHOUT_CARD)||(SensorId!=TEMP_SENSE_AN_ENCLOSURETEMP3)) Report("Millisec Temp spike",__FILE__,SensorId,(int)TemperatureMax[SensorId],RpWarning,(int) TemperatureMin[SensorId],0); + } } TemperatureSum[SensorId] = 0; TemperatureCount[SensorId] = 0; @@ -645,7 +649,6 @@ uint32_t MillisecLowLoop(uint32_t tick) //Screw_ENC_Velocity_to_DAC(); - for testing the screw enc if (Head_Type > HEAD_TYPE_FLAT_WITHOUT_CARD) StartPT100 = TEMP_SENSE_ANALOG_DRYER_TEMP1; - if (Ten_msTick) { //Speed_Data = Read_Speed_Sensor_TypeII(); @@ -821,6 +824,10 @@ uint32_t MillisecLowLoop(uint32_t tick) if (Head_Type == HEAD_TYPE_ARC) { HeadBlowersControlLoop(); } + else + { + FlatHeadAlarms(); + } //call waste state machine Waste_StateMachine_OneSecond_Call(); diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index e02bd8191..e6da43178 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -83,6 +83,7 @@ typedef struct DataReadCBFunction ControlDataReadPtr; ControlCBFunction ControlCallbackPtr; uint32_t ControlTiming; + uint32_t LastCalled; char *Name; }ControlDeviceStruc; @@ -613,10 +614,13 @@ uint32_t ControlLowLoop(uint32_t tick) { if (tick - ControlArray[ControlLowDevice_i].StartTick<=skipped_ticks) continue; + if (tick - ControlArray[ControlLowDevice_i].LastCalled<=skipped_ticks) + continue; if (ControlArray[ControlLowDevice_i].ControlTiming == eOneMillisecond) continue; if (ControlArray[ControlLowDevice_i].StartTick == tick) continue; + ControlArray[ControlLowDevice_i].LastCalled = tick; if (((tick - ControlArray[ControlLowDevice_i].StartTick)%ControlArray[ControlLowDevice_i].ControlTiming)<=skipped_ticks) // run the control on exact intervals { |
