Flash.h errors with Arduino 1.0.6 and Teensy 3.1 (Teensyduino, Version 1.20) -


i have been using flash.h library (http://arduiniana.org/libraries/flash/) version 5 arduino 1.0.5 , teensy 3.1 without issues. had upgrade version 1.0.6 , getting error

[removed path message] /.../libraries/flash/flash.h: in member function 'char* _flash_string::copy(char*, size_t, size_t) const': /.../libraries/flash/flash.h:79:44: error: operands ?: have different types 'int' , 'char*' 

and code in flash.h

char *copy(char *to, size_t size = -1, size_t offset = 0) const    {      return size == -1 ?       strcpy_p(to, _arr + offset) : strncpy_p(to, _arr + offset, size);   } 

at first glance can see operand comparing strcpy , strncpy , both of them return char* not sure why thinks 1 int.

this page has reference 2 functions used http://tuxgraphics.org/common/src2/article12051/avr-libc-user-manual/manual/group__avr__pgmspace.html

any appreciated figure out problem. library test works vailla arduino 1.0.6, when install teensyduino, version 1.20 , try compile teensy 3.1 error. if compile arduino uno works.

thanks in advance

i found answer on pjrc forum. applied code changes , worked me. reference url: http://forum.pjrc.com/threads/26156-teensy-3-1-and-tinywebserver-library?highlight=flash.h

changed from

char *copy(char *to, size_t size = -1, size_t offset = 0) const  {    return size == -1 ?   strcpy_p(to, _arr + offset) : strncpy_p(to, _arr + offset, size); } 

to

void *copy(char *to, size_t size = -1, size_t offset = 0) const  {  if (size == -1) strcpy_p(to, _arr + offset);  else strncpy_p(to, _arr + offset, size); } 

hope helps using flash.h library


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -