Jump to content
evplasmaman

Structures And Strings In Rom

Recommended Posts

Hello everyone,

 

I am having a trouble getting my structure in to ROM. It seems to work fine if I put it in to RAM but when I try to change it to ROM it doesn't store the data...

I do get a few warnings saying:

 

Coff generation: Internal Warning: Member Var:menuItem Unrecognised type id:0xF000000F

Coff generation: Internal Warning: Member Var:comand Unrecognised type id:0xF000000F

Coff generation: Internal Warning: Member Var:menuItem Unrecognised type id:0xF000000F

Coff generation: Internal Warning: Member Var:comand Unrecognised type id:0xF000000F

 

But I am unsure of what these mean...

 

The code that works in RAM is:

 

typedef struct MenuTag {
char *menuItem;
char comand;
} Menu;

Menu menuTest[] = {
{"Menu", 		0x00},	
{"Graph", 		0x00},
{"Dat",	 	0x00},
{"Min Max", 	0x00},
{"Settings", 	0x00},
{"", 			0xFF},
};

 

 

What I tried to do was adding the ROM command

typedef struct MenuTag {
rom char *menuItem;
rom char comand;
} Menu;

Menu menuTest[] = {
{"Menu", 		0x00},	
{"Graph", 		0x00},
{"Dat",	 	0x00},
{"Min Max", 	0x00},
{"Settings", 	0x00},
{"", 			0xFF},
};

 

 

If some one would be kind enough to point out where I might be going wrong I would be very grateful.

 

Jos Goble

Share this post


Link to post
Share on other sites

I think you may be pushing BoostC beyond its limit with this one Jos.

 

Replacing rom with const in MikroC does exactly what you want to do. I shouldn't say that though.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

According to the BoostC manual (page 43), rom variables have to be initialized within they're declaration.

 

Your struct has both rom variables declared, but you are initializing them when you create menuTest. That violates how rom variables must be used.

 

They may be a work around you can figure out, but it may end up bloating your code to the point where it wasn't worth it.

 

I hope this helps.

 

- Bill

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...