Reply by Jon May 9, 20072007-05-09
This is an oddity of Dynamic C. Rather than header files, you put
function prototypes and any globals in between those Beginheader and
endheader tags. I'm sure that they have a description for a problem
that matches their solution, but it really is kind of odd. I can live
with it, but often stumble a few times as well. You have described
this better than the book!

Jon

--- In r..., fakhre alam wrote:
>
> Hi
>
> I solved the issue with how to add new lib, you have
> to follow a specific format which not part of standard
> c header file, seems like Rabbit have its own way to
> declare the lib, you have to follow a strict lib
> declaration format. Here is the example for future
> reference
>
> /*** Beginheader init_serial_port_lcd_controller */
> void init_serial_port_lcd_controller(void);
> /*** endheader */
>
>. . .
Reply by fakhre alam May 8, 20072007-05-08
Hi

I solved the issue with how to add new lib, you have
to follow a specific format which not part of standard
c header file, seems like Rabbit have its own way to
declare the lib, you have to follow a strict lib
declaration format. Here is the example for future
reference

/*** Beginheader init_serial_port_lcd_controller */
void init_serial_port_lcd_controller(void);
/*** endheader */

/* START FUNCTION DESCRIPTION
********************************************
init_serial_port_lcd_controller


SYNTAX: init_serial_port_lcd_controller();

DESCRIPTION: Use to initialize seril portC.

PARAMETER1: None

RETURN VALUE: None

END DESCRIPTION
**********************************************************/

void init_serial_port_lcd_controller(void)
{
#define SERDIS_BAUD_RATE 2400

unsigned int baud_rate;

baud_rate = serCopen(SERDIS_BAUD_RATE);
serCparity(PARAM_NOPARITY);
serCflowcontrolOff();
serCdatabits(PARAM_8BIT);

if (baud_rate)
{
printf("open port c at baud rate = %d\n",
SERDIS_BAUD_RATE);
}
else
printf("port c can not be open\n");
}

/*** BeginHeader */

Thanks every one for all the help. Its was not the
issue of adding serlcd.lib to LIB.DIR and #use
"serlcd.lib", the problem is the format, you have to
follow the Rabbit lib declaration format, which kind
of fishy.

Thanks.
Fakhre Alam
--- Alexandre Kremer wrote:

>
> --- fakhre alam escreveu:
>
> > Hi
> >
> > I created my own test.c file and I want to add my
> > own
> > lib file, TESTLCD.LIB, the main function is in
> > test.c
> > file. I want to compile TESTLCD.LIB so I can use
> > function defined in that file in my test.c file
> > (which
> > include void main(void)). If you open GPS.lib it
> > does
> > not contain any void main (void).
> Of course it does not contain the main function.
> It
> is a .lib file...
> > I tried with the
> > info mentioned in Dynamic c 9.10 doc.
> >
> > #use "testlcd.lib" /* add to test.c */
> >
> > and add testlcd.lib in lib.dir
> >
> > Please let me know any thing else need to done.
>
> Once you created a test.c file wich has the
> directive
> #use testlcd.lib you only need to include the file
> and
> its CORRECT PATH on lib.dir file.
> Once you did that, close Dynamic C and open it
> again.
> Try to compile your test.c file. It shall work.
> >
> > Thanks.
> > Fakhre Alam
> >
> > --- Scott Henion wrote:
> >
> > > fakhre alam wrote:
> > > > Hi
> > > >
> > > > Is any idea how to compile new lib and add it
> to
> > > > rabbit lib. I tried to compile it on Dynamic
> > 9.10,
> > > > does not compile with out adding void main
> > (void).
> > > >
> > > DC is not like a normal C compiler. It does not
> > > support separate
> > > compilation of libraries. When you compile your
> > > program, your source and
> > > all the libraries it uses are compiled at once.
> > >
> > > If writing a new lib, just add a "#use new.lib"
> to
> > a
> > > .c file with main()
> > > and add new.lib to the lib.dir file.
> > >
> > > ------
> > > | Scott G. Henion| s...@shdesigns.org |
> > > | Consultant | Stone Mountain, GA |
> > > | SHDesigns http://www.shdesigns.org |
> > > ------
> > > Rabbit libs: http://www.shdesigns.org/rabbit/
> > > today's fortune
> > > I don't think 'It's better than hurling yourself
> > > into a meat grinder'
> > > is a good rationale for doing something.
> > > -- Andrew Suffield in
> > > <2...@doc.ic.ac.uk> on
> > > debian-devel
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> >
> >
> > __________________________________________________
> >
> >
> __________________________________________________
> Fale com seus amigos de gra com o novo Yahoo!
> Messenger
> http://br.messenger.yahoo.com/
>
> Yahoo! Groups Links
>

