1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-26 17:46:14 +01:00

While verifying with real hardware, added micros() into the logs for ScheduledPin

This commit is contained in:
Sergei Kotlyachkov 2023-11-10 23:47:20 -05:00
parent a30311caed
commit 6e9a3ebfb4

View File

@ -65,7 +65,7 @@ protected:
addDevice(this, controlledDevice); addDevice(this, controlledDevice);
} }
else { else {
DIAG(F("ScheduledPin Controlled device not found for pin:%d"), pin); DIAG(F("ScheduledPin Controlled device not found for VPIN:%d"), pin);
_deviceState = DEVSTATE_FAILED; _deviceState = DEVSTATE_FAILED;
} }
} }
@ -88,7 +88,7 @@ protected:
return; return;
} }
#ifdef DIAG_IO #ifdef DIAG_IO
DIAG(F("ScheduledPin Write VPIN:%u Value:%d"), vpin, value); DIAG(F("ScheduledPin Write VPIN:%u Value:%d Micros:%l"), vpin, value, micros());
#endif #endif
unsigned long currentMicros = micros(); unsigned long currentMicros = micros();
delayUntil(currentMicros + _durationMicros); delayUntil(currentMicros + _durationMicros);
@ -99,7 +99,7 @@ protected:
void _loop(unsigned long currentMicros) { void _loop(unsigned long currentMicros) {
if (_deviceState == DEVSTATE_FAILED) return; if (_deviceState == DEVSTATE_FAILED) return;
#ifdef DIAG_IO #ifdef DIAG_IO
DIAG(F("ScheduledPin Write VPIN:%u Value:%d"), _firstVpin, _scheduledValue); DIAG(F("ScheduledPin Bounce VPIN:%u Value:%d Micros:%l"), _firstVpin, _scheduledValue, micros());
#endif #endif
ArduinoPins::fastWriteDigital(_firstVpin, _scheduledValue); ArduinoPins::fastWriteDigital(_firstVpin, _scheduledValue);
delayUntil(currentMicros + 0x7fffffff); // Largest time in the future! Effectively disable _loop calls. delayUntil(currentMicros + 0x7fffffff); // Largest time in the future! Effectively disable _loop calls.
@ -107,8 +107,8 @@ protected:
// Display information about the device, and perhaps its current condition (e.g. active, disabled etc). // Display information about the device, and perhaps its current condition (e.g. active, disabled etc).
void _display() { void _display() {
DIAG(F("ScheduledPin Configured:%u value=%d duration=%ld"), (int)_firstVpin, DIAG(F("ScheduledPin Configured:%u Value:%d Duration:%l"), (int)_firstVpin,
(int)_firstVpin, _scheduledValue, _durationMicros); _scheduledValue, _durationMicros);
} }
}; };