|
我查看了些资料说winio可以读出我按照那个来发现一get就异常
$ P* z7 c, r9 r+ B7 J5 t0 Lvoid Wait4Get()
+ U) j- H" c- F' g6 l/ s{
' N+ u3 C V: w4 K4 C) U# I DWORD tmp = 0;
& t$ Q! j# b- i% ^. i GetPortVal(0x6c, &tmp, 1);4 I) z$ |& S& M _
if (tmp != 1)/ l2 T! x5 w- y; b
Wait4Set();
- [+ x: X7 d( V7 R9 ]6 H8 B+ r}. t! K: w F2 J
void Wait4Set()
: s ?+ L0 T, Q, ~0 d8 c{
6 h& k" A& s* j' h DWORD tmp = 0;' q4 K! v9 F7 p
GetPortVal(0x6c, &tmp, 1);
- N- f7 h7 W: e- j: {# X if (tmp != 2)3 E5 ^, B+ b- p
Wait4Set();7 f6 r* a. j- V! T: ~4 X
) s$ D4 f* \8 b
}0 |0 ~9 T5 k& p- Z
int main(int argc, char* argv[]) + {' O/ A' @) X' s- P* \
{
, T& N% B0 K7 A9 U4 C& r7 G: g- h DWORD temp =0;/ ^+ K1 I8 g5 [5 h1 ]
if(!InitializeWinIo())
5 I1 l R' t3 ~6 I {
( N) U% K( [, d& I* _- p printf("fail");' z h5 B) W) V
}' `, @6 x4 T t$ C
Wait4Set();
( U8 c, ?- t+ w SetPortVal(0x6c,0x80,1);3 ^9 t* O" m! `% T' @ h
Wait4Set();
- b5 G3 o- |1 P SetPortVal(0x68,0xE7,1);
, [' N* G4 ?- d, v) X Wait4Get();
. ]8 R0 ^' G! }. r, u' s, a) i GetPortVal(0x68,&temp,1);( B' G$ i2 b4 x/ p/ r3 H% D
printf("%s",temp);; N* p+ H) g9 B7 @5 \& _
ShutdownWinIo();% F; o- i/ Q7 i0 w
return 0;
6 }5 ]) E# i6 d3 k; d6 q* C. X" ]} |
|