|
我查看了些资料说winio可以读出我按照那个来发现一get就异常* D1 R& d3 L6 w: e/ i* A$ v
void Wait4Get()
8 R' c6 _6 [1 M3 o: Y! W{
0 Z0 c' X+ z! _4 z, v+ i1 P DWORD tmp = 0;
( Y2 |- |5 m2 h" e# ?" Z6 P1 z GetPortVal(0x6c, &tmp, 1);6 Q2 P: r& X2 h* k
if (tmp != 1)
$ v2 _: L: d9 I' l. l$ m' c Wait4Set();3 Q+ C, Z- c- b* Y3 q9 h7 q5 @$ `: m
}, x1 L, G* ]# r0 O% S1 B7 E. S$ X. l4 `
void Wait4Set()
# t% e) S/ ^" i G{
0 W8 W* T. r- p8 } DWORD tmp = 0; w; n# E4 q2 U5 L7 P2 p
GetPortVal(0x6c, &tmp, 1);
* U9 m; A' ~2 o$ e if (tmp != 2)# S: [. @% `9 h% R0 Z& Z" A
Wait4Set();
6 d7 \2 K# z' V, @! f0 M. F
" D9 _% K2 v, [0 `6 L}
: D% q2 [1 u( T: n% mint main(int argc, char* argv[]) : l. [3 F5 [8 Z! w
{ * H R: |- [+ L- K3 X
DWORD temp =0;! A# T) q3 X: @/ T, q* V
if(!InitializeWinIo())
3 R4 W# R, V8 W: l' f7 W/ q {
$ ]1 P: q4 u" m+ v- W9 P printf("fail");
+ h% `# X/ p" ?) H7 ^ v" ] }* h8 z# h9 p; _" |
Wait4Set();
- ~1 R% S N3 u2 g a% X SetPortVal(0x6c,0x80,1);7 s) Z1 i+ S' Z* z) [
Wait4Set();
5 c: _9 |" Y4 Q5 F6 h SetPortVal(0x68,0xE7,1);& [: b e+ |6 v# ^# H" N2 D% b
Wait4Get();
( l6 v/ M# u- R: ~ GetPortVal(0x68,&temp,1);
: b2 u: e# Z& a1 c: K5 {! e printf("%s",temp);
/ Z$ A; b& K/ v- R3 }; _8 l& d ShutdownWinIo();
a0 S2 F1 q( e% V! P+ f return 0;
9 v [& F2 u8 f; Y Z W! }} |
|