Better oappend shim on ESP8266

Detect IRAM pointers if we can't be sure.
This commit is contained in:
Will Miles 2024-09-27 22:33:20 -04:00
parent 6d1126b8aa
commit 2a094883ad

View File

@ -324,6 +324,10 @@ class Usermod {
protected:
// Shim for oappend(), which used to exist in utils.cpp
template<typename T> static inline void oappend(const T& t) { oappend_shim->print(t); };
#ifdef ESP8266
// Handle print(PSTR()) without crashing by detecting PROGMEM strings
static void oappend(const char* c) { if ((intptr_t) c >= 0x40000000) oappend_shim->print(FPSTR(c)); else oappend_shim->print(c); };
#endif
};
class UsermodManager {