First draft of safety controller

This commit is contained in:
2020-07-27 21:29:15 +02:00
parent a04e894518
commit 4f3016649d
6 changed files with 41 additions and 8 deletions

View File

@@ -105,4 +105,16 @@ int watchdog_ack(uint32_t magic)
return ret;
}
bool watchdog_check_reset_source(void)
{
bool ret;
ret = !!(RCC->CSR & RCC_CSR_WDGRSTF);
if (ret)
RCC->CSR |= RCC_CSR_RMVF;
return ret;
}
/** @} */