![FTDI FT51A Скачать руководство пользователя страница 127](http://html1.mh-extra.com/html/ftdi/ft51a/ft51a_application-note_2341158127.webp)
Application Note
AN_289 FT51A Programming Guide
Version 1.0
Document Reference No.: FT_000962 Clearance No.: FTDI# 483
126
Copyright © 2015 Future Technology Devices International Limited
return 0;
}
/**
@brief Main
@details Main program entry point.
@return No! Returning from main() is undefined!
**/
int
main
()
{
RESET_REASON reset_reason = WATCHDOG_RESET;
int i;
/**
Once the cause of the reset is known, the behaviour of the app can
be changed accordingly.
**/
reset_cause(&reset_reason);
if (reset_reason != WATCHDOG_RESET)
{
// Write code to do something if watchdog had not caused the reset
watchdog_enable(0x1A); // Enable watchdog
// Feed the watchdog for some time and go to an infinite loop
for(i=0; i<13; i++)
{
watchdog_feed();
}
}
else
{
// Write code to do something in the event watchdog had caused the reset.
}
//This infinite loop will cause the watchdog to time out and reset the system.
while(1);
}