diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-15 16:02:00 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-15 16:02:00 +0200 |
| commit | a614e97ebbb2b6ce557b6c428e3501bb1bcad626 (patch) | |
| tree | b8c73aae71ba5b8e38b93432d2b70222ed1a8b8b /Software/Embedded_SW/Embedded/Modules | |
| parent | aac4f633ac04ac5b1d134ce35981e8b898f5687e (diff) | |
| download | Tango-a614e97ebbb2b6ce557b6c428e3501bb1bcad626.tar.gz Tango-a614e97ebbb2b6ce557b6c428e3501bb1bcad626.zip | |
fix data rollover error
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 50d5f2093..003a2510a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -385,8 +385,12 @@ void Diagnostic100msecCollection(void) } void DiagnosticsReset(void) { + memset(DancerCounterIndex,0,sizeof(DancerCounterIndex)); + memset(MotorCounterIndex,0,sizeof(MotorCounterIndex)); + memset(DancerErrorCounterIndex,0,sizeof(DancerErrorCounterIndex)); + SpeedCounterIndex = 0; + memset(HeaterCounterIndex,0,sizeof(HeaterCounterIndex)); DiagnosticsIndex = 0; - } int j=0; MessageContainer diagnosticsresponseContainer; @@ -401,19 +405,13 @@ void SendDiagnostics(void) if (DiagnosticsActive == false) { - memset(DancerCounterIndex,0,sizeof(DancerCounterIndex)); - memset(MotorCounterIndex,0,sizeof(MotorCounterIndex)); - SpeedCounterIndex = 0; - memset(HeaterCounterIndex,0,sizeof(HeaterCounterIndex)); + DiagnosticsReset(); return; } if (SuspendLargeMessages == true) { LargeMessagesD++; - memset(DancerCounterIndex,0,sizeof(DancerCounterIndex)); - memset(MotorCounterIndex,0,sizeof(MotorCounterIndex)); - SpeedCounterIndex = 0; - memset(HeaterCounterIndex,0,sizeof(HeaterCounterIndex)); + DiagnosticsReset(); return; } @@ -474,9 +472,6 @@ void SendDiagnostics(void) DiagnosticsMonitor.n_windermotor = MotorCounterIndex[WINDER_MOTOR]; DiagnosticsMonitor.n_screwmotor = MotorCounterIndex[SCREW_MOTOR]; } - memset(DancerCounterIndex,0,sizeof(DancerCounterIndex)); - memset(MotorCounterIndex,0,sizeof(MotorCounterIndex)); - SpeedCounterIndex = 0; DiagnosticsMonitor.mixertemperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__MixerHeater]; DiagnosticsMonitor.headzone1temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1]; @@ -502,7 +497,6 @@ void SendDiagnostics(void) DiagnosticsMonitor.n_blowervoltage = 1; diagvoltage = getBlowerState(); DiagnosticsMonitor.blowervoltage = &diagvoltage; - memset(HeaterCounterIndex,0,sizeof(HeaterCounterIndex)); int i; DiagnosticsMonitor.n_dispensersmotorsfrequency = 0; |
