[9XR-PRO] Only the first 64k EEPROM could be written because of uint16_t

This commit is contained in:
Bertrand Songis
2015-08-03 22:36:57 +02:00
parent 151fb59e27
commit 3f6621b087
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -624,7 +624,7 @@ void StopEepromThread()
if (fp) fclose(fp);
}
void eepromReadBlock (uint8_t * pointer_ram, uint16_t pointer_eeprom, uint16_t size)
void eepromReadBlock (uint8_t * pointer_ram, uint32_t pointer_eeprom, uint32_t size)
{
assert(size);
@@ -639,7 +639,7 @@ void eepromReadBlock (uint8_t * pointer_ram, uint16_t pointer_eeprom, uint16_t s
}
#if defined(PCBTARANIS)
void eepromWriteBlock(uint8_t * pointer_ram, uint16_t pointer_eeprom, uint16_t size)
void eepromWriteBlock(uint8_t * pointer_ram, uint32_t pointer_eeprom, uint32_t size)
{
assert(size);
+1 -1
View File
@@ -372,7 +372,7 @@ void StopEepromThread();
#endif
extern const char * eepromFile;
void eepromReadBlock (uint8_t * pointer_ram, uint16_t address, uint16_t size);
void eepromReadBlock (uint8_t * pointer_ram, uint32_t address, uint32_t size);
#define wdt_enable(...) sleep(1/*ms*/)
#define wdt_reset() sleep(1/*ms*/)
+2 -2
View File
@@ -292,8 +292,8 @@ void usbStop(void);
// I2C driver: EEPROM + Audio Volume
void i2cInit(void);
void eepromReadBlock(uint8_t * buffer, uint16_t address, uint16_t size);
void eepromWriteBlock(uint8_t * buffer, uint16_t address, uint16_t size);
void eepromReadBlock(uint8_t * buffer, uint32_t address, uint32_t size);
void eepromWriteBlock(uint8_t * buffer, uint32_t address, uint32_t size);
// Debug driver
void debugPutc(const char c);
+2 -2
View File
@@ -110,7 +110,7 @@ bool I2C_EE_ReadBlock(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t NumByteToRea
return true;
}
void eepromReadBlock(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t NumByteToRead)
void eepromReadBlock(uint8_t* pBuffer, uint32_t ReadAddr, uint32_t NumByteToRead)
{
while (!I2C_EE_ReadBlock(pBuffer, ReadAddr, NumByteToRead)) {
i2cInit();
@@ -125,7 +125,7 @@ void eepromReadBlock(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t NumByteToRead
* @param NumByteToWrite : number of bytes to write to the EEPROM.
* @retval None
*/
void eepromWriteBlock(uint8_t* pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite)
void eepromWriteBlock(uint8_t* pBuffer, uint32_t WriteAddr, uint32_t NumByteToWrite)
{
uint8_t offset = WriteAddr % I2C_FLASH_PAGESIZE;
uint8_t count = I2C_FLASH_PAGESIZE - offset;