arduino / arduino/ArduinoCore-avr

EEMEM variable initialization not performed

Open
#256 8 comments 0 reactions 1 assignee Claimed by @cmaglie View on GitHub
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

A practical method of allocating and initiating a variable in eeprom is to use the AVR EEMEM attribute (short form for a GCC function attribute). Unfortunately the initialization gets lost in the build/upload process in Arduino.

uint8_t foo EEMEM = 42;

eeprom_read_byte((const uint8_t*) &foo); // will return 255 and not 42

Cheers!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.