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

LCD Do not initialize using PORTs A and E.
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
temtronic



Joined: 01 Jul 2010
Posts: 9073
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Oct 18, 2017 2:28 pm     Reply with quote

Try looking up 'bit_set()' in the manual. If you press F11 while your project is open, the CCS manual 'magically' comes alive !! I usually keep it open as I can make quick reference to it. I'm lousy at C syntax being an 'assembler guy' for 40 years...
jacktaylor



Joined: 02 Sep 2017
Posts: 75

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

Thank you Ttemtronic
PostPosted: Thu Oct 19, 2017 10:42 am     Reply with quote

OK thank you. Actually the synthesis confuses because there are many commands.
So in the instruction
char bitest1 = 0x00;
  if (! input (plus)) bit_set (control1,2);
We are setting 1 in bit 2 of the control variable, when ! Input (plus)

As I verify in the expression if (! Input (adj_watch)) && control1.2 == 1) that the bit2 of the variable control, really is in 1?

I know that the expression control1.2 == 1 is wrong.

I then used the expression:

if (! input (adj_watch)) && bit_test (control, 0)

but when compiling the error is generated: "A numeric expression must appear here".

using the expression:

if (! input (adj_watch)) & bit_test (control, 0)

The following error is generated when compiling the error: "Variable not permited here"
Ttelmah



Joined: 11 Mar 2010
Posts: 19186

View user's profile Send private message

PostPosted: Thu Oct 19, 2017 11:47 am     Reply with quote

There are problems with your brackets.

if (! input (adj_watch)) This is the end of the if statement as posted.....

& bit_test (control, 0 This bit is trying to execute a separate operation as a result of the 'if', with only one value fed into a mathematical operation requiring two values....

Hence the errors.

if ((! input (adj_watch)) && bit_test (control, 0))

Compiles without errors.
jacktaylor



Joined: 02 Sep 2017
Posts: 75

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

Thank you Ttemtronic
PostPosted: Thu Oct 19, 2017 9:16 pm     Reply with quote

Again I am very grateful for your help and explanation Ttelmah. Thank you.

Wink Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
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