diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Communication/Connection.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Communication/Connection.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index 7f4efdd1b..af60541aa 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -26,6 +26,9 @@ #include "Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" #include "StateMachines/Printing/PrintingSTM.h" +#include "StateMachines/Initialization/InitSequence.h" +#include "StateMachines/Initialization/PowerOffSequence.h" +#include "Modules/General/MachineStatus.h" #include "Modules/heaters/heaters_ex.h" #include "modules/Diagnostics/Diagnostics.h" @@ -39,6 +42,20 @@ char HexToDecimal(char hex) int j = hex / 0x10; return j*10+i; } +bool KeepAliveActive = false; + +void StopRecurringReports(void) +{ + ReportStopReporting(); + DiagnosticsStop(); + JobStopReporting(); + AlarmHandlingStop(); + PowerUpStopReporting(); + MachineUpdateStopReporting(); + PowerDownStopReporting(); + + KeepAliveActive = false; +} void ConnectionRequest(MessageContainer* requestContainer) { MessageContainer responseContainer; @@ -66,10 +83,7 @@ void ConnectionRequest(MessageContainer* requestContainer) if (request->has_unixtime) utilsUpdateDateTime(request->unixtime);//(request->seconds); - ReportStopReporting(); - DiagnosticsStop(); - JobStopReporting(); - AlarmHandlingStop(); + StopRecurringReports(); /* extern TangoVersion_t _gTangoVersion; extern char Dat[50]; @@ -139,7 +153,6 @@ void DisconnectionRequest(MessageContainer* requestContainer) } int KeepAliveOneSecondCounter = 0; #define KEEPALIVE_COMMUNICATION_ABORT_LIMIT 10 -bool KeepAliveActive = false; bool keepalivetest = false; void KeepAliveRequestFunc(MessageContainer* requestContainer) { @@ -215,11 +228,7 @@ void KeepAliveOneSecondCall(void) Report("keepalive ",__FILE__,__LINE__,KeepAliveOneSecondCounter,RpWarning,msec_millisecondCounter, 0); //LOG_ERROR(KeepAliveOneSecondCounter, "Communication keepalive failed"); KeepAliveOneSecondCounter = 0; - KeepAliveActive = false; - ReportStopReporting(); - DiagnosticsStop(); - JobStopReporting(); - AlarmHandlingStop(); + StopRecurringReports(); CommunicationMailboxFlush(); keepalivetest = false; //USBCDCD_init(); |
