Skip to content

Commit e7f49f0

Browse files
committed
[EEPROM] Fix address capablilities
Address was limited to 65Kb while on some STM32 series, sector size use could be higher Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent 32e92d3 commit e7f49f0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cores/arduino/stm32/stm32_eeprom.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static uint8_t eeprom_buffer[E2END] = {0};
101101
* @param pos : address to read
102102
* @retval byte : data read from eeprom
103103
*/
104-
uint8_t eeprom_read_byte(const uint16_t pos) {
104+
uint8_t eeprom_read_byte(const uint32_t pos) {
105105
eeprom_buffer_fill();
106106
return eeprom_buffered_read_byte(pos);
107107
}
@@ -112,7 +112,7 @@ uint8_t eeprom_read_byte(const uint16_t pos) {
112112
* @param value : value to write
113113
* @retval none
114114
*/
115-
void eeprom_write_byte(uint16_t pos, uint8_t value) {
115+
void eeprom_write_byte(uint32_t pos, uint8_t value) {
116116
eeprom_buffered_write_byte(pos, value);
117117
eeprom_buffer_flush();
118118
}
@@ -122,7 +122,7 @@ void eeprom_write_byte(uint16_t pos, uint8_t value) {
122122
* @param pos : address to read
123123
* @retval byte : data read from eeprom
124124
*/
125-
uint8_t eeprom_buffered_read_byte(const uint16_t pos) {
125+
uint8_t eeprom_buffered_read_byte(const uint32_t pos) {
126126
return eeprom_buffer[pos];
127127
}
128128

@@ -132,7 +132,7 @@ uint8_t eeprom_buffered_read_byte(const uint16_t pos) {
132132
* @param value : value to write
133133
* @retval none
134134
*/
135-
void eeprom_buffered_write_byte(uint16_t pos, uint8_t value) {
135+
void eeprom_buffered_write_byte(uint32_t pos, uint8_t value) {
136136
eeprom_buffer[pos] = value;
137137
}
138138

cores/arduino/stm32/stm32_eeprom.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@
5555
/* Exported macro ------------------------------------------------------------*/
5656
/* Exported functions ------------------------------------------------------- */
5757

58-
uint8_t eeprom_read_byte(const uint16_t pos);
59-
void eeprom_write_byte(uint16_t pos, uint8_t value);
58+
uint8_t eeprom_read_byte(const uint32_t pos);
59+
void eeprom_write_byte(uint32_t pos, uint8_t value);
6060

6161
void eeprom_buffer_fill();
6262
void eeprom_buffer_flush();
63-
uint8_t eeprom_buffered_read_byte(const uint16_t pos);
64-
void eeprom_buffered_write_byte(uint16_t pos, uint8_t value);
63+
uint8_t eeprom_buffered_read_byte(const uint32_t pos);
64+
void eeprom_buffered_write_byte(uint32_t pos, uint8_t value);
6565

6666
#ifdef __cplusplus
6767
}

0 commit comments

Comments
 (0)