Closed GOB52 closed 1 year ago
there may be a fix in 1.2.5, it's addressing a similar issue, however the fix is only for an error with ESP32-targz when gzip is enabled and SdFat is used.
the workaround is to evaluate the __has_include
earlier in the flow:
#if __has_include(<foo.hpp>)
#define HAS_FOO
#endif
#include <M5StackUpdater.h>
#if defined HAS_FOO
// foo specific code
#endif
I'm aware it isn't a satisfying solution and still researching, any suggestion is welcome.
This workaround is not a panacea, but it is one solution.
Hopefully 1.2.5 will be a smarter solution.
SdFsFileImpl is the closest thing I could find, and it came with the infamous #undef __has_include
, so maybe it's just optional?
Arduino IDE doesn't seem to complain when I do this, but I suspect platformio will not:
//#undef __has_include
#include <FS.h>
#include <FSImpl.h>
#include <SdFat.h>
//#define __has_include
the smarter solution is probably to create some kind of lgfx::DataWrapper for SdFs, but it is beyond my skills.
I know it's risky, but how about this approach?
#undef __has_include
#include <misc/sdfat32fs_wrapper.h>
#define __has_include(STR) __has_include__(STR)
__hasinclude is defined by \_hasinclude_\
looks like platformio doesn't care when the infamous #undef __has_include
is removed :thinking: so I may remove it completely?
https://github.com/tobozo/M5Stack-SD-Updater/actions/runs/4863851743
PlatformIO Core, version 6.1.6
M5StackUpdater.hpp
If the above part has been compiled, A compile error occurs at subsequent __has_include.