Hi,
I want to use the PTP library to use a camera with the USB host shield 2.0. First step was to build the example PTPDevInfo with Arduino 1.6.5 ide. But the compiler stops with an error
devinfoparser.cpp:145:38: error: variable 'DevInfoParser::imNames' must be const
in order to be put into read-only section by means of '__attribute__((progmem))'
const char* DevInfoParser::imNames[] PROGMEM =
In the source I can see that an array is filled with values out of the flash.
const char msgEXIF_JPEG [] PROGMEM = "EXIF_JPEG";
const char msgTIFF_EP [] PROGMEM = "TIFF_EP";
const char msgFlashPix [] PROGMEM = "FlashPix";
const char msgBMP [] PROGMEM = "BMP";
const char msgCIFF [] PROGMEM = "CIFF";
const char msgUndefined_0x3806 [] PROGMEM = "Undefined_0x3806";
const char msgGIF [] PROGMEM = "GIF";
const char msgJFIF [] PROGMEM = "JFIF";
const char msgPCD [] PROGMEM = "PCD";
const char msgPICT [] PROGMEM = "PICT";
const char msgPNG [] PROGMEM = "PNG";
const char msgUndefined_0x380C [] PROGMEM = "Undefined_0x380C";
const char msgTIFF [] PROGMEM = "TIFF";
const char msgTIFF_IT [] PROGMEM = "TIFF_IT";
const char msgJP2 [] PROGMEM = "JP2";
const char msgJPX [] PROGMEM = "JPX";
...
...
const char* DevInfoParser::imNames[] PROGMEM =
{
msgUndefined,
msgEXIF_JPEG,
msgTIFF_EP,
msgFlashPix,
msgBMP,
msgCIFF,
msgUndefined_0x3806,
msgGIF,
msgJFIF,
msgPCD,
msgPICT,
msgPNG,
msgUndefined_0x380C,
msgTIFF,
msgTIFF_IT,
msgJP2,
msgJPX,
};
I try to fix the problem with the help of PROGMEM reference. But I got no luck
const char* const DevInfoParser::imNames[] PROGMEM =
{
msgUndefined,
...
results in
devinfoparser.cpp:145:44: error: declaration of 'const char* DevInfoParser::imNames []'
outside of class is not definition [-fpermissive] const char* const DevInfoParser::imNames[] PROGMEM =
Has someone an idea how to fix it?
Thanks
Mark