C, C++, and __flash/PROGMEM

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

C++ folk have notoriously (?) fused to implement the "named address spaces" that are in recent versions of avr-gcc, and make using PROGMEM somewhat more pleasant, using "__flash"

 

Can you mix/link C code that uses __flash with C++ modules that don't understand it?

 

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

Sure you can do it that way. In fact to benefit from __flash that is the way you would have to do it. But you are going to probably need "accessors" and the const data may have to be passed to the C++ in RAM based copies it can access OK. (but obviously it does not have to necessarily copy out the entire const data - just some element(s) from within a larger dataset).