soft_wdt.c 379 B

1234567891011121314151617181920212223242526272829
  1. #include "at32f403a_407.h"
  2. #include "soft_wdt.h"
  3. #include "FreeRTOS.h"
  4. #include "task.h"
  5. #include "common_gpio.h"
  6. bool wdt_stop = false;
  7. //
  8. void soft_wdt_dtop(bool value)
  9. {
  10. wdt_stop = value;
  11. }
  12. //
  13. void soft_wdt(void *params)
  14. {
  15. (void)params;
  16. for (;;)
  17. {
  18. if (!wdt_stop)
  19. extern_wdt_togle(); // extern WDT
  20. vTaskDelay(100);
  21. }
  22. }