From 82cd9d0b1c3140af30518fcc28af539fac5906ae Mon Sep 17 00:00:00 2001 From: guest Date: Tue, 23 Oct 2007 15:02:21 +0000 Subject: git-svn-id: svn+ssh://mecka.net/home/svn/dds@16 c30cbac5-9f56-4f76-8ed5-5c34e48a65ae --- iotest/src/diasio.cpp | 11 ++++++++--- iotest/src/iotest.cpp | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) (limited to 'iotest/src') diff --git a/iotest/src/diasio.cpp b/iotest/src/diasio.cpp index 6d791ba..1219607 100644 --- a/iotest/src/diasio.cpp +++ b/iotest/src/diasio.cpp @@ -32,6 +32,9 @@ static void* watchDogTriggern(void* arg) req.tv_sec = 0; req.tv_nsec = 300000; + + iopl( 3 ); + while(!DIASIO::stop_wd){ outw( out, DIASIO::m_Bereich2 + 0x0c ); nanosleep(&req, NULL); @@ -56,13 +59,15 @@ DIASIO::~DIASIO(){ } void DIASIO::set(TyuInt16 value){ - fprintf(stderr, "writing: %d -> %x + %x\n", value, m_Bereich2, S_AdresseOut); - fflush(stderr); +// fprintf(stderr, "writing: %d -> %x + %x\n", value, m_Bereich2, S_AdresseOut); +// fflush(stderr); + iopl( 3 ); outw( value, m_Bereich2 + S_AdresseOut ); - fprintf(stderr, "DONE\n"); fflush(stderr); +// fprintf(stderr, "DONE\n"); fflush(stderr); } TyuInt16 DIASIO::get(){ + iopl( 3 ); return inw( m_Bereich2 + S_AdresseOut ); } diff --git a/iotest/src/iotest.cpp b/iotest/src/iotest.cpp index a3b3337..491fd01 100644 --- a/iotest/src/iotest.cpp +++ b/iotest/src/iotest.cpp @@ -7,21 +7,28 @@ //============================================================================ #include - +#include #include "diasio.h" using namespace std; int main() { - cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! DIASIO dias; - int counter = 0; + int state = 0; + struct timespec halfmsec; + halfmsec.tv_sec = 0; + halfmsec.tv_nsec = 500000; - while(counter < 255){ - dias.set(counter); - counter++; + while(1){ + dias.set(state); + if(state == 0x00) + state = 0xff; + else + state = 0x00; + + nanosleep(&halfmsec, NULL); } return 0; -- cgit v1.2.3