![Advantech RSB-4220 Скачать руководство пользователя страница 64](http://html1.mh-extra.com/html/advantech/rsb-4220/rsb-4220_user-manual_2857962064.webp)
RSB-4220 User Manual
58
/*when set timeout value, the watchdog driver will enable the
watchdog automatically.*/
ioctl (fd, WDIOC_SETTIMEOUT, &timeout);
while (1)
{
/*feed the watchdog every 5 seconds*/
/*when call this funtion to feed watchdog, the watchdog
will reset its internal timer so it doesn't trigger the
board reset. If do not feed the watchdog more than 10
seconds, the watchdog will timeout and the board will
reset.*/
ioctl( fd, WDIOC_KEEPALIVE, NULL );
sleep (5);
}
close (fd);
}
Here are some other APIs for watchdog.
Disable the watchdog timer sample code:
/*if user want to disable the watchdog before timeout, call the fol-
lowing ioctl function*/
int i_dis = WDIOS_DISABLECARD;
ioctl( fd, WDIOC_SETOPTIONS, &i_dis );
Enable the watchdog timer sample code:
/*if user want to enable the watchdog again before timeout when it is
disabled, call the following ioctl function. */
int i_en = WDIOS_ENABLECARD;
ioctl( fd, WDIOC_SETOPTIONS, & i_en);
Get the current timeout value:
/*get the current timeout value the driver used*/
int timeout = 0;
ioctl (fd, WDIOC_GETTIMEOUT, &timeout);
Please refer to <BSP_PATH>/source/demo/watchdog folder to get more information.
Содержание RSB-4220
Страница 10: ...RSB 4220 User Manual 4 ...
Страница 20: ...RSB 4220 User Manual 14 Figure 2 5 Ethernet Connector ...
Страница 41: ...Chapter 3 3 Software Functionality This chapter details the Linux operating system on the RSB 4220 platform ...
Страница 66: ...RSB 4220 User Manual 60 ...
Страница 77: ...71 RSB 4220 User Manual Chapter 5 Advantech Services ...