Fix dependencies and typos

This commit is contained in:
fvanroie 2020-11-29 23:10:27 +01:00
parent 02dcb4ff9d
commit 046d4f3ec6
9 changed files with 26 additions and 7 deletions

View File

@ -107,10 +107,11 @@
#if HASP_USE_LITTLEFS > 0
#if defined(ARDUINO_ARCH_ESP32)
#include "LITTLEFS.h"
#endif
#elif defined(ARDUINO_ARCH_ESP8266)
#include <FS.h> // Include the FS library
#include "hasp_filesystem.h"
#endif
#endif
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)

View File

@ -185,7 +185,11 @@ typedef void* lv_fs_drv_user_data_t;
#if LV_USE_FS_IF
# define LV_FS_IF_FATFS '\0'
# define LV_FS_IF_PC '\0'
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
# define LV_FS_IF_SPIFFS 'E' // internal esp Flash
#else
# define LV_FS_IF_SPIFFS '\0' // no internal esp Flash
#endif
#endif /*LV_USE_FS_IF*/
#endif

View File

@ -580,8 +580,8 @@ void haspLoadPage(const char * pages)
#if HASP_USE_EEPROM > 0
Log.notice(TAG_HASP, F("Loading jsonl from EEPROM..."));
EepromStream eepromStream(4096, 1024);
dispatchJsonl(eepromStream);
Log.tr(TAG_HASP, F("Loaded jsonl from EEPROM"));
dispatch_parse_jsonl(eepromStream);
Log.trace(TAG_HASP, F("Loaded jsonl from EEPROM"));
#endif
#endif

View File

@ -59,7 +59,6 @@ void haspSetPage(uint8_t id);
uint8_t haspGetPage();
void haspClearPage(uint16_t pageid);
String haspGetNodename();
void haspGetVersion(char* version,size_t len);
void haspBackground(uint16_t pageid, uint16_t imageid);

View File

@ -14,6 +14,8 @@
#include "hasp_object.h"
#include "hasp_gui.h"
#include "hasp_oobe.h"
#include "hasp_mqtt.h"
#include "hasp_gpio.h"
#include "hasp_hal.h"
#include "hasp.h"
@ -30,6 +32,8 @@ bool is_true(const char * s)
void dispatch_screenshot(const char *, const char * filename)
{
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
if(strlen(filename) == 0) { // no filename given
char tempfile[32];
memcpy_P(tempfile, PSTR("/screenshot.bmp"), sizeof(tempfile));
@ -39,12 +43,17 @@ void dispatch_screenshot(const char *, const char * filename)
} else { // Valid filename
guiTakeScreenshot(filename);
}
#else
Log.warning(TAG_MSGR, "Failed to save %s, no storage", filename);
#endif
}
// Format filesystem and erase EEPROM
bool dispatch_factory_reset()
{
bool formated, erased = true;
bool formated = true;
bool erased = true;
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
formated = HASP_FS.format();
@ -149,9 +158,12 @@ void dispatch_command(const char * topic, const char * payload)
// char item[5];
// memset(item, 0, sizeof(item));
// strncpy(item, topic + 4, 4);
#if HASP_USE_MQTT > 0
DynamicJsonDocument settings(45);
settings[topic + 4] = payload;
mqttSetConfig(settings.as<JsonObject>());
#endif
} else {
if(strlen(payload) == 0) {

View File

@ -10,7 +10,7 @@
#include "hasp_debug.h"
#include "hasp_network.h"
#if HASP_USE_ETHERNET > 0
#if HASP_USE_ETHERNET > 0 && defined(ARDUINO_ARCH_ESP32)
IPAddress ip;

View File

@ -4,6 +4,8 @@
#include <Arduino.h>
#include "ArduinoJson.h"
#include "ArduinoLog.h"
#include "hasp_debug.h"
#include "hasp_conf.h"
#include "hasp_hal.h"

View File

@ -303,7 +303,7 @@ static void mqtt_message_cb(char * topic, byte * payload, unsigned int length)
snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstatus"), mqttNodeTopic);
snprintf_P(msg, sizeof(msg), PSTR("ON"));
bool res = mqttClient.publish(tmp_topic, msg, true);
/*bool res =*/ mqttClient.publish(tmp_topic, msg, true);
}
} else {

View File

@ -7,6 +7,7 @@
#include "hasp_conf.h"
#include "hasp_hal.h"
#include "hasp_debug.h"
#include "hasp_mdns.h"
#include "hasp.h"
#if HASP_USE_ETHERNET > 0 || HASP_USE_WIFI > 0