From d193d44e13f6223961150d1279c5926d1e4b1610 Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Sat, 24 Aug 2024 21:37:37 +0200 Subject: [PATCH] other fix --- esphome/components/espnow/espnow_packet.c | 7 ++----- esphome/components/espnow/espnow_packet.h | 12 ++++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/esphome/components/espnow/espnow_packet.c b/esphome/components/espnow/espnow_packet.c index e5083f1bfd..52eaa372f8 100644 --- a/esphome/components/espnow/espnow_packet.c +++ b/esphome/components/espnow/espnow_packet.c @@ -5,11 +5,8 @@ static const char *const TAG = "espnow_packet"; -ESPNowPacket::ESPNowPacket(const uint64_t mac64, const uint8_t *data, uint8_t size, - uint32_t app_id) ESPHOME_ALWAYS_INLINE : mac64(mac64), - size(size), - app_id(app_id), - retrys(0) { +ESPNowPacket::ESPNowPacket(const uint64_t mac64, const uint8_t *data, uint8_t size, uint32_t app_id) + : mac64(mac64), size(size), app_id(app_id), retrys(0) { if (this->mac64 == 0) this->mac64 = ESPNOW_BROADCAST_ADDR; this->is_broadcast = this->mac64 == ESPNOW_BROADCAST_ADDR; diff --git a/esphome/components/espnow/espnow_packet.h b/esphome/components/espnow/espnow_packet.h index cfa41b08af..0818427838 100644 --- a/esphome/components/espnow/espnow_packet.h +++ b/esphome/components/espnow/espnow_packet.h @@ -60,8 +60,8 @@ struct ESPNowPacket { } __attribute__((packed)); }; - inline ESPNowPacket() ESPHOME_ALWAYS_INLINE : retrys(0) {} - inline ESPNowPacket(const uint64_t mac64, const uint8_t *data, uint8_t size, uint32_t app_id); + ESPNowPacket() ESPHOME_ALWAYS_INLINE : retrys(0) {} + ESPNowPacket(const uint64_t mac64, const uint8_t *data, uint8_t size, uint32_t app_id); inline void info(std::string place); @@ -87,11 +87,11 @@ struct ESPNowPacket { bool is_valid(); - inline std::string to_str(uint64_t mac64_ = 0) { + inline std::string to_str(uint64_t mac64 = 0) { espnow_addr_t mac; - if (mac64_ == 0) - mac64_ = this->mac64; - memcpy((void *) &mac, &mac64_, 6); + if (mac64 == 0) + mac64 = this->mac64; + memcpy((void *) &mac, &mac64, 6); return string_format("{\"%02x:%02x:%02x:%02x:%02x:%02x\"}", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); }