1
\$\begingroup\$

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_
#define __PROG_TYPES_COMPAT__
#include "avr/pgmspace.h"
#include "types.h"

//Constants
#define FONT_OFFSET_WIDTH 2
#define FONT_OFFSET_HEIGHT 3
#define FONT_OFFSET_FIRSTCHAR 4
#define FONT_OFFSET_CHARCOUNT 5
#define FONT_OFFSET_WTABLE 6

//Main Selected Font
const __progmem__ *font;

//Functions
void __GFXInitFont();

UINT8 GFXGetFontHeight();

UINT8 __GFXReadFontData(UINT16 add);

UINT8 __GFXReadPGM(const __progmem__ *ptr);

void GFXSetFont(const __progmem__ *new_font);

#endif
\$\endgroup\$
  • \$\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.