24 const float watchdog_LSI_period = 1/40.0f;
34 reloadValue = timeoutms/(watchdog_LSI_period * 4) -1;
36 else if(timeoutms < 800){
40 reloadValue = timeoutms/(watchdog_LSI_period * 8) -1;
42 else if(timeoutms < 1600){
46 reloadValue = timeoutms/(watchdog_LSI_period * 16) -1;
48 else if(timeoutms < 3200){
52 reloadValue = timeoutms/(watchdog_LSI_period * 32) -1;
54 else if(timeoutms < 6500){
58 reloadValue = timeoutms/(watchdog_LSI_period * 64) -1;
60 else if(timeoutms < 13000){
64 reloadValue = timeoutms/(watchdog_LSI_period * 128) -1;
66 else if(timeoutms < 26000){
70 reloadValue = timeoutms/(watchdog_LSI_period * 256) -1;
90 IWDG_RLR = reloadValue;
100 if(RCC_CSR & 0x20000000){
103 RCC_CSR |= 0x1000000;
Header file for stm32f103cb independant watchdog timer.
Error IWDG: Period too long.
void MCU_printError(mcu_error errorNum)
Print a given error number as a character stream.
uint8_t MCU_debugIsEnabled(void)
Checks if debug is enabled.
void IWDG_feed(void)
Reload the watchdog timer.
mcu_error IWDG_setup(uint32_t timeoutms)
Initialize the independant watchdog timer.
bool IWDG_resetCheck(void)
Check if reset occured from watchdog timeout.
mcu_error
Error enumerators for the Debug peripheral.