From 2d8abbb2ac81093474021f0a68d2610242231723 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 4 Jan 2026 14:46:09 -1000 Subject: [PATCH] [pn7150] Combine log statements to reduce loop blocking (#12944) --- esphome/components/pn7150/pn7150.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/esphome/components/pn7150/pn7150.cpp b/esphome/components/pn7150/pn7150.cpp index f827bd151a..f6ddcb0767 100644 --- a/esphome/components/pn7150/pn7150.cpp +++ b/esphome/components/pn7150/pn7150.cpp @@ -240,8 +240,11 @@ uint8_t PN7150::reset_core_(const bool reset_config, const bool power) { return nfc::STATUS_FAILED; } - ESP_LOGD(TAG, "Configuration %s", rx.get_message()[nfc::NCI_PKT_PAYLOAD_OFFSET + 2] ? "reset" : "retained"); - ESP_LOGD(TAG, "NCI version: %s", rx.get_message()[nfc::NCI_PKT_PAYLOAD_OFFSET + 1] == 0x20 ? "2.0" : "1.0"); + ESP_LOGD(TAG, + "Configuration %s\n" + "NCI version: %s", + rx.get_message()[nfc::NCI_PKT_PAYLOAD_OFFSET + 2] ? "reset" : "retained", + rx.get_message()[nfc::NCI_PKT_PAYLOAD_OFFSET + 1] == 0x20 ? "2.0" : "1.0"); return nfc::STATUS_OK; } @@ -266,11 +269,13 @@ uint8_t PN7150::init_core_() { uint8_t flash_major_version = rx.get_message()[18 + rx.get_message()[8]]; uint8_t flash_minor_version = rx.get_message()[19 + rx.get_message()[8]]; - ESP_LOGD(TAG, "Manufacturer ID: 0x%02X", manf_id); - ESP_LOGD(TAG, "Hardware version: 0x%02X", hw_version); - ESP_LOGD(TAG, "ROM code version: 0x%02X", rom_code_version); - ESP_LOGD(TAG, "FLASH major version: 0x%02X", flash_major_version); - ESP_LOGD(TAG, "FLASH minor version: 0x%02X", flash_minor_version); + ESP_LOGD(TAG, + "Manufacturer ID: 0x%02X\n" + "Hardware version: 0x%02X\n" + "ROM code version: 0x%02X\n" + "FLASH major version: 0x%02X\n" + "FLASH minor version: 0x%02X", + manf_id, hw_version, rom_code_version, flash_major_version, flash_minor_version); return rx.get_simple_status_response(); } @@ -847,8 +852,8 @@ void PN7150::process_rf_intf_activated_oid_(nfc::NciMessage &rx) { // an endpoi case EP_WRITE: if (this->next_task_message_to_write_ != nullptr) { - ESP_LOGD(TAG, " Tag writing"); - ESP_LOGD(TAG, " Tag formatting"); + ESP_LOGD(TAG, " Tag writing\n" + " Tag formatting"); if (this->format_endpoint_(working_endpoint.tag->get_uid()) != nfc::STATUS_OK) { ESP_LOGE(TAG, " Tag could not be formatted for writing"); } else {