diff --git a/esphome/components/hdmi_cec/hdmi_cec.cpp b/esphome/components/hdmi_cec/hdmi_cec.cpp index 6489618b29d..12a8d708caa 100644 --- a/esphome/components/hdmi_cec/hdmi_cec.cpp +++ b/esphome/components/hdmi_cec/hdmi_cec.cpp @@ -235,13 +235,6 @@ bool HDMICEC::send(uint8_t source, uint8_t destination, const uint8_t *payload_b return xmit_.queue_for_send(source, destination, payload_bytes, payload_size); } -inline void IRAM_ATTR CECTransmit::set_pin_input_high() { pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP); } - -inline void IRAM_ATTR CECTransmit::set_pin_output_low() { - pin_->pin_mode(gpio::FLAG_OUTPUT | gpio::FLAG_OPEN_DRAIN); - pin_->digital_write(false); -} - void CECTransmit::setup(InternalGPIOPin *pin) { // This CEC software component optionally uses a UART to transmit (write) on the cec bus. // When used, the uart output pin is connected to the GPIO CEC pin through a diode: cathode to uart pin. diff --git a/esphome/components/hdmi_cec/hdmi_cec.h b/esphome/components/hdmi_cec/hdmi_cec.h index f11f88fd3dc..039c9c47f0f 100644 --- a/esphome/components/hdmi_cec/hdmi_cec.h +++ b/esphome/components/hdmi_cec/hdmi_cec.h @@ -144,8 +144,12 @@ class CECTransmit { bool is_idle() const { return send_queue_.is_empty() && (transmit_state_ == TransmitState::IDLE); } void set_uart(uart::UARTComponent *uart) { uart_ = uart; } bool has_uart() const { return uart_ != nullptr; } - void set_pin_input_high(); - void set_pin_output_low(); + // Note: 'ESPHOME_ALWAYS_INLINE' allows the following methods to be also used in 'IRAM_ATTR' methods. + ESPHOME_ALWAYS_INLINE void set_pin_input_high() { pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP); } + ESPHOME_ALWAYS_INLINE void set_pin_output_low() { + pin_->pin_mode(gpio::FLAG_OUTPUT | gpio::FLAG_OPEN_DRAIN); + pin_->digital_write(false); + } /** * Transmit the message on the front of the send_queue out on the CEC line