I'm using atmel studio 6.1 with a code containing but on compilation conpiler gives error as mentioned above and after googling error,I found that this variable progmem has been depriciated,but no solution for fixing it. so anyone can plz help me? I'm writing this code for ATmega32 to control GLCD JHD12864E. excerpt of code

#ifndef _FONT_H_
#define _FONT_H_
#include "avr/pgmspace.h"
#include "types.h"


//Main Selected Font
const __progmem__ *font;

void __GFXInitFont();

UINT8 GFXGetFontHeight();

UINT8 __GFXReadFontData(UINT16 add);

UINT8 __GFXReadPGM(const __progmem__ *ptr);

void GFXSetFont(const __progmem__ *new_font);

  • \$\begingroup\$ Since the type specifier/qualifier is deprecated, and your toolchain doesn't understand it, have you tried ... removing it? This code would be more portable if it defined a macro called PROGMEM which conditionally expands to nothing or to __progmem__. Perhaps there is a header file which defines __progmem__. \$\endgroup\$ – Kaz Aug 30 '13 at 6:30
  • \$\begingroup\$ Did you have a link to the LCD library you can post? As Kaz said you can probably remove it but in this case you'll need to add a datatype as well, possibly something like void or uint8_t would do depending on how the library is written. \$\endgroup\$ – PeterJ Aug 30 '13 at 6:58
  • \$\begingroup\$ Yes, there is a header file for that: <avr/pgmspace.h>. It looks like PGM_P is the data type you are looking for. \$\endgroup\$ – JimmyB Aug 30 '13 at 8:42
  • \$\begingroup\$ @PeterJ Progfx provides this library for GLCD whose font.h lib contains this variable type Link for same is progfx.org/download \$\endgroup\$ – shafeeq Aug 30 '13 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.