[HELP]problem with eeprom...

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi,
i'm working on my first project in C on a ATmega8 (actually it's a porting of an asm project in C).
i've got some problems when i read a data from the eeprom (i can't understend where i'm wrong)

:cry:
the piece of code is:

Quote:

#include
#include
#include

void readEeprom(void)
{
uint8_t eepromData;
...

//read idCube
eeprom_busy_wait();
eepromData = eeprom_read_byte((uint8_t*)6);
if (eepromData == 0xff)
idCube = idCubeDefault; (*)
else
idCube = eepromData;
...
}

and i get the following error:

Quote:

../MicrelCube3_2.c:352: error: expected expression before '=' token

on the line with the (*)

i just can't figure out what's wrong...
thx,
b.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you have idCube defined and then declared somewhere? Header file?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,
i've defined idCube, in my header, but because of the source project in asm i had definitions like:
#deine idCube = 1
and that '=' caused all my troubles...
thx for the help,
b.