|
|
View previous topic :: View next topic |
Author |
Message |
richi-d
Joined: 28 Aug 2007 Posts: 106
|
Problems with Functions |
Posted: Fri Apr 03, 2009 2:52 am |
|
|
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: |
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
|
|
Posted: Fri Apr 03, 2009 4:37 am |
|
|
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
|
|
Posted: Fri Apr 03, 2009 2:17 pm |
|
|
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) |
|
|
|
|
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
|