Jump to content
edeca

Using The Idx Compiler Option

Recommended Posts

I am trying to compile some code with an array like this:

 

const rom unsigned char Font[96][7]

 

I have seen some previous posts that are obviously trying to use similar code, but none seem to cover the idx compiler option. The initial compilation error is:

 

ks0108b.c(275): error: total number of array elements can not exceed 0x100 (use -idx 2 compiler command line argument to remove this restriction)
ks0108b.c(275:37): error: only 8 bit pointers or one-dimensional arrays can have 'rom' storage type

 

But even after the option is added, the compiler doesn't recognise it:

 

warning: unrecognized command line agrument '-idx', skipped
..
C:\Program Files (x86)\SourceBoost\boostc_pic18.exe" ks0108b.c -t PIC18F2321 -idx 2

 

The manual suggests this is a v7+ feature, which obviously isn't available yet. Is there any workaround, or do I have to wait for v7 to compile this code?

Share this post


Link to post
Share on other sites

7 arrays of 96 chars is possibly the best solution for now.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites
7 arrays of 96 chars is possibly the best solution for now.

 

Well that's an unfortunate pain. Will this be fixed in v7? If so, I can probably hang around and wait a while (it was imminent in February).

 

If not, well, I haven't needed 2k code yet so I hadn't paid up. Which means I should start looking around and seeing what quirks other compilers have.

Share this post


Link to post
Share on other sites
7 arrays of 96 chars is possibly the best solution for now.

 

Well that's an unfortunate pain. Will this be fixed in v7? If so, I can probably hang around and wait a while (it was imminent in February).

 

If not, well, I haven't needed 2k code yet so I hadn't paid up. Which means I should start looking around and seeing what quirks other compilers have.

 

Yes this will be fixed in v7. In fact we plan to make this feature available in the very first v7 pre-release whenever it becomes available.

 

In v6 you'll have to split your big arrays into a number of smaller arrays or use any other algorithm that can split data into smaller chunks.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

You could try doing some ugly stuff like this while you are waiting for the compiler to support larger address offsets:

 

// const rom unsigned char Font[96][7];

const rom unsigned char Font0[32][7];
const rom unsigned char Font1[32][7];
const rom unsigned char Font2[32][7];

void DisplayChar(unsigned char Index)
{
unsigned char FontId,FontIndex;

  FontId = Index>>5;
  FontIndex = Index & 0x1f;

switch(FontId){
   case 0:
	   DoYourThing(Font0[FontIndex]);
	   break;
   case 1:
	   DoYourThing(Font1[FontIndex]);
	   break;
   case 2:
	   DoYourThing(Font2[FontIndex]);
	   break;
 }
}

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...