Re: struct編譯正確但卻出現 unable to resolve identifier
|
||||
---|---|---|---|---|
初級會員
|
了解了~
感謝你
發表於: 2020/5/28 9:35
|
|||
|
Re: struct編譯正確但卻出現 unable to resolve identifier
|
||||
---|---|---|---|---|
中級會員
|
bit在PIC是有被宣告的
跟int char unsigned這類的字是一樣的, 所以不能用bit去命名struct
發表於: 2020/5/27 18:34
|
|||
|
Re: struct編譯正確但卻出現 unable to resolve identifier
|
||||
---|---|---|---|---|
資深會員
|
把bit 改成 bits
應該就可以了吧。
發表於: 2020/5/27 16:23
|
|||
|
Re: struct編譯正確但卻出現 unable to resolve identifier
|
||||
---|---|---|---|---|
高級會員
|
您好,
可以試試看以下, volatile union Timer1_Status_Struct { struct { unsigned int Timer_1ms_Flag : 1; unsigned int Timer_10ms_Flag : 1; unsigned int Timer_100ms_Flag : 1; unsigned int Timer_1s_Flag : 1; unsigned int UNKNOW5 : 1; unsigned int UNKNOW6 : 1; unsigned int UNKNOW7 : 1; unsigned int UNKNOW8 : 1; unsigned int UNKNOW9 : 1; unsigned int UNKNOW10: 1; unsigned int UNKNOW11: 1; unsigned int UNKNOW12: 1; unsigned int UNKNOW13: 1; unsigned int UNKNOW14: 1; unsigned int UNKNOW15: 1; unsigned int UNKNOW16: 1; } bit; }Timer1_Status_flag; Timer1_Status_flag Timer1_Status_flag1 ; unsigned int IAP_Power_OFF_Flag ; Timer1_Status_flag1.bit.Timer_1ms_Flag = 1; IAP_Power_OFF_Flag = Timer1_Status_flag1.bit.Timer_1ms_Flag ;
發表於: 2020/5/27 14:22
|
|||
|
struct編譯正確但卻出現 unable to resolve identifier
|
||||
---|---|---|---|---|
初級會員
|
嗨
想問一下目前用MPLAB X V5.35開一個新專案,在寫struct時編譯正確
volatile union Timer1_Status_Struct
目前編譯成功,但是當我拿來使用時
Timer1_Status_flag.bit.IAP_Power_OFF_Flag = 1;
在MPLAB X 就出現了紅底跟相關訊息「unable to resolve identifier」, 而且當我打上Timer1_Status_flag. 並使用Ctrl + \ 他是可以找到bit, 但是Timer1_Status_flag.bit. 並使用Ctrl + \ 他就找不到下其他選項了。 有人知道這邊該如何解決嗎?
發表於: 2020/5/26 16:31
|
|||
|