[En-Nut-Discussion] Ethernut 3.9.9 - error on build
William Basser
wbasser at cyberinteg.com
Mon Dec 12 16:19:57 CET 2005
If the EEPROM base address is moved from 0 in the config file, an error is
generated in file
Nut/os/confoos.c, line 76. the code exceprt is shown below. It complains
that the second argument in eeprom_read_block is not properly cast.
I added the specific cast, int* to the function and got a clean build.
ASIS:
int NutLoadConfig(void)
{
#if !defined(__linux__) && !defined(__APPLE__) && !defined(__CYGWIN__) &&
!defined(__arm__)
eeprom_read_block(&confos, (CONFOS_EE_OFFSET), sizeof(CONFOS));
if (confos.size != sizeof(CONFOS) || confos.magic[0] != 'O' ||
confos.magic[1] != 'S') {
return -1;
}
#endif
return 0;
}
MOD:
int NutLoadConfig(void)
{
#if !defined(__linux__) && !defined(__APPLE__) && !defined(__CYGWIN__) &&
!defined(__arm__)
eeprom_read_block(&confos, ((int*)CONFOS_EE_OFFSET), sizeof(CONFOS));
if (confos.size != sizeof(CONFOS) || confos.magic[0] != 'O' ||
confos.magic[1] != 'S') {
return -1;
}
#endif
return 0;
}
Bill Basser
More information about the En-Nut-Discussion
mailing list