____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html
Reply by fakhre alam May 8, 20072007-05-08
Thanks Alexandre, I will re-try it and see.

Fakhre Alam

--- Alexandre Kremer wrote:

>
> --- fakhre alam escreveu:
>
> > Hi
> >
> > I created my own test.c file and I want to add my
> > own
> > lib file, TESTLCD.LIB, the main function is in
> > test.c
> > file. I want to compile TESTLCD.LIB so I can use
> > function defined in that file in my test.c file
> > (which
> > include void main(void)). If you open GPS.lib it
> > does
> > not contain any void main (void).
> Of course it does not contain the main function.
> It
> is a .lib file...
> > I tried with the
> > info mentioned in Dynamic c 9.10 doc.
> >
> > #use "testlcd.lib" /* add to test.c */
> >
> > and add testlcd.lib in lib.dir
> >
> > Please let me know any thing else need to done.
>
> Once you created a test.c file wich has the
> directive
> #use testlcd.lib you only need to include the file
> and
> its CORRECT PATH on lib.dir file.
> Once you did that, close Dynamic C and open it
> again.
> Try to compile your test.c file. It shall work.
> >
> > Thanks.
> > Fakhre Alam
> >
> > --- Scott Henion wrote:
> >
> > > fakhre alam wrote:
> > > > Hi
> > > >
> > > > Is any idea how to compile new lib and add it
> to
> > > > rabbit lib. I tried to compile it on Dynamic
> > 9.10,
> > > > does not compile with out adding void main
> > (void).
> > > >
> > > DC is not like a normal C compiler. It does not
> > > support separate
> > > compilation of libraries. When you compile your
> > > program, your source and
> > > all the libraries it uses are compiled at once.
> > >
> > > If writing a new lib, just add a "#use new.lib"
> to
> > a
> > > .c file with main()
> > > and add new.lib to the lib.dir file.
> > >
> > > ------
> > > | Scott G. Henion| s...@shdesigns.org |
> > > | Consultant | Stone Mountain, GA |
> > > | SHDesigns http://www.shdesigns.org |
> > > ------
> > > Rabbit libs: http://www.shdesigns.org/rabbit/
> > > today's fortune
> > > I don't think 'It's better than hurling yourself
> > > into a meat grinder'
> > > is a good rationale for doing something.
> > > -- Andrew Suffield in
> > > <2...@doc.ic.ac.uk> on
> > > debian-devel
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> >
> >
> > __________________________________________________
> >
> >
> __________________________________________________
> Fale com seus amigos de gra com o novo Yahoo!
> Messenger
> http://br.messenger.yahoo.com/
>
> Yahoo! Groups Links
>
__________________________________________________
Reply by Alexandre Kremer May 8, 20072007-05-08
--- fakhre alam escreveu:

> Hi
>
> I created my own test.c file and I want to add my
> own
> lib file, TESTLCD.LIB, the main function is in
> test.c
> file. I want to compile TESTLCD.LIB so I can use
> function defined in that file in my test.c file
> (which
> include void main(void)). If you open GPS.lib it
> does
> not contain any void main (void).
Of course it does not contain the main function. It
is a .lib file...
> I tried with the
> info mentioned in Dynamic c 9.10 doc.
>
> #use "testlcd.lib" /* add to test.c */
>
> and add testlcd.lib in lib.dir
>
> Please let me know any thing else need to done.

Once you created a test.c file wich has the directive
#use testlcd.lib you only need to include the file and
its CORRECT PATH on lib.dir file.
Once you did that, close Dynamic C and open it again.
Try to compile your test.c file. It shall work.
>
> Thanks.
> Fakhre Alam
>
> --- Scott Henion wrote:
>
> > fakhre alam wrote:
> > > Hi
> > >
> > > Is any idea how to compile new lib and add it to
> > > rabbit lib. I tried to compile it on Dynamic
> 9.10,
> > > does not compile with out adding void main
> (void).
> > >
> > DC is not like a normal C compiler. It does not
> > support separate
> > compilation of libraries. When you compile your
> > program, your source and
> > all the libraries it uses are compiled at once.
> >
> > If writing a new lib, just add a "#use new.lib" to
> a
> > .c file with main()
> > and add new.lib to the lib.dir file.
> >
> > ------
> > | Scott G. Henion| s...@shdesigns.org |
> > | Consultant | Stone Mountain, GA |
> > | SHDesigns http://www.shdesigns.org |
> > ------
> > Rabbit libs: http://www.shdesigns.org/rabbit/
> > today's fortune
> > I don't think 'It's better than hurling yourself
> > into a meat grinder'
> > is a good rationale for doing something.
> > -- Andrew Suffield in
> > <2...@doc.ic.ac.uk> on
> > debian-devel
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> __________________________________________________
>
>
__________________________________________________
Fale com seus amigos de gra com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
Reply by Alexandre Kremer May 8, 20072007-05-08
Yes, sure.

