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 support@ccsinfo.com

Bit definition problem - Is this is Bug in CCS?

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



Joined: 28 Dec 2008
Posts: 12
Location: INDIA

View user's profile Send private message Send e-mail

Bit definition problem - Is this is Bug in CCS?
PostPosted: Mon Jan 26, 2009 11:28 pm     Reply with quote

hi
Code:
unsigned char dig[3];
#bit Flage=dig[2].0

Gives problem

Best wishes and Good Luck for CCS C user.

Regards
satish
_________________
HI
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: Bit definition problem - Is this is Bug in CCS?
PostPosted: Tue Jan 27, 2009 11:34 am     Reply with quote

satishmunot wrote:
hi
Code:
unsigned char dig[3];
#bit Flage=dig[2].0

Gives problem


It is true that you can't define Flage as dig[2].0, because dig[2] is not a simple variable, as required by the documentation (so it is not a bug). But you can do this:

Code:

  if( bit_test( dig[2], 0) )  { /*--do something--*/}

  bit_set( dig[2], 0 );
  bit_clear( dig[2], 0 );

and that will be just as efficient as if you used a #bit definition.
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
satishmunot



Joined: 28 Dec 2008
Posts: 12
Location: INDIA

View user's profile Send private message Send e-mail

Thank for Robert Scott
PostPosted: Tue Jan 27, 2009 10:20 pm     Reply with quote

hi
Thank for Robert Scott for your valuable suggestion.
Regards
Satish Munot Very Happy
_________________
HI
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