Hi Coding Badly,
you are right. I will try to give more information.
To fix the error I described in my last post I defined the variables 'framebase' and 'framask' as constants.
qrencode.cpp:
extern const unsigned char framebase[] PROGMEM;
extern const unsigned char framask[] PROGMEM;
qrframe.cpp:
const unsigned char framebase[] PROGMEM = {
0xFE, 0x03, 0xF8, 0x82, 0x02, 0x08, 0xBA, 0x02,
0xE8, 0xBA, 0x02, 0xE8, 0xBA, 0x02, 0xE8, 0x82,
0x02, 0x08, 0xFE, 0xAB, 0xF8, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x80, 0x00, 0xFE, 0x00, 0x00, 0x82, 0x00, 0x00,
0xBA, 0x00, 0x00, 0xBA, 0x00, 0x00, 0xBA, 0x00,
0x00, 0x82, 0x00, 0x00, 0xFE, 0x00, 0x00,
};
const unsigned char framask[] PROGMEM = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x10, 0x04,
0x00, 0x80, 0x08, 0x1F, 0xF0, 0x7F, 0xC0, 0xFF,
0x80, 0xFF, 0x80, 0x7F, 0xC0, 0x1F, 0xF0, 0x03,
0xFE, 0x00, 0x3F, 0xE0, 0x00,
};
With the changes I got this error messages:
qrencode.cpp.o: In function `ismasked':
C:\Users\David\AppData\Local\Temp\build3828410659722439733.tmp/qrencode.cpp:230: undefined reference to `framask'
C:\Users\David\AppData\Local\Temp\build3828410659722439733.tmp/qrencode.cpp:230: undefined reference to `framask'
qrencode.cpp.o: In function `fillframe':
C:\Users\David\AppData\Local\Temp\build3828410659722439733.tmp/qrencode.cpp:239: undefined reference to `framebase'
C:\Users\David\AppData\Local\Temp\build3828410659722439733.tmp/qrencode.cpp:239: undefined reference to `framebase'
If I just remove the 'PROGMEM' modifiers the code is compilable but it produces the following result which isn't a valid QR-code:
P1
21 21
1 0 0 0 0 0 0 0 1 1 0 0 0 1 0 1 1 0 0 0 0
0 0 1 0 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1
1 1 1 0 1 1 0 0 1 0 0 1 0 1 0 0 1 0 1 1 1
0 1 1 0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 0 0
1 1 0 1 1 1 0 0 0 0 1 1 0 1 1 0 0 1 0 0 1
0 1 0 1 1 0 1 1 1 1 1 0 1 0 0 1 1 1 0 0 0
1 1 0 0 1 1 1 1 0 0 0 1 1 0 1 1 1 1 1 1 0
1 1 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 0 0 1 1
1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 1 1 1 1 1 1
1 0 0 1 0 1 0 1 1 0 0 1 0 1 1 1 0 0 0 0 0
1 1 0 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 1
1 1 0 1 0 0 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1
1 0 0 1 1 1 0 0 0 0 1 1 0 1 0 1 0 1 0 0 0
1 0 1 0 0 1 0 0 1 0 1 1 1 1 0 1 0 0 1 1 0
0 1 0 0 0 1 0 0 1 0 1 1 1 1 1 1 0 1 0 0 1
1 0 0 1 1 0 1 0 1 0 1 0 1 1 1 0 0 1 0 1 0
1 0 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1 1 0 0 0
0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1 1
0 1 1 1 1 0 1 0 1 0 0 0 1 1 1 0 0 0 1 1 0
1 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0
0 0 1 1 0 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 1