[En-Nut-Discussion] How do I convert PROGMEM(gcc) to ICCAVR? (Please)

Brett Abbott Brett.Abbott at digital-telemetry.com
Fri Jun 17 14:45:23 CEST 2005


Hi

Im porting the Flash sample application by Dusan Ferbas to ICCAVR but 
have hit a gcc function Im unaware of.  Could I ask if someone could 
advise the ICCAVR equivalent of PROGMEM?  I include the definition below 
which gives an error in ICCAVR - Im unsure of what the correct syntax 
should be.  Ive also included a function using it.

Any help very greatfully appreciated.

Thanks in advance
Brett

from eeparams.c (flash Project)
//************************************
// EEPROM upgrade/downgrade routines
//************************************
ee_tbl_data ee_tbl_def_P PROGMEM = {    // THIS LINE GIVES THE ERROR
    {
     EEPROM_TBL_PTRN,
     offsetof(ee_tbl_data, e_elem),
     EE_VAR_NUM,
     {{{0x00, 0x0a, 0x59, 0x63, 0x08, 0x27}
       }
      }
     /* default which will be overloaded, see below
      * - loading MAC from non table version
      * - preserving MAC  */
     }
    ,

    EE_VPTRN,

    {
     {EE_VAR_BAUDRATE, CFG_ITEM_LEN(BaudRate), CFG_ITEM_OFFS(BaudRate)}
     ,
     {EE_VAR_DATA_LENGTH, CFG_ITEM_LEN(DataLength), 
CFG_ITEM_OFFS(DataLength)}
     ,
     {EE_VAR_STOP_BITS, CFG_ITEM_LEN(StopBits), CFG_ITEM_OFFS(StopBits)}
     ,
     {EE_VAR_PARITY, CFG_ITEM_LEN(Parity), CFG_ITEM_OFFS(Parity)}
     ,
     {EE_VAR_COMM_TIMEOUT, CFG_ITEM_LEN(CommTimeout), 
CFG_ITEM_OFFS(CommTimeout)}
     ,

     {EE_VAR_IPA, CFG_ITEM_LEN(aux_my_ip_addr), 
CFG_ITEM_OFFS(aux_my_ip_addr)}
     ,
     {EE_VAR_MASK, CFG_ITEM_LEN(aux_my_ip_mask), 
CFG_ITEM_OFFS(aux_my_ip_mask)}
     ,
     {EE_VAR_GW, CFG_ITEM_LEN(aux_gw_ip_addr), 
CFG_ITEM_OFFS(aux_gw_ip_addr)}
     ,
     {EE_VAR_HTTP_PORT, CFG_ITEM_LEN(http_port), CFG_ITEM_OFFS(http_port)}
     ,
     {EE_VAR_USER_SETTINGS, CFG_ITEM_LEN(UserSettings), 
CFG_ITEM_OFFS(UserSettings)}
     }
};

static u_char eeprom_upgrade(register const ee_tbl * old_tablep,
                             ee_tbl_data * ee_tbl_defp, u_char init_flg)
{
    u_char  tbl_upgrade[EE_VAR_NUM];
    /* these values has been read from previous table */
    u_char  ee_pass = 1;

    memset(tbl_upgrade, 0, sizeof(tbl_upgrade));
    /* assume nothing read from previous version */
    memset(gBoardDatap, 0, sizeof(BoardDataS));
    /* reset EEPROM contents to a known state (better for debugging) */


-- 
-----------------------------------------------------------------
Brett Abbott, Managing Director, Digital Telemetry Limited
Email: Brett.Abbott at digital-telemetry.com
PO Box 24 036 Manners Street, Wellington, New Zealand
Phone +64 (4) 5666-860  Mobile +64 (21) 656-144
------------------- Commercial in confidence --------------------






More information about the En-Nut-Discussion mailing list