MCUmall EPROM BIOS Chip Burner Forum
MCUmall EPROM BIOS Chip Burner Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 MCUmall Forums
 Using the AVR JTAG ICE and AVRISP ISP programmer
 Need help on AVR CodeVision

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an Image File
Check here to include your profile signature.
    

T O P I C    R E V I E W
sohomcu Posted - 09/20/2007 : 00:14:54
Dear all,

Would anyone please help to solve my problem on using CodeVision
C compiler.

I need to pass a variable parameter to the function delay_us( )
which only accept constant expression.
Is it possible?

Thanks a lot

Eddy Lau
6   L A T E S T    R E P L I E S    (Newest First)
sohomcu Posted - 09/23/2007 : 23:34:50
I am sure the problem has nothing concerned with the two
#pragma lines.

Anyway, thanks for your kind concern to my problem.

ZLM 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?
sohomcu 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.

#ifndef _DELAY_INCLUDED_
#define _DELAY_INCLUDED_

#pragma used+

void delay_us(unsigned int n);
void delay_ms(unsigned int n);

#pragma used-

#endif

I wonder whether this is compiler bug or not?

Who can tell me the answer?

Thanks
ZLM Posted - 09/21/2007 : 14:30:29
What is the delay_us() function prototype looks like?
sohomcu Posted - 09/21/2007 : 02:15:02
I tried your suggestion but it produce an error of invalid
typecast.

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?


ZLM Posted - 09/20/2007 : 07:18:37
Did you try cast the varible?

Example:

unsigned char delayInMs;

delay_us((const unsigned char) delayInMs);


MCUmall EPROM BIOS Chip Burner Forum © Copyright 2003 - 2009 Mcumall Electronics Inc. Go To Top Of Page
Generated in 0.12 sec. Snitz Forums 2000