1. Added comment "// NOLINT" after delay()

2. Updated formatting
This commit is contained in:
Tim Pehla 2024-11-11 18:40:52 +01:00
parent 1e08562a58
commit 28776d9169
2 changed files with 37 additions and 41 deletions

View file

@ -2649,7 +2649,7 @@ bool WaveshareEPaper7P5InV2P::wait_until_idle_() {
return false; return false;
} }
App.feed_wdt(); App.feed_wdt();
delay(10); delay(10); // NOLINT
} }
return true; return true;
} }
@ -2657,22 +2657,21 @@ bool WaveshareEPaper7P5InV2P::wait_until_idle_() {
void WaveshareEPaper7P5InV2P::reset_() { void WaveshareEPaper7P5InV2P::reset_() {
if (this->reset_pin_ != nullptr) { if (this->reset_pin_ != nullptr) {
this->reset_pin_->digital_write(true); this->reset_pin_->digital_write(true);
delay(20); delay(20); // NOLINT
this->reset_pin_->digital_write(false); this->reset_pin_->digital_write(false);
delay(2); delay(2); // NOLINT
this->reset_pin_->digital_write(true); this->reset_pin_->digital_write(true);
delay(20); delay(20); // NOLINT
} }
} }
void WaveshareEPaper7P5InV2P::turn_on_display_() { void WaveshareEPaper7P5InV2P::turn_on_display_() {
this->command(0x12); this->command(0x12);
delay(100); delay(100); // NOLINT
this->wait_until_idle_(); this->wait_until_idle_();
} }
void WaveshareEPaper7P5InV2P::initialize() { void WaveshareEPaper7P5InV2P::initialize() {
this->reset_(); this->reset_();
// COMMAND POWER SETTING // COMMAND POWER SETTING
@ -2691,7 +2690,7 @@ void WaveshareEPaper7P5InV2P::initialize() {
// COMMAND POWER DRIVER HAT UP // COMMAND POWER DRIVER HAT UP
this->command(0x04); this->command(0x04);
delay(100); delay(100); // NOLINT
this->wait_until_idle_(); this->wait_until_idle_();
// COMMAND PANEL SETTING // COMMAND PANEL SETTING
@ -2735,11 +2734,10 @@ void HOT WaveshareEPaper7P5InV2P::display() {
ESP_LOGI(TAG, "Power on the display and hat"); ESP_LOGI(TAG, "Power on the display and hat");
this->command(0x04); this->command(0x04);
delay(200); delay(200); // NOLINT
this->wait_until_idle_(); this->wait_until_idle_();
if (this->full_update_every_ == 1) { if (this->full_update_every_ == 1) {
this->command(0x13); this->command(0x13);
for (uint32_t i = 0; i < buf_len; i++) { for (uint32_t i = 0; i < buf_len; i++) {
this->data(~(this->buffer_[i])); this->data(~(this->buffer_[i]));
@ -2757,7 +2755,6 @@ void HOT WaveshareEPaper7P5InV2P::display() {
this->data(0x07); this->data(0x07);
if (this->at_update_ == 0) { if (this->at_update_ == 0) {
// Enable fast refresh // Enable fast refresh
this->command(0xE5); this->command(0xE5);
this->data(0x5A); this->data(0x5A);
@ -2765,27 +2762,26 @@ void HOT WaveshareEPaper7P5InV2P::display() {
this->command(0x92); this->command(0x92);
this->command(0x10); this->command(0x10);
delay(2); delay(2); // NOLINT
for (uint32_t i = 0; i < buf_len; i++) { for (uint32_t i = 0; i < buf_len; i++) {
this->data(~(this->buffer_[i])); this->data(~(this->buffer_[i]));
} }
delay(100); delay(100); // NOLINT
this->wait_until_idle_(); this->wait_until_idle_();
this->command(0x13); this->command(0x13);
delay(2); delay(2); // NOLINT
for (uint32_t i = 0; i < buf_len; i++) { for (uint32_t i = 0; i < buf_len; i++) {
this->data(this->buffer_[i]); this->data(this->buffer_[i]);
} }
delay(100); delay(100); // NOLINT
this->wait_until_idle_(); this->wait_until_idle_();
this->turn_on_display_(); this->turn_on_display_();
} else { } else {
// Enable partial refresh // Enable partial refresh
this->command(0xE5); this->command(0xE5);
this->data(0x6E); this->data(0x6E);
@ -2807,12 +2803,12 @@ void HOT WaveshareEPaper7P5InV2P::display() {
this->data(0x01); this->data(0x01);
this->command(0x13); this->command(0x13);
delay(2); delay(2); // NOLINT
for (uint32_t i = 0; i < buf_len; i++) { for (uint32_t i = 0; i < buf_len; i++) {
this->data(this->buffer_[i]); this->data(this->buffer_[i]);
} }
delay(100); delay(100); // NOLINT
this->wait_until_idle_(); this->wait_until_idle_();
this->turn_on_display_(); this->turn_on_display_();