beautypg.com

Appendix a, Programming watchdog timer – Lanner LEC-7105 User Manual

Page 22

background image

22

Programming Watchdog Timer

Embedded and Industrial Computing

Appendix A

DIRECT_IO_ACCESS=1, use the command: “./

wd_tst --swt xxx” to start the watchdog timer

instead .

Watchdog timer can support two functions,

2.

- system rest or LAN bypass. However, only

one function can be activated at a time. You

should modify the code or switch it to the

desired state/function accordingly.

For more details, refer to the README file

3.

contained within the program.

A sample Watchdog program in C:

*********************************************************

**********************/
#include “../include/config.h”

#ifdef DJGPP

/* standard include file */
#include
#include
#include
/* For DOS DJGPP */
#include
#include

#else //DJGPP
/* For Linux */

#ifdef DIRECT_IO_ACCESS
/* For Linux direct io access code */
/* standard include file */
#include
#include
#include

#if defined(LINUX_ENV)
#include
#endif

#if defined(FreeBSD_ENV)
#include
#endif

#include
#include
#include
#include
#include
#define delay(x) usleep(x)
#endif

#ifdef MODULE

#include
#include
#include
#include
#include
#include

#undef delay
#define delay(x) mdelay(x)
#undef fprintf
#define fprintf(S, A) printk(A)

#endif //MODULE

#ifdef KLD_MODULE

#include
#include
#include
#include
#include
#include