mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 17:05:21 +01:00
Inkplate6: Fix crash with initial set of greyscale (#6038)
This commit is contained in:
parent
86c9546362
commit
95292dbba1
2 changed files with 5 additions and 1 deletions
|
@ -55,6 +55,9 @@ void Inkplate6::setup() {
|
|||
this->wakeup_pin_->digital_write(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate buffers. May be called after setup to re-initialise if e.g. greyscale is changed.
|
||||
*/
|
||||
void Inkplate6::initialize_() {
|
||||
ExternalRAMAllocator<uint8_t> allocator(ExternalRAMAllocator<uint8_t>::ALLOW_FAILURE);
|
||||
ExternalRAMAllocator<uint32_t> allocator32(ExternalRAMAllocator<uint32_t>::ALLOW_FAILURE);
|
||||
|
|
|
@ -68,8 +68,9 @@ class Inkplate6 : public display::DisplayBuffer, public i2c::I2CDevice {
|
|||
|
||||
void set_greyscale(bool greyscale) {
|
||||
this->greyscale_ = greyscale;
|
||||
this->initialize_();
|
||||
this->block_partial_ = true;
|
||||
if (this->is_ready())
|
||||
this->initialize_();
|
||||
}
|
||||
void set_partial_updating(bool partial_updating) { this->partial_updating_ = partial_updating; }
|
||||
void set_full_update_every(uint32_t full_update_every) { this->full_update_every_ = full_update_every; }
|
||||
|
|
Loading…
Reference in a new issue