Skip to content

Commit

Permalink
Some improvements for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
dbambus committed Oct 27, 2024
1 parent 3efe532 commit 8131c28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ lib_deps =
extra_scripts = pre:extra_scripts.py

[env:esp32dev]
platform = espressif32
platform = espressif32 @ 6.9.0
board = esp32dev
board_build.partitions = partitions_singleapp_large.csv
framework = arduino
Expand All @@ -44,7 +44,7 @@ build_flags =
lib_deps =
makuna/NeoPixelBus@^2.7.6
bblanchon/ArduinoJson@^6.17.2
links2004/[email protected]
links2004/WebSockets@^2.4.1
adafruit/RTClib@^1.11.2
knolleary/PubSubClient@^2.8.0
https://github.com/tzapu/WiFiManager#v2.0.17
Expand Down
17 changes: 2 additions & 15 deletions src/Wortuhr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <coredecls.h>
#include <sntp.h>
#elif defined(ESP32)
#include <ESPmDNS.h>
#include <HTTPUpdateServer.h>
#include <Update.h>
#include <WebServer.h>
#include <WiFi.h>
#include <esp_sntp.h>
#endif
#include <NeoPixelBus.h>
#include <RTClib.h>
#include <WiFiClient.h>
#include <WiFiUdp.h>
#include <Wire.h>
#include <sntp.h>

#include "Uhr.h"

Expand Down Expand Up @@ -89,20 +90,6 @@ uint16_t powerCycleCount = 0; // Variable to store power cycle count

//------------------------------------------------------------------------------

uint32_t sntp_startup_delay_MS_rfc_not_less_than_60000() {
if (externalRTC) {
Serial.println("SNTP startup delay 1min");
return 60000;
} else {
// yes this is against the RFC, but we don't have an RTC and want the
// time now.
Serial.println("no RTC clock - disable SNTP startup delay");
return 500;
}
}

//------------------------------------------------------------------------------

void time_is_set() {
time_t utc = time(nullptr);
if (externalRTC) {
Expand Down

0 comments on commit 8131c28

Please sign in to comment.