?? wdt_test.c
字號:
#include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <stdlib.h>#include <sys/ioctl.h>#include <asm/types.h>#include "watchdog.h"/*******************************************************************/int main(int argc,const char * argv[]){ int fd,timeoutvalue; int c; printf("Enable watchdog\n"); fd=watchdog_enable(); watchdog_get_timeout(&timeoutvalue); printf("Get watchdog timeout =>%d second\n",timeoutvalue); watchdog_set_timeout(10); printf("Set watchdog new timeout => 10 seconds\n"); for(;;){ printf("Press any key to feed watchdog, else to reboot after 10 seconds\n"); c=getchar(); if(c==27)break; watchdog_feed(); } printf("\nDisable watchdog\n"); watchdog_disable(); }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -