Skip to content

Commit df8fe37

Browse files
committed
Add README
1 parent 916227e commit df8fe37

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
LibAVRpp
2+
========
3+
4+
A high-level but efficient C++20 library for your AVR project.
5+
6+
# EEPROM\_var
7+
8+
Accessing variables stored in the EEPROM as they were normal variables. Also support for arrays.
9+
10+
## Example
11+
Array of function pointers
12+
```C++
13+
#include<eeprom_var.hpp>
14+
15+
const avr::eeprom_array animations [[gnu::section(".eeprom")]] = {fade, onoff<1000>, onoff<500>, rotate<1000>};
16+
17+
void function(){
18+
const decltype(teszt)::value_type act_anim = teszt[anim_index];
19+
act_anim();
20+
}
21+
```
22+
Simple integer in EEPROM (it is accessed through a *'reference'*)
23+
```C++
24+
#include<eeprom_var.hpp>
25+
26+
const uint16_t example [[gnu::section(".eeprom")]] = 7;
27+
28+
void function(){
29+
avr::eeprom_ref example_ref {&example};
30+
uint16_t a = 5 + example_ref;
31+
}
32+
```
33+

0 commit comments

Comments
 (0)