--- Nathan Johnston
escreveu:

> I assume you've checked your programming cable (i.e.
> it is working with other RCM's)?
>
>
>
> -----Original Message-----
> From: r...
> [mailto:r...] On Behalf Of
> alekremer
> Sent: Tuesday, 8 May 2007 5:35 AM
> To: r...
> Subject: [rabbit-semi] Problem on RCM3700
>
>
>
> Im having brand new out of the box cores presenting
> problem.
> DC shows the message:
> While sending pilot bios, Target communication
> error.
>
> Any suggestions?
>
> Thanx
>
>
__________________________________________________
Fale com seus amigos de gra com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
Reply by fakhre alam May 8, 20072007-05-08
Hi

I created my own test.c file and I want to add my own
lib file, TESTLCD.LIB, the main function is in test.c
file. I want to compile TESTLCD.LIB so I can use
function defined in that file in my test.c file (which
include void main(void)). If you open GPS.lib it does
not contain any void main (void). I tried with the
info mentioned in Dynamic c 9.10 doc.

#use "testlcd.lib" /* add to test.c */

and add testlcd.lib in lib.dir

Please let me know any thing else need to done.

Thanks.
Fakhre Alam

--- Scott Henion wrote:

> fakhre alam wrote:
> > Hi
> >
> > Is any idea how to compile new lib and add it to
> > rabbit lib. I tried to compile it on Dynamic 9.10,
> > does not compile with out adding void main (void).
> >
> DC is not like a normal C compiler. It does not
> support separate
> compilation of libraries. When you compile your
> program, your source and
> all the libraries it uses are compiled at once.
>
> If writing a new lib, just add a "#use new.lib" to a
> .c file with main()
> and add new.lib to the lib.dir file.
>
> ------
> | Scott G. Henion| s...@shdesigns.org |
> | Consultant | Stone Mountain, GA |
> | SHDesigns http://www.shdesigns.org |
> ------
> Rabbit libs: http://www.shdesigns.org/rabbit/
> today's fortune
> I don't think 'It's better than hurling yourself
> into a meat grinder'
> is a good rationale for doing something.
> -- Andrew Suffield in
> <2...@doc.ic.ac.uk> on
> debian-devel
>
>
> Yahoo! Groups Links
>
__________________________________________________
Reply by Scott Henion May 8, 20072007-05-08
fakhre alam wrote:
> Hi
>
> Is any idea how to compile new lib and add it to
> rabbit lib. I tried to compile it on Dynamic 9.10,
> does not compile with out adding void main (void).
>
DC is not like a normal C compiler. It does not support separate
compilation of libraries. When you compile your program, your source and
all the libraries it uses are compiled at once.

If writing a new lib, just add a "#use new.lib" to a .c file with main()
and add new.lib to the lib.dir file.

------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
I don't think 'It's better than hurling yourself into a meat grinder'
is a good rationale for doing something.
-- Andrew Suffield in
<2...@doc.ic.ac.uk> on debian-devel
Reply by Jon May 7, 20072007-05-07
You will ALWAYS need to have a file some where that has main().
That's how C works. It can use functions and constants from other
library files, however. In C, you would use "include" to reference
headers. In Dynamic C, you use "use" to pull in functions from other
files.

Read the manuals, run the examples. Many of the examples are
single-file programs, but you will fine some theat use the #use
directive. It will take you some time and effort to get the hang of this.

I also recommend that you pick up a copy of K&R, as it is an excellent
training on C by the guys who invented the language. For more info:
http://en.wikipedia.org/wiki/C_(programming_language)
It is a bargain at any price. If you do some digging, you may even
find some on-line excerpts.

Good luck, and enjoy the learning experience!

--- In r..., fakhre alam wrote:
>
> Hi
>
> Is any idea how to compile new lib and add it to
> rabbit lib. I tried to compile it on Dynamic 9.10,
> does not compile with out adding void main (void).
>
> Thanks.
> Fakhre Alam
> __________________________________________________
Reply by fakhre alam May 7, 20072007-05-07
Hi

Is any idea how to compile new lib and add it to
rabbit lib. I tried to compile it on Dynamic 9.10,
does not compile with out adding void main (void).

Thanks.
Fakhre Alam
__________________________________________________
Reply by Nathan Johnston May 7, 20072007-05-07
I assume you've checked your programming cable (i.e. it is working with other RCM's)?

-----Original Message-----
From: r... [mailto:r...] On Behalf Of alekremer
Sent: Tuesday, 8 May 2007 5:35 AM
To: r...
Subject: [rabbit-semi] Problem on RCM3700

Im having brand new out of the box cores presenting problem.
DC shows the message:
While sending pilot bios, Target communication error.

Any suggestions?

Thanx