fabriziop / EEWL

The EEWL library allows to extend the EEPROM life by distributing data writes along a circular buffer.
GNU Lesser General Public License v3.0
10 stars 1 forks source link

Compile error with version 0.6.0 #6

Closed xfacta closed 1 year ago

xfacta commented 1 year ago

Compile error with version 0.6.0 Arduino Mega2560 Arduino IDE 2.1.1

In file included from xxxxxxxxxx\GitHub\Automotive-LCD-Speedo-for-Arduino\Speed_Bar\Speed_Bar.ino:60:0:
xxxxxxxxxx\GitHub\libraries\EEWL\src/eewl.h: In constructor 'EEWL::EEWL(T&, int, int)':
xxxxxxxxxx\GitHub\libraries\EEWL\src/eewl.h:92:7: error: 'buffer' was not declared in this scope
       buffer = (uint8_t *)malloc(end_addr);
       ^~~~~~
xxxxxxxxxx\GitHub\libraries\EEWL\src/eewl.h:92:7: note: suggested alternative: 'diff_r'
       buffer = (uint8_t *)malloc(end_addr);
       ^~~~~~
       diff_r

exit status 1

Compilation error: exit status 1

The suggested alternative is one of my variables and unrelated to EEWL, of course.

Downgrading to 0.5.3 fixes the issue.

Looking in the source it's like #ifdef __AVR__ is not found or being interpreted correctly , and EEWL is trying to use RAM mode ??? Unsure.

My code is here and everything is working as expected with multiple instances of EEWL - thanks for the great work!

https://github.com/xfacta/Automotive-LCD-Speedo-for-Arduino

fabriziop commented 1 year ago

I just uploaded a fix for this problem (v 0.6.1). Give it a try. Thanks for using my work.

xfacta commented 1 year ago

Fixed! v 0.6.1 compiles OK and reads/writes existing EEWL ring buffers