Help with string and pointers please

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a function ( used a lot on other micros ) to print to an LCD module.
Following code works fine:

print_line(0,"scnmsg"); // test !!!

But this sticks the text into Data space ( Ram )

I have text that I keep in Prom space e.g

const char noevmsg [17] PROGMEM= {"No Event "};

but I'm unsuccesful in using:

print_line(1,(char*) noevmsg);

Something seems not to like taking my text from Prom space and using it ( I get garbage ). - Any clues would be appreciated.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This tutorial should help:
AVR GCC and the PROGMEM attribute

Regards,
Steve A.

The Board helps those that help themselves.