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

A numeric expression must appear here

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







A numeric expression must appear here
PostPosted: Wed Jan 13, 2010 6:56 pm     Reply with quote

Code:
  if(read_usb() == checksum)//if checksums match
   {
      delay_us(100);
      if(input(RXF)==0)//if more data in FIFO
      {
         delay_ms(5);//still have data in the FIFO but not exceed 100 bytes, read out. Or error!
                        while(input(RXF)==0)//clear the FIFO
                        for(count_bytes=0; count_bytes++; count_bytes=60000)
                        {
                                   if(count_bytes<=100);
                                    {
                                      send(0x66);//no error
                                      delay_us(100);
                                      packet_ready=1;
                                    }
                                    else %%%[color=red]A numeric expression must appear here  [/color]                                      {
                                             delay_ms(5);
                                             read_usb();
                                         }
                                     send(0xEE);//error!
                                     packet_ready=0;
                                   
                         }

                       
         
      }
       else
      {
         send(0x55);//no error
         delay_us(100);
         packet_ready=1;
      }
   }
   else//checksum failed
   {
      send(0xaa);//error!
      packet_ready=0;
   }

   strobe_SND();//send now
}


I have a problem with 'A numeric expression must appear here'. I checked the previous topics, there were no similar problem as mine.
I want to output many commands at once. So I revise the original c source code and add some lines. I was wondering if there are someone who can help me with that.
Thank you!
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Jan 13, 2010 7:35 pm     Reply with quote

Do you notice what is at the end of the first line below that shouldn't be there?

Code:
if (count_bytes<=100);
           {
              send(0x66);//no error
              delay_us(100);
              packet_ready=1;
            }

_________________
Google and Forum Search are some of your best tools!!!!
Wing
Guest







PostPosted: Thu Jan 14, 2010 11:55 am     Reply with quote

Thank you, dyeatman. I revised it and it suceeded!
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