PDA

View Full Version : T3: compile error flash library



mercapto
01-24-2013, 08:31 AM
Hi,
I try to use the flash library (http://http://playground.arduino.cc/interfacing/flash) on a teensy 3. But I get a compiler error (Teensy3 Beta 12):
/home/jstadler/LIN/Programme/Code/arduino/Sketchbook/libraries/Flash/Flash.h: In member function 'size_t _FLASH_STRING::length() const':
/home/jstadler/LIN/Programme/Code/arduino/Sketchbook/libraries/Flash/Flash.h:65:25: error: 'strlen_P' was not declared in this scope
/home/jstadler/LIN/Programme/Code/arduino/Sketchbook/libraries/Flash/Flash.h: In member function 'char* _FLASH_STRING::copy(char*, size_t, size_t) const':
/home/jstadler/LIN/Programme/Code/arduino/Sketchbook/libraries/Flash/Flash.h:70:70: error: 'strncpy_P' was not declared in this scope


If I include arduino-1.0.3/hardware/tools/avr/lib/avr/include/avr/pgmspace.h in my code, where I found the strlen_P definition, I get:

/home/jstadler/LIN/Programme/Code/arduino/Sketchbook/libraries/Flash/Flash.h: In member function 'char _FLASH_STRING::operator[](int) const':
/home/jstadler/LIN/Programme/Code/arduino/Sketchbook/libraries/Flash/Flash.h:80:30: error: cast from 'const prog_char* {aka const char*}' to 'uint16_t {aka short unsigned int}' loses precision [-fpermissive]

On a teensy2 it's working without the include of pgmspace.h

Joerg