diff --git a/src/definefs.hpp b/src/definefs.hpp new file mode 100644 index 0000000..e9cb4af --- /dev/null +++ b/src/definefs.hpp @@ -0,0 +1,20 @@ +#pragma once +#ifndef USEDFS +# if defined(ESP32) +# ifdef USE_LITTLEFS +# if ESP_IDF_VERSION_MAJOR < 4 +# include +# define USEDFS LITTLEFS +# else +# include +# define USEDFS LittleFS +# endif +# else +# include +# define USEDFS SPIFFS +# endif +# else +# include +# define USEDFS LittleFS +# endif +#endif diff --git a/src/sysvars.hpp b/src/sysvars.hpp index 6fd48c3..972d8c2 100644 --- a/src/sysvars.hpp +++ b/src/sysvars.hpp @@ -8,26 +8,7 @@ #include #include #include -// TODO: predelat na definefs.hpp, ale to pak vytvori zavislost na ESPFoundation :-( -#ifndef USEDFS -# if defined(ESP32) -# ifdef USE_LITTLEFS -# if ESP_IDF_VERSION_MAJOR < 4 -# include -# define USEDFS LITTLEFS -# else -# include -# define USEDFS LittleFS -# endif -# else -# include -# define USEDFS SPIFFS -# endif -# else -# include -# define USEDFS LittleFS -# endif -#endif +#include "definefs.hpp" enum { SV_OK = 0,