1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-01 15:41:52 +00:00

Compare commits

...

9 Commits

Author SHA1 Message Date
Jesse Hills
46492fc875 Merge branch 'dev' into jesserockz-2023-304 2024-10-25 15:55:52 +13:00
Jesse Hills
098a360f88 Merge branch 'dev' into jesserockz-2023-304 2024-04-09 07:21:07 +12:00
Jesse Hills
5f43e5e5d8 Discard changes to esphome/core/defines.h 2023-12-20 09:48:21 +09:00
Jesse Hills
297dea4080 Merge branch 'dev' into jesserockz-2023-304 2023-12-20 09:48:01 +09:00
Jesse Hills
03fd82b903 Merge branch 'dev' into jesserockz-2023-304 2023-09-21 10:11:51 +12:00
Jesse Hills
65f741516b Fix dummy defines file 2023-09-12 13:14:10 +12:00
Jesse Hills
3941f16465 Merge branch 'dev' into jesserockz-2023-304 2023-09-12 09:50:22 +12:00
Jesse Hills
df60eef583 clang 2023-09-06 16:41:02 +12:00
Jesse Hills
ffbecd105c Add libretiny to CI workflow 2023-09-06 14:23:52 +12:00
7 changed files with 31 additions and 32 deletions

View File

@@ -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

View File

@@ -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 {

View File

@@ -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(); }

View File

@@ -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", &LT_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(&LT_BANNER_STR[10]);
}
#endif // USE_TEXT_SENSOR
}

View File

@@ -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 {

View File

@@ -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

View File

@@ -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());
}