The only errors I get are,
C:\Projects\BoostC\Flowcode.c(516:10): error: unknown identifier 'address'
C:\Projects\BoostC\Flowcode.c(516:10): error: invalid operand 'address'
C:\Projects\BoostC\Flowcode.c(516:8): error: failed to generate expression
C:\Projects\BoostC\Flowcode.c(528:10): error: unknown identifier 'address'
C:\Projects\BoostC\Flowcode.c(528:10): error: invalid operand 'address'
C:\Projects\BoostC\Flowcode.c(528:8): error: failed to generate expression
And these are caused by a mismatch in the routines I posted.
Code:
char FCD_EEPROM0_EEPROMRead(short [COLOR=red]addr[/COLOR])
{
eecon1=0; //ensure CFGS=0 and EEPGD=0
eeadr = [COLOR=red]address[/COLOR]; //setup address
eecon1.RD = 1; //do actual read
return(eedata); //and return data
}
void FCD_EEPROM0_WriteEEPROM(short [COLOR=red]addr[/COLOR], char data)
{
char SaveInt;
SaveInt=intcon; //save interrupt status
eecon1=0; //ensure CFGS=0 and EEPGD=0
eecon1.WREN = 1; //enable write to EEPROM
eeadr = [COLOR=red]address[/COLOR]; //setup Address
eedata = data; //and data
intcon.GIE=0; //No interrupts
eecon2 = 0x55; //required sequence #1
eecon2 = 0xaa; //#2
eecon1.WR = 1; //#3 = actual write
intcon=SaveInt; //restore interrupts
while(!pir2.EEIF); //wait until finished
eecon1.WREN = 0; //disable write to EEPROM
}
The bits in red have to match so change them all to either addr or address.
Mike.