summaryrefslogtreecommitdiff
path: root/iotest
diff options
context:
space:
mode:
Diffstat (limited to 'iotest')
-rw-r--r--iotest/src/diasio.cpp11
-rw-r--r--iotest/src/iotest.cpp19
2 files changed, 21 insertions, 9 deletions
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 <iostream>
-
+#include <time.h>
#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;