[En-Nut-Discussion] EEPROM space

Przemyslaw Rudy prudy at audiotech.pl
Thu May 20 17:29:08 CEST 2004


Hi
As I understood the first 512 bytes of the EEPROM are reserved for the 
OS purposes (please correct me if I’m I wrong). I was looking roughly at 
the places where EEPROM is accessed and it seems that if some parts of 
the system are not enabled the big part of 512 is unused. It could be 
then provided for the application, but currently there is no way the 
application can recognize the first available EEPROM address. What about 
adding to the NUT a bit flexible solution in form of a simple function 
maintaining the used EEPROM area (not any advanced malloc-like)?
For example:

int acquire_eeprom(int *size)
{
    static int first_available = 0;
    int retval = -1;

    if(*size <= EEPROM_SIZE – first_available)
    {
       retval = first_available;
       first_available += *size;
    }
    else
    {
       *size = EEPROM_SIZE – first_available;
    }
    return retval;
}

Thanks
Przemek




More information about the En-Nut-Discussion mailing list