Files
WoodDrone/drv/iwdg.cpp
Dana Markova 0de214c9a1 first commit
2025-07-28 13:21:36 +03:00

19 lines
274 B
C++

#include "stm32g4xx.h"
#include "iwdg.h"
void InitIWDG(unsigned short Reload)
{
IWDG->KR=0x0000CCCC;
IWDG->KR=0x00005555;
IWDG->PR=0;
IWDG->RLR=Reload;
while(IWDG->SR) { asm volatile("NOP"); }
IWDG->KR=0x0000AAAA;
}
void PingIWDG()
{
IWDG->KR=0x0000AAAA;
}