Advantech ITA-460 Series User Manual page 75

Fanless embedded industrial computer with 8th/9th gen intel core i processor for vehicle applications
Table of Contents

Advertisement

Table A.2: Watchdog (Warm Reset) Sample Code
#include <cstdlib>
#include <sys/io.h>
#include <unistd.h>
#include <iostream>
using namespace std;
int OBF=0x01, IBF=0x02
int wait_OBF(int Port)
{
int icount;
for(icount=0;icount<0xFF;icount++)
{
int iValue = inb(Port);
if((iValue&OBF) == 0x01)
return true;
usleep(1000);
}
count<< "Wait_OBF failed\n";
count.flush();
return false;
}
int wait_IBF(int Port)
{
int icount;
for(icount=0;icount<0xFF;icount++)
{
int iValue = inb(Port);
if((iValue&IBF) == 0x00)
return true;
usleep(1000);
}
cout << "wait_IBF failed\n";
cout.flush();
return false;
}
void DummyPort()
{
int iRet = inb(0x299);
wait_IBF(0x29A);
}
63
ITA-460 User Manual

Advertisement

Table of Contents
loading

Table of Contents