mirror of
https://github.com/esphome/esphome.git
synced 2025-11-01 15:41:52 +00:00
Compare commits
9 Commits
2025.9.0b3
...
jesserockz
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46492fc875 | ||
|
|
098a360f88 | ||
|
|
5f43e5e5d8 | ||
|
|
297dea4080 | ||
|
|
03fd82b903 | ||
|
|
65f741516b | ||
|
|
3941f16465 | ||
|
|
df60eef583 | ||
|
|
ffbecd105c |
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -290,6 +290,10 @@ jobs:
|
||||
name: Run script/clang-tidy for ESP32 IDF
|
||||
options: --environment esp32-idf-tidy --grep USE_ESP_IDF
|
||||
pio_cache_key: tidyesp32-idf
|
||||
- id: clang-tidy
|
||||
name: Run script/clang-tidy for LibreTiny
|
||||
options: --environment bk72xx-arduino --grep USE_LIBRETINY
|
||||
pio_cache_key: tidylibretiny
|
||||
|
||||
steps:
|
||||
- name: Check out code from GitHub
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "debug_component.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/version.h"
|
||||
#include <cinttypes>
|
||||
#include <climits>
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/version.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace debug {
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "preferences.h"
|
||||
|
||||
void setup();
|
||||
void loop();
|
||||
|
||||
namespace esphome {
|
||||
|
||||
void IRAM_ATTR HOT yield() { ::yield(); }
|
||||
@@ -27,7 +24,7 @@ void arch_init() {
|
||||
|
||||
void arch_restart() {
|
||||
lt_reboot();
|
||||
while (1) {
|
||||
while (true) {
|
||||
}
|
||||
}
|
||||
void IRAM_ATTR HOT arch_feed_wdt() { lt_wdt_feed(); }
|
||||
|
||||
@@ -11,12 +11,12 @@ static const char *const TAG = "lt.component";
|
||||
|
||||
void LTComponent::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "LibreTiny:");
|
||||
ESP_LOGCONFIG(TAG, " Version: %s", LT_BANNER_STR + 10);
|
||||
ESP_LOGCONFIG(TAG, " Version: %s", <_BANNER_STR[10]);
|
||||
ESP_LOGCONFIG(TAG, " Loglevel: %u", LT_LOGLEVEL);
|
||||
|
||||
#ifdef USE_TEXT_SENSOR
|
||||
if (this->version_ != nullptr) {
|
||||
this->version_->publish_state(LT_BANNER_STR + 10);
|
||||
this->version_->publish_state(<_BANNER_STR[10]);
|
||||
}
|
||||
#endif // USE_TEXT_SENSOR
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifdef USE_LIBRETINY
|
||||
|
||||
#include "esphome/core/preferences.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include <flashdb.h>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace libretiny {
|
||||
@@ -74,7 +74,7 @@ class LibreTinyPreferences : public ESPPreferences {
|
||||
|
||||
void open() {
|
||||
//
|
||||
fdb_err_t err = fdb_kvdb_init(&db, "esphome", "kvs", NULL, NULL);
|
||||
fdb_err_t err = fdb_kvdb_init(&db, "esphome", "kvs", nullptr, nullptr);
|
||||
if (err != FDB_NO_ERR) {
|
||||
LT_E("fdb_kvdb_init(...) failed: %d", err);
|
||||
} else {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#ifdef USE_LIBRETINY
|
||||
|
||||
#include "uart_component_libretiny.h"
|
||||
#include "esphome/core/application.h"
|
||||
#include "esphome/core/defines.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "uart_component_libretiny.h"
|
||||
|
||||
#ifdef USE_LOGGER
|
||||
#include "esphome/components/logger/logger.h"
|
||||
@@ -53,27 +53,25 @@ void LibreTinyUARTComponent::setup() {
|
||||
bool tx_inverted = tx_pin_ != nullptr && tx_pin_->is_inverted();
|
||||
bool rx_inverted = rx_pin_ != nullptr && rx_pin_->is_inverted();
|
||||
|
||||
if (false)
|
||||
return;
|
||||
#if LT_HW_UART0
|
||||
else if ((tx_pin == -1 || tx_pin == PIN_SERIAL0_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL0_RX)) {
|
||||
if ((tx_pin == -1 || tx_pin == PIN_SERIAL0_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL0_RX)) {
|
||||
this->serial_ = &Serial0;
|
||||
this->hardware_idx_ = 0;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#if LT_HW_UART1
|
||||
else if ((tx_pin == -1 || tx_pin == PIN_SERIAL1_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL1_RX)) {
|
||||
if ((tx_pin == -1 || tx_pin == PIN_SERIAL1_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL1_RX)) {
|
||||
this->serial_ = &Serial1;
|
||||
this->hardware_idx_ = 1;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#if LT_HW_UART2
|
||||
else if ((tx_pin == -1 || tx_pin == PIN_SERIAL2_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL2_RX)) {
|
||||
if ((tx_pin == -1 || tx_pin == PIN_SERIAL2_TX) && (rx_pin == -1 || rx_pin == PIN_SERIAL2_RX)) {
|
||||
this->serial_ = &Serial2;
|
||||
this->hardware_idx_ = 2;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
else {
|
||||
{
|
||||
#if LT_ARD_HAS_SOFTSERIAL
|
||||
this->serial_ = new SoftwareSerial(rx_pin, tx_pin, rx_inverted || tx_inverted);
|
||||
#else
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
#ifdef USE_WIFI
|
||||
#ifdef USE_LIBRETINY
|
||||
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/err.h"
|
||||
#include <utility>
|
||||
#include "lwip/dns.h"
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
#include "esphome/core/application.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/application.h"
|
||||
#include "esphome/core/util.h"
|
||||
|
||||
namespace esphome {
|
||||
@@ -120,9 +120,9 @@ bool WiFiComponent::wifi_sta_connect_(const WiFiAP &ap) {
|
||||
|
||||
s_sta_connecting = true;
|
||||
|
||||
WiFiStatus status = WiFi.begin(ap.get_ssid().c_str(), ap.get_password().empty() ? NULL : ap.get_password().c_str(),
|
||||
WiFiStatus status = WiFi.begin(ap.get_ssid().c_str(), ap.get_password().empty() ? nullptr : ap.get_password().c_str(),
|
||||
ap.get_channel().has_value() ? *ap.get_channel() : 0,
|
||||
ap.get_bssid().has_value() ? ap.get_bssid()->data() : NULL);
|
||||
ap.get_bssid().has_value() ? ap.get_bssid()->data() : nullptr);
|
||||
if (status != WL_CONNECTED) {
|
||||
ESP_LOGW(TAG, "esp_wifi_connect failed! %d", status);
|
||||
return false;
|
||||
@@ -453,7 +453,7 @@ bool WiFiComponent::wifi_start_ap_(const WiFiAP &ap) {
|
||||
|
||||
yield();
|
||||
|
||||
return WiFi.softAP(ap.get_ssid().c_str(), ap.get_password().empty() ? NULL : ap.get_password().c_str(),
|
||||
return WiFi.softAP(ap.get_ssid().c_str(), ap.get_password().empty() ? nullptr : ap.get_password().c_str(),
|
||||
ap.get_channel().value_or(1), ap.get_hidden());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user