CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problem with structure

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
YulL



Joined: 29 Sep 2004
Posts: 39
Location: Paris (France)

View user's profile Send private message

Problem with structure
PostPosted: Fri Nov 05, 2004 7:55 am     Reply with quote

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... Evil or Very Mad

Thanks by advance for your support. Razz
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Nov 05, 2004 8:26 am     Reply with quote

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)

View user's profile Send private message

PostPosted: Mon Nov 08, 2004 3:40 am     Reply with quote

Thanks for your advice it works fine now!!
Wink
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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