return 0xff;
}
-unsigned char readbyte_eeprom(unsigned int p, unsigned int *sum)
+unsigned char readbyte_eeprom(unsigned int *p, unsigned int *sum)
{
unsigned char b;
ClrWdt();
- b = eeprom_readbyte(p);
+ b = eeprom_readbyte(*p);
*sum = calcsum_byte(*sum, b);
+ *p = *p + 1;
return b;
}
-unsigned int readword_eeprom(unsigned int p, unsigned int *sum)
+unsigned int readword_eeprom(unsigned int *p, unsigned int *sum)
{
unsigned char h,l;
unsigned int s;
// ClrWdt();
h = readbyte_eeprom(p, sum);
- l = readbyte_eeprom(p + 1, sum);
+ l = readbyte_eeprom(p, sum);
s = (h << 8) | l;
return s;
return 0xff;
}
-unsigned int writebyte_eeprom(unsigned int p, unsigned int *sum, unsigned char b)
+unsigned int writebyte_eeprom(unsigned int *p, unsigned int *sum, unsigned char b)
{
ClrWdt();
- if(eeprom_writebyte(p, b) == 0) return p; // Error
+ if(eeprom_writebyte(*p, b) == 0) return *p; // Error
*sum = calcsum_byte(*sum, b);
+ *p = *p + 1;
return 0xffff;
}
-unsigned int writeword_eeprom(unsigned int p, unsigned int *sum, unsigned int word)
+unsigned int writeword_eeprom(unsigned int *p, unsigned int *sum, unsigned int word)
{
// ClrWdt();
- if(writebyte_eeprom(p, sum, word >> 8) == 0) return p; // Error
- if(writebyte_eeprom(p + 1, sum, word & 0xff) == 0) return p + 1; // Error
+ if(writebyte_eeprom(p, sum, word >> 8) == 0) return *p; // Error
+ if(writebyte_eeprom(p, sum, word & 0xff) == 0) return *p; // Error
return 0xffff;
}
// p = p + 1;
}
_CLS();
- _LOCATE(0,0);
+// _LOCATE(0,0);
return 0xffff; // Normal end
}