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

Problems with Functions

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



Joined: 28 Aug 2007
Posts: 106

View user's profile Send private message

Problems with Functions
PostPosted: Fri Apr 03, 2009 2:52 am     Reply with quote

I use a code which was running perfect under PCW but now with PCD it doesn't work:

Code:

Write_Data(LOGO [j+n]);


This works:
Code:


Write_Data(0x3F);


Code:

void Write_Command( COMMAND )
   {
   output_low(A0);
   output_low(CS);
   output_high(RD);
   output_low(WR);

   output_bit (DATA_0, bit_test (DATA, 0));
   output_bit (DATA_1, bit_test (DATA, 1));
   output_bit (DATA_2, bit_test (DATA, 2));
   output_bit (DATA_3, bit_test (DATA, 3));
   output_bit (DATA_4, bit_test (DATA, 4));
   output_bit (DATA_5, bit_test (DATA, 5));
   output_bit (DATA_6, bit_test (DATA, 6));
   output_bit (DATA_7, bit_test (DATA, 7));

   delay_us(1);

   output_high(CS);
   }


How can I put a variable in the function? With PCW it was no problem!
It´s not funny to change all my older codes!![/code]
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Apr 03, 2009 4:37 am     Reply with quote

Your code is not complete. As posted it does not compile, not in PCW and not in PCD.
What is the definition of DATA?
What is the definition of COMMAND?

What is your problem? Does the code not compile? What error message do you get?

Just a guess:
Code:
void Write_Command( COMMAND )
It looks like the type specifier is missing for COMMAND, but again, the definition is not given so I can not say for sure.
Try something like:
Code:
void Write_Command( int COMMAND )


Always post your compiler version number!
Guest








PostPosted: Fri Apr 03, 2009 2:17 pm     Reply with quote

Which version of the compiler are you using?

I reported this bug to CCS for PCD v4.088 and v4.089 for the pic24 series.
For these two releases they broke arrays, and accessing myArray[i] would result in i being returned rather than the value held by the array at index i.

It worked correctly for v4.087 and before, and was fixed last week with release v4.090.
(In my application the arrays were int32's)
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