Wdt Function - JHCTech FEBC-3158 User Manual

Table of Contents

Advertisement

5.1 WDT Function

 WDT Set Example
#include <stdio.h>
#include "stdafx.h"
#include <windows.h>
typedef int(_stdcall *IpMyin)(int);
typedef int(_stdcall *IpMyout)(int,int);
void set_watchdog(int time)
{
HINSTANCE hDll;
IpMyin Myin;
IpMyout Myout;
hDll = LoadLibrary(_T("inpout32.dll"));
if (hDll != NULL)
{
Myin = (IpMyin)GetProcAddress(hDll, "Inp32");
Myout = (IpMyout)GetProcAddress(hDll, "Out32");
if (Myin != NULL)
{
Myout(0x4e,0x87);
Myout(0x4e,0x87); //unlock
Myout(0x4e,0x2b);
Myout(0x4f,0xc0);
Myout(0x4e,0x7);
Myout(0x4f,0x8);
Myout(0x4e,0x30);
Myout(0x4f,0x01);
Myout(0x4e,0xf5);
Myout(0x4f,0x0);
//select logical device
//select logical device
//Set Watch Dog Timer Activate
//set second
User's Manual
47

Advertisement

Table of Contents
loading

Table of Contents