"Blip" with trigger error on several boards #4552

exploratory watchdog
This commit is contained in:
rusefillc 2022-09-09 18:27:16 -04:00
parent e89f553d55
commit a3d86c61f2
4 changed files with 20 additions and 0 deletions

View File

@ -451,6 +451,21 @@ void Engine::efiWatchdog() {
return;
}
if (engine->configBurnTimer.hasElapsedSec(5) && engineConfiguration->tempBooleanForVerySpecialLogic) {
static float mostRecentSecond = 0;
float secondsNow = currentTimeMillis();
if (mostRecentSecond != 0) {
float gapInSeconds = secondsNow - mostRecentSecond;
if (gapInSeconds > 0.5) {
// float has 24 bits in the mantissa, which should allow up to 8 significant figures
// we loose precision here after about 1,000,000 seconds which is 11 days
firmwareError(WATCH_DOG_SECONDS, "gap in seconds %f %f", secondsNow, gapInSeconds);
}
}
mostRecentSecond = secondsNow;
}
if (!isSpinning) {
if (!isRunningBenchTest() && enginePins.stopPins()) {
// todo: make this a firmwareError assuming functional tests would run

View File

@ -285,6 +285,8 @@ public:
*/
efitick_t ignitionOnTimeNt = 0;
Timer configBurnTimer;
/**
* This counter is incremented every time user adjusts ECU parameters online (either via rusEfi console or other
* tuning software)

View File

@ -2135,6 +2135,8 @@ typedef enum {
CUSTOM_ERR_CAN_COMMUNICATION = 8900,
WATCH_DOG_SECONDS = 8901,
CUSTOM_ERR_TRIGGER_SYNC = 9000,
CUSTOM_OBD_TRIGGER_WAVEFORM = 9001,

View File

@ -154,6 +154,7 @@ int eraseAndFlashCopy(flashaddr_t storageAddress, const TStorage& data) {
bool burnWithoutFlash = false;
void writeToFlashNow(void) {
engine->configBurnTimer.reset();
bool isSuccess = false;
if (burnWithoutFlash) {