Don't require U2TXD_OUT_IDX to be set (for ESP32-S2 chips), Update README regardin UART count --------- Co-authored-by: Sillyfrog <sillyfrog@users.noreply.github.com>
34 lines
608 B
C++
34 lines
608 B
C++
#pragma once
|
|
|
|
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
|
|
|
|
#include "dmx512.h"
|
|
#include "esp32-hal-matrix.h"
|
|
|
|
namespace esphome {
|
|
namespace dmx512 {
|
|
|
|
class DMX512ESP32 : public DMX512 {
|
|
public:
|
|
DMX512ESP32() = default;
|
|
|
|
void send_break() override;
|
|
|
|
void set_uart_num(int num) override {
|
|
if(num == 0) {
|
|
this->uart_idx_ = U0TXD_OUT_IDX;
|
|
} else if(num == 1) {
|
|
this->uart_idx_ = U1TXD_OUT_IDX;
|
|
#ifdef U2TXD_OUT_IDX
|
|
} else if(num == 2) {
|
|
this->uart_idx_ = U2TXD_OUT_IDX;
|
|
#endif
|
|
}
|
|
}
|
|
};
|
|
|
|
} // namespace dmx512
|
|
} // namespace esphome
|
|
|
|
#endif // USE_ESP32_FRAMEWORK_ARDUINO
|