SPIFlash library compile error in Arduino IDE

Started by marinanova, February 08, 2015, 04:54:46 PM

marinanova

Hi community,

I'm newbie in the Moteino hardware and software. I hope to explain my problem in the right way. Feel free to ask for more information.

I have Arduino IDE 1.0.6 installed in Windows XP. I have downloaded and installed de RFM69 and the SPIFlash libraries in the right way as explained in the tutorials.

When I compile the "Node" example project or the "Gateway" example project I have the next error message from the Arduino IDE:
==================================
Arduino: 1.0.6 (Windows XP), Board: "Moteino"
...\Arduino\libraries\SPIFlash\SPIFlash.cpp: In member function 'void SPIFlash::writeBytes(long int, const void*, uint16_t)':
...\Arduino\libraries\SPIFlash\SPIFlash.cpp:211: error: pointer of type 'void *' used in arithmetic
==================================

Doing extensive searching in the web I have reached the conclusion that in the SPIFlash library function "SPIFlash::writeBytes" the compiler doesn't know what increment and decrement should mean to the variable "buf" as it doesn't know the size of type the pointer is pointing to (this variable is declared as "void* buf").

I replaced the function declaration with this: "void SPIFlash::writeBytes(long addr, const char* buf, uint16_t len)" instead of "void* buf" (in the SPIFlash.cpp and SPIFlash.h files) and the compiler works fine.

My question: is this the right way to avoid this Arduino IDE compiler error? Comments are appreciated.

Thanks in advance,
Marinanova

TomWS

It would be useful if you include YOUR code that is producing this error message.  It seems unlikely that you need to rework any library code at this point.

Tom

Felix

There was a bug in the library, it's fixed now, my apologies.
Please get latest and try again.

TomWS

#3
Whoops. My bad.  Thanks for fixing, Felix.  Odd that it worked for me...  I'll need to check into why.

Tom
UPDATE: It would have failed for me with transfers >32K, but the difference might be the IDE version.  I was using 1.5.7.
My apologies, Marinanova.

marinanova

Hi guys,

Thanks Felix. Everything works fine. Fast and painless ;).

Don't worry Tom ;D.

Marinanova