watchdog.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * =====================================================================================
  3. *
  4. * .d8888b 88888b. .d88b. .d8888b 888d888 8888b. 88888b.d88b.
  5. * 88K 888 "88b d8P Y8b 88K 888P" "88b 888 "888 "88b
  6. * "Y8888b. 888 888 88888888 "Y8888b. 888 .d888888 888 888 888
  7. * X88 888 888 Y8b. X88 888 888 888 888 888 888
  8. * 88888P' 888 888 "Y8888 88888P' 888 "Y888888 888 888 888
  9. *
  10. * www.optixx.org
  11. *
  12. *
  13. * Version: 1.0
  14. * Created: 07/21/2009 03:32:16 PM
  15. * Author: david@optixx.org
  16. *
  17. * =====================================================================================
  18. */
  19. #include <avr/wdt.h>
  20. #ifndef __WATCHDOG_H__
  21. #define __WATCHDOG_H__
  22. void wdt_init(void) __attribute__((naked)) __attribute__((section(".init3")));
  23. #define soft_reset() \
  24. do \
  25. { \
  26. wdt_enable(WDTO_500MS );\
  27. for(;;) \
  28. { \
  29. } \
  30. } while(0)
  31. #endif