Skip to content

Commit

Permalink
Better oappend shim on ESP8266
Browse files Browse the repository at this point in the history
Detect IRAM pointers if we can't be sure.
  • Loading branch information
willmmiles committed Oct 23, 2024
1 parent a0e81da commit 4cc3726
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wled00/fcn_declare.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()) or print(SET_F()) 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 {
Expand Down

0 comments on commit 4cc3726

Please sign in to comment.