aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index 0f9848ba1..26fba0194 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -170,6 +170,7 @@ void ControlStop(void)
ControlRestart = false;
ADCAcquireStop();
}
+int FPGA_ReInit_Count = 0; ///avoid too many reinitializations of motors as happens when FPGA is corrupted
uint32_t ControlActivityLed( uint32_t Parameter1)
{
static bool flag = false;
@@ -192,11 +193,14 @@ uint32_t ControlActivityLed( uint32_t Parameter1)
SendJobProgress(0.0,0,false, "Hardware Failure Error");
AbortJob("FPGA Watchdog Error");
}
- ReportWithPackageFilter(FPGAFilter, "FPGA Watchdog Error",__FILE__,__LINE__,0,RpError, 0,0);
+ if (FPGA_ReInit_Count++<20)
+ {
+ ReportWithPackageFilter(FPGAFilter, "FPGA Watchdog Error",__FILE__,__LINE__,0,RpError, 0,0);
- ACTIVITY_GREEN_LED_ON;
- FPGA_SetMotorsInit();
- Motor_ReconfigAllMotors();
+ ACTIVITY_GREEN_LED_ON;
+ FPGA_SetMotorsInit();
+ Motor_ReconfigAllMotors();
+ }
}
}
else