Disable ArduinoOTA on WT32-SC01

This commit is contained in:
fvanroie 2021-06-12 00:50:14 +02:00
parent 2f33550aac
commit 6f81434615
8 changed files with 49 additions and 35 deletions

View File

@ -235,13 +235,6 @@ static WiFiSpiClass WiFi;
#if HASP_USE_OTA > 0
#include "sys/svc/hasp_ota.h"
#ifndef HASP_OTA_PORT
#if defined(ARDUINO_ARCH_ESP32)
#define HASP_OTA_PORT 3232
#elif defined(ARDUINO_ARCH_ESP8266)
#define HASP_OTA_PORT 8266
#endif
#endif
#endif
#if HASP_USE_TASMOTA_CLIENT > 0

View File

@ -349,35 +349,35 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
#if TFT_WIDTH>=320 || TFT_WIDTH>=480
#ifdef WT32SC01
// #ifdef WT32SC01
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_16_ascii /* 5% Width */
#endif
#ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_24_ascii /* 5% Width */
#endif
#ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_32_ascii /* 10% Width */
#endif
#ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_48_ascii /* 10% Height */
#endif
// #ifndef HASP_FONT_1
// #define HASP_FONT_1 robotocondensed_regular_16_ascii /* 5% Width */
// #endif
// #ifndef HASP_FONT_2
// #define HASP_FONT_2 robotocondensed_regular_24_ascii /* 5% Width */
// #endif
// #ifndef HASP_FONT_3
// #define HASP_FONT_3 robotocondensed_regular_32_ascii /* 10% Width */
// #endif
// #ifndef HASP_FONT_4
// #define HASP_FONT_4 robotocondensed_regular_48_ascii /* 10% Height */
// #endif
#ifndef ROBOTOCONDENSED_REGULAR_16_ASCII
#define ROBOTOCONDENSED_REGULAR_16_ASCII 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_24_ASCII
#define ROBOTOCONDENSED_REGULAR_24_ASCII 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_32_ASCII
#define ROBOTOCONDENSED_REGULAR_32_ASCII 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_48_ASCII
#define ROBOTOCONDENSED_REGULAR_48_ASCII 1
#endif
// #ifndef ROBOTOCONDENSED_REGULAR_16_ASCII
// #define ROBOTOCONDENSED_REGULAR_16_ASCII 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_24_ASCII
// #define ROBOTOCONDENSED_REGULAR_24_ASCII 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_32_ASCII
// #define ROBOTOCONDENSED_REGULAR_32_ASCII 1
// #endif
// #ifndef ROBOTOCONDENSED_REGULAR_48_ASCII
// #define ROBOTOCONDENSED_REGULAR_48_ASCII 1
// #endif
#else // not WT32SC01
// #else // not WT32SC01
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_16_latin1 /* 5% Width */
@ -405,7 +405,7 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
#endif
#endif // WT32SC01
//#endif // WT32SC01
#ifndef HASP_FONT_SIZE_1
#define HASP_FONT_SIZE_1 16

View File

@ -91,7 +91,7 @@ src_filter = +<*> -<.git/> -<examples/> -<test/> -<tests/> -<stm32f4/> -<lv_font
; -- Platform specific build flags
[esp32]
framework = arduino
platform = espressif32@^3.2.0
platform = espressif32@^3.2.1
board_upload.flash_size=4MB
board_upload.maximum_size = 4194304

View File

@ -32,7 +32,9 @@ void networkStart(void)
debugStartSyslog();
// mqttStart();
httpStart();
#if HASP_USE_MDNS > 0
mdnsStart();
#endif // HASP_USE_MDNS
}
void networkStop(void)

View File

@ -6,6 +6,12 @@
#include "ArduinoJson.h"
#if defined(ARDUINO_ARCH_ESP32)
#include <WiFi.h>
#elif defined(ARDUINO_ARCH_ESP8266)
#include <ESP8266WiFi.h>
#endif
void wifiSetup();
bool wifiShowAP();
bool wifiShowAP(char* ssid, char* pass);

View File

@ -16,6 +16,9 @@
#include <ESP8266httpUpdate.h>
#include <ESP8266WiFi.h>
#include <ArduinoOTA.h>
#ifndef HASP_OTA_PORT
#define HASP_OTA_PORT 3232
#endif
#endif
#if defined(ARDUINO_ARCH_ESP32)
@ -23,6 +26,9 @@
#include <HTTPUpdate.h>
#include <WiFi.h>
#include <ArduinoOTA.h>
#ifndef HASP_OTA_PORT
#define HASP_OTA_PORT 8266
#endif
/**
* This is lets-encrypt-x3-cross-signed.pem
@ -118,6 +124,7 @@ void otaOnProgress(unsigned int progress, unsigned int total)
}
}
#if HASP_USE_OTA > 0
void otaSetup(void)
{
if(strlen(otaUrl.c_str())) {
@ -209,6 +216,7 @@ void otaEverySecond(void)
{
if(otaPrecentageComplete >= 0) otaProgress();
}
#endif
void otaHttpUpdate(const char* espOtaUrl)
{ // Update ESP firmware from HTTP

View File

@ -10,9 +10,11 @@
#include <ArduinoOTA.h>
/* ===== Default Event Processors ===== */
#if HASP_USE_OTA > 0
void otaSetup(void);
IRAM_ATTR void otaLoop(void);
void otaEverySecond(void);
#endif
/* ===== Special Event Processors ===== */
void otaHttpUpdate(const char* espOtaUrl);

View File

@ -14,6 +14,9 @@ build_flags =
${esp32.build_flags}
${esp32.ps_ram}
-D HASP_USE_MDNS=1 ; saves 32 KiB flash
-D HASP_USE_OTA=0 ; No ArduinoOTA on port 3232
;region -- TFT_eSPI build options ------------------------
${lcd.wt32-sc01}
-D WT32SC01