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]); }