IPB

Welcome Guest ( Log In | Register )

> Moving From Rom Char* To Char*
fred
post Dec 11 2007, 08:40 PM
Post #1


Enthusiast
**

Group: EstablishedMember
Posts: 100
Joined: 1-December 06
From: Netherlands
Member No.: 2,116



I have several arrays (LCD bitmaps) stored in rom memory because there is not enough ram to hold them all.
Optimized my code as much as possible but still running out of rom memory a little bit unfortunately....

There's enough ram left to move a few of the arraytables back to ram which would solve my problem.

In a switch construction I'm assigning the appropriate table to a variable but here I have to deal with the problem that the types do not match anymore..

to illustrate my problem
CODE
rom unsigned char *lcd_CW16bData1 = {
    0x0,0x88,
    0x1,0x10,
    0x2,0x20,
    0x70,0x40,
    0xF8,0x86,
    0x0,0x0,
    0x0,0x0
};

rom unsigned char *lcd_CW16bData2 = {
    0x0,0x88,
    0x1,0x10,
    0x2,0x20,
    0x70,0x40,
    0xF8,0x86,
    0x0,0x0,
    0x0,0x0
};

rom unsigned char *lcd_CW16bData3 = {
    0x0,0x88,
    0x1,0x10,
    0x2,0x20,
    0x70,0x40,
    0xF8,0x86,
    0x0,0x0,
    0x0,0x0
};

unsigned char lcd_CW16bData99[14] = {
    0x0,0x88,
    0x1,0x10,
    0x2,0x20,
    0x70,0x40,
    0xF8,0x86,
    0x0,0x0,
    0x0,0x0
};

//etc.

rom unsigned char *table;
switch (condition ) {
   case 0:
        table= lcd_CW16bData1;
        break;

   case 4:
        table= lcd_CW16bData2;
        break;

   case 5:
        table= lcd_CW16bData3;
        break;
   default:
       table=lcd_CW16bData99;
  // etc.
};
  display(table);


In this example I moved lcd_CW16bData99 from rom to Ram data.

This generates the next error(s) dry.gif
warning: conversion from 'unsigned char[]' to 'rom unsigned char*'
internal error: failed to generate assignment expression
error: failed to generate expression

Is there a (simple) way to get around this..?
update SourceBoost release 6.97 is available.
Download Now
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 3rd September 2010 - 02:49 PM