| 12345678910111213141516171819202122232425262728293031 |
- #include "Fwdgt.h"
- #include "stdint.h"
- #include "gd32f30x_libopt.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); //800ms
- fwdgt_write_disable();
- fwdgt_enable();
- }
- void Fwdgt_reload(void)
- {
- fwdgt_write_enable();
- fwdgt_counter_reload();
- }
|