aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Communication/Connection.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-11-02 20:51:54 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-11-02 20:51:54 +0200
commit612f456f46ebf6726dd1aa2b0fe1476a72011d3a (patch)
tree4aefd66294a22fb2b2da0917648e12f2d2168f16 /Software/Embedded_SW/Embedded/Communication/Connection.c
parent2a8d3d38bd80fe011f8e6921742574b2ff71fa72 (diff)
downloadTango-612f456f46ebf6726dd1aa2b0fe1476a72011d3a.tar.gz
Tango-612f456f46ebf6726dd1aa2b0fe1476a72011d3a.zip
fix connection loss (stop sending startup message to PPC)
Diffstat (limited to 'Software/Embedded_SW/Embedded/Communication/Connection.c')
-rw-r--r--Software/Embedded_SW/Embedded/Communication/Connection.c29
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();