Thread: EasyC Wish List
View Single Post
  #3   Spotlight this post!  
Unread 24-01-2006, 17:46
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: EasyC Wish List

Quote:
Originally Posted by BradAMiller
The next version of EasyC that should be available soon will let you create external functions in MPLab and add them to the linked image. There is already an option to add a header file (.h) so you might try creating those tables in MPLab, then creating a function in the same MPLab module with the "rom" storage class identifier that returns the result to the EasyC program.

I'm still having problems. I might not fully understand what you are suggesting.

I created a .h file of:

#ifndef LOOKUP_H
int mytable[4] = {1,2,3,4};
#endif
#ifdef LOOKUP_H
extern int mytable[];
#endif
#define LOOKUP_H

and did a file inclusion. The problem I've run across is that it must be compiled multiple times into the project. The project won't link, I get multiple defines at link time. If I put an error into the include file I get seven syntax errors. I don't know if that means it is compiled into 7 different modules or not. I could make the table static and that does link cleanly, but that means mytable[] is replicated multiple times in the system.

Our real lookup table could be a couple kbytes in size, having this replicated in the system a bunch of times might not be a good thing.

Looking for additional guidance.

Thanks,
DCBrown