From 0ad90498f996180ced858adce08fca9a88e0fd1f Mon Sep 17 00:00:00 2001 From: Adam Jones Date: Mon, 16 Sep 2024 21:34:32 +0100 Subject: [PATCH] clang format --- esphome/components/remote_base/nec_protocol.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/esphome/components/remote_base/nec_protocol.cpp b/esphome/components/remote_base/nec_protocol.cpp index a43dbce34c..0697faa523 100644 --- a/esphome/components/remote_base/nec_protocol.cpp +++ b/esphome/components/remote_base/nec_protocol.cpp @@ -16,14 +16,11 @@ void NECProtocol::encode(RemoteTransmitData *dst, const NECData &data) { // If the address or command is <= 0xFF the user has only supplied one byte // We need to generate parity bits to pad the value to 2 bytes // The NEC protocol requires us to prepend the inverse byte, e.g. 0x21 -> 0xDE21 - uint16_t address = data.address <= 0xFF - ? data.address | ((uint16_t)(~data.address) << 8) - : data.address; - uint16_t command = data.command <= 0xFF - ? data.command | ((uint16_t)(~data.command) << 8) - : data.command; + uint16_t address = data.address <= 0xFF ? data.address | ((uint16_t) (~data.address) << 8) : data.address; + uint16_t command = data.command <= 0xFF ? data.command | ((uint16_t) (~data.command) << 8) : data.command; - ESP_LOGD(TAG, "Sending NEC: address=0x%04X, command=0x%04X command_repeats=%d", address, command, data.command_repeats); + ESP_LOGD(TAG, "Sending NEC: address=0x%04X, command=0x%04X command_repeats=%d", address, command, + data.command_repeats); dst->reserve(2 + 32 + 32 * data.command_repeats + 2); dst->set_carrier_frequency(38000);