#include "Fwdgt.h" #include "stdint.h" #include "gd32e230x_conf.h" void Fwdgt_Init(void) { uint16_t timeout = 0xFFFFU; rcu_osci_on(RCU_IRC40K); while(SUCCESS != rcu_osci_stab_wait(RCU_IRC40K)) { if(timeout > 0) timeout--; else break; } fwdgt_config(2000,FWDGT_PSC_DIV64); //3.2s fwdgt_write_disable(); fwdgt_enable(); } void DelFwdgt(void) { //fwdgt_disable(); rcu_osci_off(RCU_IRC40K); } void Fwdgt_reload(void) { fwdgt_write_enable(); fwdgt_counter_reload(); }