ILI9XXX: Lazily allocate buffer (#6352)

This commit is contained in:
Clyde Stubbs
2024-03-11 16:52:05 +11:00
committed by GitHub
parent d6bcc465a8
commit c559ccbb83
2 changed files with 15 additions and 1 deletions
@@ -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};