mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 23:48:11 +01:00
Try fixing clang-tidy issues
This commit is contained in:
parent
391f68f51c
commit
7cef5a8ef8
3 changed files with 8 additions and 8 deletions
|
@ -10,13 +10,13 @@ static const char *const TAG = "waveshare_epaper_4.26in";
|
||||||
|
|
||||||
WaveshareEPaper4P26In::WaveshareEPaper4P26In() : WaveshareEPaper() { reset_duration_ = 20; }
|
WaveshareEPaper4P26In::WaveshareEPaper4P26In() : WaveshareEPaper() { reset_duration_ = 20; }
|
||||||
|
|
||||||
void WaveshareEPaper4P26In::init_display_async_(bool fast_update, const std::function<void()> f) {
|
void WaveshareEPaper4P26In::init_display_async_(bool fast_update, const std::function<void()> &&f) {
|
||||||
// Reset the display
|
// Reset the display
|
||||||
this->reset_();
|
this->reset_();
|
||||||
wait_until_idle_async_([this, fast_update, f] {
|
wait_until_idle_async_([this, fast_update, f(std::move(f))] {
|
||||||
this->command(0x12); // SWRESET
|
this->command(0x12); // SWRESET
|
||||||
|
|
||||||
wait_until_idle_async_([this, fast_update, f] {
|
wait_until_idle_async_([this, fast_update, f(std::move(f))] {
|
||||||
// Use the internal temperature sensor
|
// Use the internal temperature sensor
|
||||||
this->command(0x18);
|
this->command(0x18);
|
||||||
this->data(0x80);
|
this->data(0x80);
|
||||||
|
@ -66,7 +66,7 @@ void WaveshareEPaper4P26In::init_display_async_(bool fast_update, const std::fun
|
||||||
this->data(0x00);
|
this->data(0x00);
|
||||||
|
|
||||||
if (fast_update) {
|
if (fast_update) {
|
||||||
this->wait_until_idle_async_([this, f] {
|
this->wait_until_idle_async_([this, f(std::move(f))] {
|
||||||
this->command(0x1A);
|
this->command(0x1A);
|
||||||
this->data(0x5A);
|
this->data(0x5A);
|
||||||
|
|
||||||
|
|
|
@ -164,12 +164,12 @@ bool WaveshareEPaperBase::wait_until_idle_() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveshareEPaperBase::wait_until_idle_async_(const std::function<void()> f) {
|
void WaveshareEPaperBase::wait_until_idle_async_(const std::function<void()> &&f) {
|
||||||
if (this->busy_pin_ == nullptr || !this->busy_pin_->digital_read()) {
|
if (this->busy_pin_ == nullptr || !this->busy_pin_->digital_read()) {
|
||||||
return f();
|
return f();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->set_timeout(20, [this, f] { this->wait_until_idle_async_(std::move(f)); });
|
this->set_timeout(20, [this, f(std::move(f))] { this->wait_until_idle_async_(std::move(f)); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveshareEPaperBase::update() {
|
void WaveshareEPaperBase::update() {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class WaveshareEPaperBase : public display::DisplayBuffer,
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool wait_until_idle_();
|
bool wait_until_idle_();
|
||||||
void wait_until_idle_async_(const std::function<void()> f);
|
void wait_until_idle_async_(const std::function<void()> &&f);
|
||||||
|
|
||||||
void setup_pins_();
|
void setup_pins_();
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ class WaveshareEPaper4P26In : public WaveshareEPaper {
|
||||||
void set_full_update_every(uint32_t full_update_every);
|
void set_full_update_every(uint32_t full_update_every);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void init_display_async_(bool fast_update, const std::function<void()> f);
|
void init_display_async_(bool fast_update, const std::function<void()> &&f);
|
||||||
|
|
||||||
int get_width_internal() override;
|
int get_width_internal() override;
|
||||||
int get_height_internal() override;
|
int get_height_internal() override;
|
||||||
|
|
Loading…
Reference in a new issue