|
|
View previous topic :: View next topic |
Author |
Message |
YulL
Joined: 29 Sep 2004 Posts: 39 Location: Paris (France)
|
Problem with structure |
Posted: Fri Nov 05, 2004 7:55 am |
|
|
Hi,
I'm using two variables : CVM_CRC and PIC_CRC... CVM_Header, PIC_Header... etc... But now I prefer to use structures in order to make my code more readable!
Here is what I have already done for that :
struct BusMail
{ int8 longueur[2];
int8 prim[2];
int8 param[32];
int8 header;
int8 CRC;
int8 SuId;
int8 TxSeq;
int8 RxSeq;
int1 IC;
int1 PF;
} PIC, CVM;
void send_control(int8 PIC.SuId, int8 PIC.RxSeq, int8 PIC.PF);
void API_FP_INVOKE_ACCESS_RIGHTS(int8 PIC.TxSeq, int8 PIC.RxSeq);
void CVM_EEPROM_WRITE_REQ_BASE(int8 PIC.TxSeq, int8 PIC.RxSeq);
But when I compile I have the error message : "Expecting a , or )"
I can't find where I'm wrong...
Thanks by advance for your support. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Fri Nov 05, 2004 8:26 am |
|
|
Code: | void send_control(int8 PIC.SuId, int8 PIC.RxSeq, int8 PIC.PF);
void API_FP_INVOKE_ACCESS_RIGHTS(int8 PIC.TxSeq, int8 PIC.RxSeq);
void CVM_EEPROM_WRITE_REQ_BASE(int8 PIC.TxSeq, int8 PIC.RxSeq); |
I assume you are showing the functional protypes. In which case they should be..
Code: | void send_control(int8 SuId, int8 RxSeq, int8 PF);
void API_FP_INVOKE_ACCESS_RIGHTS(int8 TxSeq, int8 RxSeq);
void CVM_EEPROM_WRITE_REQ_BASE(int8 TxSeq, int8 RxSeq); |
Then when you call one it would look like..
Code: | send_control(PIC.SuId, PIC.RxSeq, PIC.PF); |
_________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
YulL
Joined: 29 Sep 2004 Posts: 39 Location: Paris (France)
|
|
Posted: Mon Nov 08, 2004 3:40 am |
|
|
Thanks for your advice it works fine now!!
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|