mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 13:24:56 +02:00
ILI9XXX: Lazily allocate buffer (#6352)
This commit is contained in:
@@ -86,6 +86,14 @@ class ILI9XXXDisplay : public display::DisplayBuffer,
|
||||
display::ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) override;
|
||||
|
||||
protected:
|
||||
inline bool check_buffer_() {
|
||||
if (this->buffer_ == nullptr) {
|
||||
this->alloc_buffer_();
|
||||
return !this->is_failed();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void draw_absolute_pixel_internal(int x, int y, Color color) override;
|
||||
void setup_pins_();
|
||||
|
||||
@@ -116,6 +124,7 @@ class ILI9XXXDisplay : public display::DisplayBuffer,
|
||||
void end_command_();
|
||||
void start_data_();
|
||||
void end_data_();
|
||||
void alloc_buffer_();
|
||||
|
||||
GPIOPin *reset_pin_{nullptr};
|
||||
GPIOPin *dc_pin_{nullptr};
|
||||
|
||||
Reference in New Issue
Block a user