Use uint8_t in EEPROM code
This commit is contained in:
@ -96,7 +96,7 @@ void eeprom_init() {
|
||||
}
|
||||
}
|
||||
|
||||
void eeprom_write_byte(unsigned char *pos, unsigned char value) {
|
||||
void eeprom_write_byte(uint8_t *pos, unsigned char value) {
|
||||
uint16_t eeprom_address = (unsigned) pos;
|
||||
|
||||
eeprom_init();
|
||||
@ -110,7 +110,7 @@ void eeprom_write_byte(unsigned char *pos, unsigned char value) {
|
||||
HAL_FLASH_Lock();
|
||||
}
|
||||
|
||||
unsigned char eeprom_read_byte(unsigned char *pos) {
|
||||
uint8_t eeprom_read_byte(uint8_t *pos) {
|
||||
uint16_t data = 0xFF;
|
||||
uint16_t eeprom_address = (unsigned)pos;
|
||||
|
||||
|
@ -212,8 +212,8 @@ uint8_t spiRec(uint32_t chan);
|
||||
* TODO: Write all this eeprom stuff. Can emulate eeprom in flash as last resort.
|
||||
* Wire library should work for i2c eeproms.
|
||||
*/
|
||||
void eeprom_write_byte(unsigned char *pos, unsigned char value);
|
||||
unsigned char eeprom_read_byte(unsigned char *pos);
|
||||
void eeprom_write_byte(uint8_t *pos, unsigned char value);
|
||||
uint8_t eeprom_read_byte(uint8_t *pos);
|
||||
void eeprom_read_block (void *__dst, const void *__src, size_t __n);
|
||||
void eeprom_update_block (const void *__src, void *__dst, size_t __n);
|
||||
|
||||
|
@ -55,7 +55,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
|
||||
|
||||
bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing) {
|
||||
do {
|
||||
uint8_t c = eeprom_read_byte((unsigned char*)pos);
|
||||
uint8_t c = eeprom_read_byte((uint8_t*)pos);
|
||||
if (writing) *value = c;
|
||||
crc16(crc, &c, 1);
|
||||
pos++;
|
||||
|
Reference in New Issue
Block a user