1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00

make ledpin optional

busy pin is not needed
This commit is contained in:
mvturnho 2019-07-10 17:15:34 +02:00
parent 332d0badfb
commit 4a7ff4135c

View File

@ -16,8 +16,9 @@ void ili9341::setup_pins_() {
this->reset_pin_->setup(); // OUTPUT this->reset_pin_->setup(); // OUTPUT
this->reset_pin_->digital_write(true); this->reset_pin_->digital_write(true);
} }
if (this->busy_pin_ != nullptr) { if (this->led_pin_ != nullptr) {
this->busy_pin_->setup(); // INPUT this->led_pin_->setup();
this->led_pin_->digital_write(true);
} }
this->spi_setup(); this->spi_setup();
@ -169,14 +170,11 @@ void ili9341::set_addr_window_(uint16_t x1, uint16_t y1, uint16_t w, uint16_t h)
void ili9341::invert_display_(bool invert) { this->command(invert ? ILI9341_INVON : ILI9341_INVOFF); } void ili9341::invert_display_(bool invert) { this->command(invert ? ILI9341_INVON : ILI9341_INVOFF); }
int ili9341::get_width_internal() { return this->width_; } int ili9341::get_width_internal() { return this->width_; }
int ili9341::get_height_internal() { return this->height_; } int ili9341::get_height_internal() { return this->height_; }
// M5Stack display // M5Stack display
void ili9341_M5Stack::initialize() { void ili9341_M5Stack::initialize() {
this->led_pin_->pin_mode(OUTPUT);
this->led_pin_->digital_write(true);
this->init_lcd_(initcmd_m5stack); this->init_lcd_(initcmd_m5stack);
this->width_ = 320; this->width_ = 320;
this->height_ = 240; this->height_ = 240;
@ -185,8 +183,6 @@ void ili9341_M5Stack::initialize() {
// 24_TFT display // 24_TFT display
void ili9341_24_TFT::initialize() { void ili9341_24_TFT::initialize() {
this->led_pin_->pin_mode(OUTPUT);
this->led_pin_->digital_write(true);
this->init_lcd_(initcmd_tft); this->init_lcd_(initcmd_tft);
this->width_ = 240; this->width_ = 240;
this->height_ = 320; this->height_ = 320;