I need some help to resolve a "section type conflict" in an arduino program I am writing. I have a short example code that produces the error:
#include <glcd.h>
#include "M2tk.h"
#include "utility/m2ghglcd.h"
#include "bitmaps/allBitmaps.h"
// Definitions of Main Menu
M2_LABEL(el_label_MainMenu,NULL,"Main Menu");
// Construct Main Menu List
M2_LIST(list_main_menu) = {&el_label_MainMenu};
M2_VLIST(el_list_main_menu,NULL,list_main_menu);
M2_ALIGN(el_main_menu, "W64H64", &el_list_main_menu);
M2tk m2(&el_main_menu, m2_es_arduino, m2_eh_4bd, m2_gh_glcd_ffs);
void setup() {
GLCD.Init(); // initialise the library
GLCD.DrawBitmap(ArduinoIcon64x32, 32,0); //draw the bitmap at the given x,y position
delay(3000);
GLCD.ClearScreen();
}
void loop() {
m2.checkKey();
m2.draw();
}
I'm trying to create a splash screen for my menu driven program. I have a feeling it has something to do with the PROGMEM definition of the arduino Icon image. They are defined as part of the standard GLCD library. I'm not really sure what is wrong or how to fix it.
The exact error message is:
C:\Users\Dirk\Documents\Arduino\libraries\glcd/bitmaps/ArduinoIcon64x32.h:25: error: ArduinoIcon64x32 causes a section type conflict
It doesn't like something in how ArduinoIcon64x32 is defined. This is how the image file is defined:
#ifndef _ArduinoIcon64x32_H
#define _ArduinoIcon64x32_H
#include <inttypes.h>
#include <avr/pgmspace.h>
static unsigned char ArduinoIcon64x32[] PROGMEM ={
64, // bitmap width (arduino glcdlib format)
32, // bitmap height (arduino glcdlib format)
0x00, 0x00, 0xc0, 0x20, 0x10, 0x08, 0xc8, 0x88, 0x08, 0x08, 0x10, 0x20, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xf8, 0xf8, 0xf8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x40,
0x70, 0x0c, 0x30, 0xc0, 0x00, 0xc0, 0x30, 0x0c, 0x30, 0xc0, 0x00, 0xc0, 0x30, 0x08, 0x88, 0x48,
0x28, 0x28, 0xf8, 0x20, 0x20, 0x40, 0x80, 0x40, 0x20, 0x10, 0x20, 0x98, 0x18, 0xc0, 0xc0, 0x00,
0x00, 0x07, 0x18, 0x20, 0x40, 0x80, 0x9f, 0x8f, 0x87, 0x82, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00,
0x00, 0x00, 0x80, 0xf0, 0xfe, 0xff, 0xff, 0x1f, 0x03, 0x1f, 0xff, 0xff, 0xfc, 0xf0, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1c, 0x63, 0x80, 0x46,
0x4a, 0x52, 0xe3, 0x52, 0x4a, 0x46, 0x80, 0x63, 0x1c, 0x02, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0xc0, 0x30, 0x08, 0x04, 0xe2, 0x22, 0x22, 0x22, 0xe2, 0x04, 0x08, 0x30, 0xc0, 0x00, 0x00,
0xe0, 0xfc, 0xff, 0xff, 0x7f, 0x7f, 0x78, 0x78, 0x78, 0x78, 0x78, 0x7f, 0x7f, 0xff, 0xff, 0xfc,
0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x02, 0x02, 0xff, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x06, 0x08, 0x10, 0x23, 0x22, 0x22, 0x22, 0x23, 0x10, 0x08, 0x06, 0x01, 0x18, 0x3f,
0x3f, 0x3f, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, 0x3f,
0x3f, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x0a, 0x0a, 0x2b, 0x0a, 0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#endif //define _ArduinoIcon64x32_H
Any pointers and help you could offer or an alternate method to generate the splash screen would be appreciated.
PROGMEM
? The cause may be due to a conflict between the type of the variable, which may be implicit from the way it is initalised, and other variables declared using the samePROGMEM
attribute. – Grume