|
|
我查看了些资料说winio可以读出我按照那个来发现一get就异常
( ^! \4 p6 ], o( }0 Nvoid Wait4Get()/ Z# Z, `2 e+ m4 R/ O- W
{
/ J- {$ G& x$ Q6 V# A( S$ ?+ C DWORD tmp = 0;
- N- i3 W8 R: O" T% @) W GetPortVal(0x6c, &tmp, 1);: H m7 B& P+ I, x5 B; i& V
if (tmp != 1)% {5 a j2 \7 \2 N
Wait4Set();$ D9 ^6 ^: O1 l; G+ T1 R& l$ D
}% _8 Z3 z R& r
void Wait4Set()2 o: K- \2 `3 j c0 }' Y) X0 K
{
# u' R( K- g* Y0 d3 a DWORD tmp = 0;" Z' _. ` ~2 F& L
GetPortVal(0x6c, &tmp, 1);
5 I- `" y, C: F$ [ if (tmp != 2)
3 _0 k$ v" `8 m8 | Wait4Set();7 V3 o, q# r% r0 k5 u" d3 M, G+ I
: a* T/ Z1 _ a$ p; _3 {( p}
' ^8 G9 I7 S( W1 X- d" o5 y5 {int main(int argc, char* argv[]) # X- W5 Y" r! ~2 ^) W. S# g
{ / G3 i# M/ c7 L, c0 e
DWORD temp =0;
+ Z6 J1 X( I! ]5 R* k# t if(!InitializeWinIo())
: N4 x4 \& v3 Q( ] {4 z; T" K; }! @+ `2 k1 y; [
printf("fail");
/ z. y4 \0 v3 `5 g3 V( I; j8 |: C }! t6 e* a3 c/ M2 [" k) p3 K i" {. ^! f
Wait4Set();" Z+ B. }' h( g1 \# B M" S6 U
SetPortVal(0x6c,0x80,1);
$ [! D2 j$ B5 n1 v9 I Wait4Set();
4 Z. q6 H6 y( w* f6 H7 ] SetPortVal(0x68,0xE7,1);" h; F2 K9 @1 l
Wait4Get();: h5 |; W% I g0 D$ v
GetPortVal(0x68,&temp,1);/ l9 Q6 P1 L9 n E8 ^1 m! C8 ?
printf("%s",temp);. [8 @* s( U: o# F8 F: L; ~
ShutdownWinIo();
* S! N. ~" C5 h; l! [ return 0;; B5 `6 m7 U5 I {, L
} |
|