請先看『使用說明』
IO Device:81801 Linux
From LEXWiKi
Contents |
The Sample code source you can download from
<Google Drive>
Source file: 81801U_WDT_v1.0L_Src
Binary file: 81801U_WDT_v1.0L_Bin
<FTP>
Source file: 81801U_WDT_v1.0L_Src
Binary file: 81801U_WDT_v1.0L_Bin
How to compile source code
1. Compile source code with Code::Blocks
- download and install the Code::Block and libgtk2.0-dev with command "apt-get install codeblocks libgtk2.0-dev"
- Open an exist project(lanbypass.cbp) in Code::Blocks
- add an option `pkg-config gtk+-2.0 --cflags`-std=gnu99 in "Project->Build Option->compiler setting->Other option"
- add an option `pkg-config gtk+-2.0 --libs` in "Project->Build Option->Linker Setting->Other linker option"
- click the compile button
2.Compile source code with "make"
- download and install the libgtk2.0-dev with command "apt-get install libgtk2.0-dev"
- cd lanbypass
- ./configure
- make
- cd src/lanbypass // execute the binary file()
How to use the DEMO Application
- Step 1:Key-in the 1~255 value in Red number 1.
- Step 2:Press the "WDT Enable" button in Red number 2,the system will reboot after step 1 you key-in Sec.
- Step 3:Press the "WDT Disable" button in Red number 3,It will stop WDT function.
So you can make the loop with Enable and Disable to protection your system when crash.
Enable WDT function
void enable() { outb(EntryKey,IndexPort); outb(EntryKey,IndexPort); outb(LDNSET,IndexPort); outb(0x07,DataPort); //Select WDT device configuration registers. outb(WDTDE,IndexPort); outb(0x01,DataPort); //Set WDT "Device" Enable outb(WDTEnable,IndexPort); //WDT "timer" enable register outb(0x80,DataPort); //Set watchdog timer enable outb(WDTCount,IndexPort); outb(0x05,DataPort); //System will reboot after timer sec. outb(WDTUS,IndexPort); outb(0x31,DataPort); //Set WDTRST output mode: Pulse(width: 25ms) }
Disable WDT function
void disable() { outb(WDTUS,IndexPort); outb(0x51,DataPort); }