persistedValue(timeoutInterval),
enabled(false),
resetEnabled(false),
- intRaised(false),
writeAccessEnabled(true),
integrationTestEnabled(false),
timeoutEvent([this] { timeoutExpired(); }, name())
warn("Sp805::read: WO reg (0x%x) [WDOGINTCLR]\n", addr);
break;
case WDOGRIS:
- resp = intRaised;
+ resp = interrupt->active();
break;
case WDOGMIS:
- resp = intRaised & enabled;
+ resp = interrupt->active() && enabled;
break;
case WDOGLOCK:
resp = writeAccessEnabled;
{
// If the previously sent interrupt has not been served,
// assert system reset if enabled
- if (intRaised & enabled) {
+ if (interrupt->active() && enabled) {
if (resetEnabled)
warn("Watchdog timed out, system reset asserted\n");
} else {
- intRaised = true;
interrupt->raise();
}
}
void
Sp805::clearInt()
{
- intRaised = false;
interrupt->clear();
}
SERIALIZE_SCALAR(persistedValue);
SERIALIZE_SCALAR(enabled);
SERIALIZE_SCALAR(resetEnabled);
- SERIALIZE_SCALAR(intRaised);
SERIALIZE_SCALAR(writeAccessEnabled);
SERIALIZE_SCALAR(integrationTestEnabled);
UNSERIALIZE_SCALAR(persistedValue);
UNSERIALIZE_SCALAR(enabled);
UNSERIALIZE_SCALAR(resetEnabled);
- UNSERIALIZE_SCALAR(intRaised);
UNSERIALIZE_SCALAR(writeAccessEnabled);
UNSERIALIZE_SCALAR(integrationTestEnabled);