Go to Post Are you asking if I can pick up electrons? I'm positive. - Gary Dillard [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-01-2006, 11:07
koenig3456 koenig3456 is offline
Programming Coach
None #0681 (EARTH Squad)
Team Role: Coach
 
Join Date: Jan 2006
Location: Pennsylvania
Posts: 16
koenig3456 is an unknown quantity at this point
Question Calling C functions from EasyC

I've written some functions in C using MPLab. The modules include both static data and code. How can I use them in an EasyC project?
  #2   Spotlight this post!  
Unread 27-01-2006, 11:23
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Calling C functions from EasyC

Quote:
Originally Posted by koenig3456
I've written some functions in C using MPLab. The modules include both static data and code. How can I use them in an EasyC project?
I think the answer is wait for next version of EasyC. See thread EasyC Wish List, esp. reply #4.

Regards,
DCBrown
  #3   Spotlight this post!  
Unread 27-01-2006, 13:27
koenig3456 koenig3456 is offline
Programming Coach
None #0681 (EARTH Squad)
Team Role: Coach
 
Join Date: Jan 2006
Location: Pennsylvania
Posts: 16
koenig3456 is an unknown quantity at this point
Smile Re: Calling C functions from EasyC

Thanks for the hint.
I may have figured out a solution. I don't have access to the RC right now, so I can't test it. It does compile and link successfully.

This is what I did:
1. Compile the C code using MPLab.
2. Use mplib.exe to add the .o file to the wpilib.lib in the EasyC folder.
3. Add the header file to EasyC (Options/File Inclusion).
  #4   Spotlight this post!  
Unread 27-01-2006, 15:09
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Calling C functions from EasyC

Clever. I hadn't thought about adding additional .o files to the default library. To use to environments where libraries are protected except for read access.

We have a need for something similar, can't wait to try it.

Regards,
DCBrown
  #5   Spotlight this post!  
Unread 27-01-2006, 16:03
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Calling C functions from EasyC

Tried something similar just now...

1. Use MPLab to create .o object files
2. Use command window, use mplib to create .lib file (mplib /c MyTest.lib)
3. Add .o files to my library (mplib /r MyTest.lib MyTest.o)
3. move a copy of my library MyTest.lib to c:\mcc18\lib so it can be found by EasyC during link time
4. update <processor>.lkr file under EasyC in Frc\18F***\ to reference my library, e.g.

:
FILES clib.lib
FILES p18f8520.lib
FILES MyTest.lib << added this
:

5. Referenced functions/data in MyTest.lib in EasyC... compiled/linked correctly.

Regards,
DCBrown
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyC Wish List dcbrown Programming 32 14-08-2006 09:24
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12
EasyC v. 2.0 - New features, custom user functions, and more! artdutra04 FIRST Tech Challenge 1 02-11-2005 13:36
Updated: Serial Port Driver Code Kevin Watson Programming 4 05-02-2005 18:39


All times are GMT -5. The time now is 19:27.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi