Skip to content

Commit 524d352

Browse files
author
James Foster
committed
Add EEPROM_SIZE to mega boards.
1 parent d82c1cf commit 524d352

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

SampleProjects/TestSomething/test/eeprom.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ unittest(length)
99
assertEqual(EEPROM_SIZE, EEPROM.length());
1010
}
1111

12-
#else
13-
14-
unittest(eeprom)
15-
{
16-
assertTrue(true);
17-
}
18-
1912
#endif
2013

2114
unittest_main()

cpp/arduino/avr/iomxx0_1.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,17 @@
351351
Last two letters: EEAR address. */
352352
#define __EEPROM_REG_LOCATIONS__ 1F2021
353353

354+
/* According to https://ww1.microchip.com/downloads/en/devicedoc/atmel-2549-8-bit-avr-microcontroller-atmega640-1280-1281-2560-2561_datasheet.pdf,
355+
* the Atmel ATmega640/V-1280/V-1281/V-2560/V-2561/V microcontrollers each have
356+
* 4Kbytes of EEPROM and since this file is included from things that seem
357+
* to match that description, it would be helpful to know that EEPROM is
358+
* available and know its size. This macro is defined for many other models,
359+
* so we will add it here.
360+
*
361+
* See https://github.com/Arduino-CI/arduino_ci/issues/166#issuecomment-703904394.
362+
*/
363+
#define EEPROM_SIZE (4096)
364+
354365
#define GTCCR _SFR_IO8(0x23)
355366
#define TSM 7
356367
#define PSRASY 1

0 commit comments

Comments
 (0)