[9XR-PRO] Only the first 64k EEPROM could be written because of uint16_t
This commit is contained in:
@@ -624,7 +624,7 @@ void StopEepromThread()
|
|||||||
if (fp) fclose(fp);
|
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);
|
assert(size);
|
||||||
|
|
||||||
@@ -639,7 +639,7 @@ void eepromReadBlock (uint8_t * pointer_ram, uint16_t pointer_eeprom, uint16_t s
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#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);
|
assert(size);
|
||||||
|
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ void StopEepromThread();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern const char * eepromFile;
|
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_enable(...) sleep(1/*ms*/)
|
||||||
#define wdt_reset() sleep(1/*ms*/)
|
#define wdt_reset() sleep(1/*ms*/)
|
||||||
|
|||||||
@@ -292,8 +292,8 @@ void usbStop(void);
|
|||||||
|
|
||||||
// I2C driver: EEPROM + Audio Volume
|
// I2C driver: EEPROM + Audio Volume
|
||||||
void i2cInit(void);
|
void i2cInit(void);
|
||||||
void eepromReadBlock(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, uint16_t address, uint16_t size);
|
void eepromWriteBlock(uint8_t * buffer, uint32_t address, uint32_t size);
|
||||||
|
|
||||||
// Debug driver
|
// Debug driver
|
||||||
void debugPutc(const char c);
|
void debugPutc(const char c);
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ bool I2C_EE_ReadBlock(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t NumByteToRea
|
|||||||
return true;
|
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)) {
|
while (!I2C_EE_ReadBlock(pBuffer, ReadAddr, NumByteToRead)) {
|
||||||
i2cInit();
|
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.
|
* @param NumByteToWrite : number of bytes to write to the EEPROM.
|
||||||
* @retval None
|
* @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 offset = WriteAddr % I2C_FLASH_PAGESIZE;
|
||||||
uint8_t count = I2C_FLASH_PAGESIZE - offset;
|
uint8_t count = I2C_FLASH_PAGESIZE - offset;
|
||||||
|
|||||||
Reference in New Issue
Block a user