|
|
我查看了些资料说winio可以读出我按照那个来发现一get就异常0 _0 B( }0 d5 f$ i
void Wait4Get()3 \. H) m1 ]4 U0 a0 ~/ {
{+ Q9 S$ Z6 d8 N" \/ Q
DWORD tmp = 0;
9 b1 h3 S7 A' `9 E GetPortVal(0x6c, &tmp, 1);
7 x/ \* f& E, S: g if (tmp != 1)
0 H9 ]% X( t9 G$ Z8 [6 C+ W1 T Wait4Set();
& I% @# b7 E+ \/ g3 G" N e5 z+ H}
5 A4 ]7 s. p5 T9 ]5 o7 cvoid Wait4Set()
' C6 P+ |3 t3 [4 C{( U% ~5 ~" u% D9 n( M7 b
DWORD tmp = 0;
9 W/ _8 R# _2 k2 C* F3 e0 \ GetPortVal(0x6c, &tmp, 1);
) t4 |) s& F8 z9 d if (tmp != 2)& X7 y% a* Y8 @( v
Wait4Set();
1 H! T0 U7 K7 q' K3 R' }! E. i- L- F. `7 p9 W; W# `( o3 v
}
- n/ L8 Z7 t5 o1 H( j. F) z; xint main(int argc, char* argv[]) & N( c+ o6 L" U
{
2 b" Y4 ]4 ^( A" _" v DWORD temp =0;! f6 _0 f% Q# m0 Z5 _0 s
if(!InitializeWinIo())' c( c0 d( I# x; _
{- x8 i! W5 q: x+ T5 ~: T
printf("fail");% ~8 f' @6 W9 J; d
}
8 \+ H" d" O6 O1 Z& N' D3 g; u Wait4Set();
: L% e! e. n, X/ ]9 B SetPortVal(0x6c,0x80,1);
; x+ }2 c( E6 M2 I4 N: a Wait4Set();
, n! `0 |" m5 I$ L) E SetPortVal(0x68,0xE7,1);
( V+ U% W a+ p X( N, v' j" g/ {3 }: d Wait4Get();
$ h% }& `3 |6 l" m2 ? | GetPortVal(0x68,&temp,1);3 I1 Q0 [0 P. f
printf("%s",temp);
4 l) q5 _4 G5 N3 I; _ ShutdownWinIo();
* s4 E+ g8 P0 B3 A( V& m return 0;- n* z2 M0 v0 A* H+ k; F. \
} |
|