Re: 關於使用union
|
||||
---|---|---|---|---|
高級會員
|
可是我要把這些I/O腳合成UNION
就會產生錯誤了
發表於: 2007/10/3 15:01
|
|||
|
關於使用union
|
||||
---|---|---|---|---|
高級會員
|
小弟使用union與define
但在定義成port腳時,會出現錯誤 錯誤訊息為語法錯誤,但我不清楚該如何定義PORT腳會比較好 union{ unsigned char abc; strect{ unsigned bit0:1; unsigned bit1:1; unsigned bit2:1; unsigned bit3:1; unsigned bit4:1; unsigned bit5:1; unsigned bit6:1; unsigned bit7:1; }; }test; #define test.bit0 LATGbits.LATG0 #define test.bit1 LATGbits.LATG1 #define test.bit2 LATGbits.LATG2 #define test.bit3 LATGbits.LATG3 #define test.bit4 LATGbits.LATG4 #define test.bit5 LATGbits.LATG5 #define test.bit6 LATGbits.LATG6 #define test.bit7 LATGbits.LATG7 謝謝
發表於: 2007/10/3 14:34
|
|||
|