Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/04/08 06:38
Read: times


 
#156392 - logical OR in Keil C

I am using Keil C version 6.02. I am trying to read the two swithces from two port pins of the uC 89C668. I am able to get the status individually. I want to take action if any of the switches are ON. I am getting problem with this. Can anybody help?

My code is like this
==============
sbit LSX1=P3^4;
sbit LSX2=P3^5;

if (LSX1||LSX2) {ENA=1; ENB=1;} else {ENA=0; ENB=0;} //(not working

if (LSX1) {ENA=1; ENB=1;} else {ENA=0; ENB=0;} //(This is working)

==============

Thanx
JPRAO

List of 4 messages in thread
TopicAuthorDate
logical OR in Keil C            01/01/70 00:00      
   use the SRC directive            01/01/70 00:00      
      Or just look in the listing file            01/01/70 00:00      
   Generated code looks fine            01/01/70 00:00      

Back to Subject List