|T O P I C R E V I E W
||Posted - 09/20/2007 : 00:14:54
Would anyone please help to solve my problem on using CodeVision
I need to pass a variable parameter to the function delay_us( )
which only accept constant expression.
Is it possible?
Thanks a lot
|6 L A T E S T R E P L I E S (Newest First)
||Posted - 09/23/2007 : 23:34:50
I am sure the problem has nothing concerned with the two
Anyway, thanks for your kind concern to my problem.
||Posted - 09/23/2007 : 23:06:26
It looks fine but I do not know what is "#pragma used+" for.
How about remove those two #pragma lines?
||Posted - 09/22/2007 : 23:36:17
the content of delay.h is as follows:
// CodeVisionAVR C Compiler
// (C) 1998-2000 Pavel Haiduc, HP InfoTech S.R.L.
void delay_us(unsigned int n);
void delay_ms(unsigned int n);
I wonder whether this is compiler bug or not?
Who can tell me the answer?
||Posted - 09/21/2007 : 14:30:29
What is the delay_us() function prototype looks like?
||Posted - 09/21/2007 : 02:15:02
I tried your suggestion but it produce an error of invalid
Just can't understand why the function delay_ms( ) can accept variable as parameter but delay_us( ) cannot.
What's the purposeof making this limitation?
||Posted - 09/20/2007 : 07:18:37
Did you try cast the varible?
unsigned char delayInMs;
delay_us((const unsigned char) delayInMs);