Re: picc 18 好像不支援這樣的宣告,還是我錯了...!
|
||||
---|---|---|---|---|
版主
|
可以參考 W 401 C18 workshop 教材的第四章,那裡有詳細的 Union & Struct 的說明。
發表於: 2006/10/2 16:41
|
|||
|
Re: picc 18 好像不支援這樣的宣告,還是我錯了...!
|
||||
---|---|---|---|---|
新會員
|
謝謝! 因為我用別種C可以用我提出的方式宣告,程式比較容易閱讀,修改也很容易
發表於: 2006/10/2 10:33
|
|||
|
Re: picc 18 好像不支援這樣的宣告,還是我錯了...!
|
||||
---|---|---|---|---|
高級會員
|
unsigned char _mp3_flag;
發表於: 2006/10/2 9:21
|
|||
|
picc 18 好像不支援這樣的宣告,還是我錯了...!
|
||||
---|---|---|---|---|
新會員
|
union un_byte { /* union PORT1 */
unsigned char Byte; /* Byte Access */ struct { /* Bit Access */ unsigned char b0:1; /* Bit 0 */ unsigned char b1:1; /* Bit 1 */ unsigned char b2:1; /* Bit 2 */ unsigned char b3:1; /* Bit 3 */ unsigned char b4:1; /* Bit 4 */ unsigned char b5:1; /* Bit 5 */ unsigned char b6:1; /* Bit 6 */ unsigned char b7:1; /* Bit 7 */ } b; }; union un_byte KEY_O0; #define Page_Add KEY_00.b.b0 #define Page_Dec KEY_00.b.b1 picc 18 好像不支援這樣的宣告,還是我錯了...! 唉呀! 我"O" 跟 "0"(零)打錯了 謝謝大家!
發表於: 2006/10/1 12:12
|
|||
|