Is it possible to determine at runtime whether a pointer points to
PROGMEM'ed values or regular values? This would give some flexibility when writing code that handles both.
Not really, if you are asking whether you can determine (simply from its value) whether 0x100 is in RAM or PROGMEM. Both are possible candidates for a memory location.
F() macro works around this by changing the type of a variable at compile-time, so that the compiler can select a suitable method of printing. For example:
Serial.println ("Hello, world"); Serial.println (F("Hello, world"));
In this case the appropriate
println function is chosen at compile-time by the compiler, based on the type (one would be a
const char *, the other a
You are best off designing a way (similar to the
F() macro) where you can make the decision at compile time.