Skip to content

Commit

Permalink
Define correct size for EEPROM
Browse files Browse the repository at this point in the history
This was previously hardcoded to a single value, but is now derived from
the STM32 chip-specific header files.
  • Loading branch information
matthijskooijman committed Nov 4, 2020
1 parent 1446bb4 commit ef8a828
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cores/arduino/avr/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@
#ifndef _IO_H_
#define _IO_H_

#include "stm32l0xx.h"

#define RAMSTART 0x20000000
#define RAMSIZE (20 * 1024)
#define RAMEND (RAMSTART + RAMSIZE - 1)

#define E2END 0xfff
#if defined(DATA_EEPROM_BASE) && defined(DATA_EEPROM_END)
#define E2END (DATA_EEPROM_END - DATA_EEPROM_BASE)
#elif defined(DATA_EEPROM_BASE) && defined(DATA_EEPROM_BANK2_BASE) && defined(DATA_EEPROM_BANK1_END) && defined(DATA_EEPROM_BANK2_END)
#define E2END (DATA_EEPROM_BANK1_END - DATA_EEPROM_BASE + 1 + DATA_EEPROM_BANK2_END - DATA_EEPROM_BANK2_BASE)
#else
#error "Cannot determine EEPROM size"
#endif


#endif

0 comments on commit ef8a828

Please sign in to comment.