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 #if HASP_USE_OTA > 0
#include "sys/svc/hasp_ota.h" #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 #endif
#if HASP_USE_TASMOTA_CLIENT > 0 #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 #if TFT_WIDTH>=320 || TFT_WIDTH>=480
#ifdef WT32SC01 // #ifdef WT32SC01
#ifndef HASP_FONT_1 // #ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_16_ascii /* 5% Width */ // #define HASP_FONT_1 robotocondensed_regular_16_ascii /* 5% Width */
#endif // #endif
#ifndef HASP_FONT_2 // #ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_24_ascii /* 5% Width */ // #define HASP_FONT_2 robotocondensed_regular_24_ascii /* 5% Width */
#endif // #endif
#ifndef HASP_FONT_3 // #ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_32_ascii /* 10% Width */ // #define HASP_FONT_3 robotocondensed_regular_32_ascii /* 10% Width */
#endif // #endif
#ifndef HASP_FONT_4 // #ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_48_ascii /* 10% Height */ // #define HASP_FONT_4 robotocondensed_regular_48_ascii /* 10% Height */
#endif // #endif
#ifndef ROBOTOCONDENSED_REGULAR_16_ASCII // #ifndef ROBOTOCONDENSED_REGULAR_16_ASCII
#define ROBOTOCONDENSED_REGULAR_16_ASCII 1 // #define ROBOTOCONDENSED_REGULAR_16_ASCII 1
#endif // #endif
#ifndef ROBOTOCONDENSED_REGULAR_24_ASCII // #ifndef ROBOTOCONDENSED_REGULAR_24_ASCII
#define ROBOTOCONDENSED_REGULAR_24_ASCII 1 // #define ROBOTOCONDENSED_REGULAR_24_ASCII 1
#endif // #endif
#ifndef ROBOTOCONDENSED_REGULAR_32_ASCII // #ifndef ROBOTOCONDENSED_REGULAR_32_ASCII
#define ROBOTOCONDENSED_REGULAR_32_ASCII 1 // #define ROBOTOCONDENSED_REGULAR_32_ASCII 1
#endif // #endif
#ifndef ROBOTOCONDENSED_REGULAR_48_ASCII // #ifndef ROBOTOCONDENSED_REGULAR_48_ASCII
#define ROBOTOCONDENSED_REGULAR_48_ASCII 1 // #define ROBOTOCONDENSED_REGULAR_48_ASCII 1
#endif // #endif
#else // not WT32SC01 // #else // not WT32SC01
#ifndef HASP_FONT_1 #ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_16_latin1 /* 5% Width */ #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 #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
#endif #endif
#endif // WT32SC01 //#endif // WT32SC01
#ifndef HASP_FONT_SIZE_1 #ifndef HASP_FONT_SIZE_1
#define HASP_FONT_SIZE_1 16 #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 ; -- Platform specific build flags
[esp32] [esp32]
framework = arduino framework = arduino
platform = espressif32@^3.2.0 platform = espressif32@^3.2.1
board_upload.flash_size=4MB board_upload.flash_size=4MB
board_upload.maximum_size = 4194304 board_upload.maximum_size = 4194304

View File

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

View File

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

View File

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

View File

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

View File

@ -14,6 +14,9 @@ build_flags =
${esp32.build_flags} ${esp32.build_flags}
${esp32.ps_ram} ${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 ------------------------ ;region -- TFT_eSPI build options ------------------------
${lcd.wt32-sc01} ${lcd.wt32-sc01}
-D WT32SC01 -D WT32SC01