mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-05-05 21:45:52 +00:00
Merge pull request #3059 from proddy/core3
fix warning "esp32-hal-gpio.c:181] __digitalWrite(): IO 2 is not set …
This commit is contained in:
@@ -840,20 +840,17 @@ void System::button_init() {
|
|||||||
|
|
||||||
// set the LED to on or off when in normal operating mode
|
// set the LED to on or off when in normal operating mode
|
||||||
void System::led_init() {
|
void System::led_init() {
|
||||||
// disabled old led port before setting new one
|
if (!led_gpio_) { // 0 means disabled
|
||||||
led_type_ ? EMSESP_RGB_WRITE(led_gpio_, 0, 0, 0) : digitalWrite(led_gpio_, !LED_ON);
|
LOG_INFO("LED disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ((led_gpio_)) { // 0 means disabled
|
|
||||||
if (led_type_) {
|
if (led_type_) {
|
||||||
// rgb LED WS2812B, use Neopixel
|
|
||||||
EMSESP_RGB_WRITE(led_gpio_, 0, 0, 0);
|
EMSESP_RGB_WRITE(led_gpio_, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
pinMode(led_gpio_, OUTPUT);
|
pinMode(led_gpio_, OUTPUT);
|
||||||
digitalWrite(led_gpio_, !LED_ON); // start with LED off
|
digitalWrite(led_gpio_, !LED_ON); // start with LED off
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
LOG_INFO("LED disabled");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void System::uart_init() {
|
void System::uart_init() {
|
||||||
|
|||||||
@@ -372,13 +372,11 @@ void WebStatusService::getVersions(JsonObject root) {
|
|||||||
// schedule the next versions.json fetch a few seconds out so the network stack has time to settle
|
// schedule the next versions.json fetch a few seconds out so the network stack has time to settle
|
||||||
// (DHCP completion, default-netif assignment and DNS server propagation through lwip)
|
// (DHCP completion, default-netif assignment and DNS server propagation through lwip)
|
||||||
void WebStatusService::schedule_versions_refresh() {
|
void WebStatusService::schedule_versions_refresh() {
|
||||||
#ifndef EMSESP_STANDALONE
|
|
||||||
uint32_t next = uuid::get_uptime() + VERSIONS_INITIAL_FETCH_DELAY_MS;
|
uint32_t next = uuid::get_uptime() + VERSIONS_INITIAL_FETCH_DELAY_MS;
|
||||||
if (next == 0) {
|
if (next == 0) {
|
||||||
next = 1; // 0 is the "idle" sentinel — never let the wrap land there
|
next = 1; // 0 is the "idle" sentinel — never let the wrap land there
|
||||||
}
|
}
|
||||||
versions_next_fetch_ms_ = next;
|
versions_next_fetch_ms_ = next;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// periodic refresh (1 hour) of the cached versions.json
|
// periodic refresh (1 hour) of the cached versions.json
|
||||||
|
|||||||
Reference in New Issue
Block a user