Help for Start 1st project with HI-TECH C

Embedded Systems Topics
User avatar
Nandika
Captain
Captain
Posts: 247
Joined: Sat Oct 15, 2011 11:40 am
Location: Galle-Sri Lanka

Re: Help for Start 1st project with HI-TECH C

Post by Nandika » Tue May 15, 2012 12:30 am

Thanks All ZevenZero,SemiconductorCat.....
Now I have some experience. :D
SevenZero wrote:
But I think here the real problem is the lack of delay.h in your lite edition. I think sevenzero could post his one. So you could do this injection.
There isn't any delay thing built-in to HI_TECH C. You need to write something by your own or else found someone else's.
But,HI-TROBOT.LK C user manual has this.
What is this function in User manual-->Library function?
__DELAY_MS,__DELAY_US in Library
__DELAY_MS,__DELAY_US in Library
__DELAY_MS,__DELAY_US in Library.PNG (36.3 KiB) Viewed 4144 times
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: Help for Start 1st project with HI-TECH C

Post by SemiconductorCat » Tue May 15, 2012 10:57 am

But,HI-TROBOT.LK C user manual has this.
What is this function in User manual-->Library function?
It's not a library function. As it said it's a macro. So it requires to include some "time.h" or "delay.h" or
something like that.Macro does not come in magic.

And the thing that start with double underscore in C++ referred to macros which are internal to the
compiler. But it's not a crime to create your own variable with double underscores.

ex - This is the dynamic casting macro that is used by C++ compiler. [they are typically defined in libc or libc++
,they are not even a template library ].

Code: Select all

__dynamic_cast ()
But in this case it says it's a macro. So then from my general C++/C knowledge it won't magically come
without including a include file. [unlike a library call]. The manual should be mentioned about a
header file.Typically it should be <delay.h> ,if I'm lucky.

Doesn't is mentioned anything about a include file ?


case Extreme:
Anyway in the extreme case , it may be a built in macro.Something like __TIME__ , __FILE__ , __LINE__ ,
__COMPILER__ etc. Where they are hardcoded into the preprocessor.

But in here __delay_ms I don't think so this is the case.



EDIT: Dynamic casting is not in C, it's on C++.
User avatar
SevenZero
Major
Major
Posts: 263
Joined: Sun Nov 01, 2009 8:37 pm

Re: Help for Start 1st project with HI-TECH C

Post by SevenZero » Tue May 15, 2012 12:17 pm

Exactly correct as Semi.. stated. No library called in HI_TECH C.
They have a delay.h and delay.c implementation. This is available under examples. So these are again source and header files which you can change according to your purpose.
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: Help for Start 1st project with HI-TECH C

Post by SemiconductorCat » Tue May 15, 2012 12:47 pm

OMG
EDIT:
IMPORTANT:

ex - This is the dynamic casting macro that is used by C++ compiler. (they are typically defined in libc or libc++
,they are not even a template library ).
Please note that it should be corrected to 'casting function' , it's a function not a macro.
Post Reply

Return to “Embedded Systems”