mirror of
https://github.com/esphome/esphome.git
synced 2026-09-22 20:48:43 +00:00
Merge remote-tracking branch 'upstream/dev' into integration
This commit is contained in:
@@ -182,7 +182,9 @@ void EPaperBase::process_state_() {
|
||||
this->set_state_(EPaperState::RESET);
|
||||
break;
|
||||
case EPaperState::INITIALISE:
|
||||
this->initialise(this->update_count_ != 0);
|
||||
if (!this->initialise(this->update_count_ != 0)) {
|
||||
return; // Not done yet, come back next loop
|
||||
}
|
||||
this->set_state_(EPaperState::TRANSFER_DATA);
|
||||
break;
|
||||
case EPaperState::TRANSFER_DATA:
|
||||
@@ -239,11 +241,9 @@ void EPaperBase::start_data_() {
|
||||
|
||||
void EPaperBase::on_safe_shutdown() { this->deep_sleep(); }
|
||||
|
||||
void EPaperBase::initialise(bool partial) {
|
||||
void EPaperBase::send_init_sequence_(const uint8_t *sequence, size_t length) {
|
||||
size_t index = 0;
|
||||
|
||||
auto *sequence = this->init_sequence_;
|
||||
auto length = this->init_sequence_length_;
|
||||
while (index != length) {
|
||||
if (length - index < 2) {
|
||||
this->mark_failed(LOG_STR("Malformed init sequence"));
|
||||
@@ -266,6 +266,11 @@ void EPaperBase::initialise(bool partial) {
|
||||
}
|
||||
}
|
||||
|
||||
bool EPaperBase::initialise(bool partial) {
|
||||
this->send_init_sequence_(this->init_sequence_, this->init_sequence_length_);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check and rotate coordinates based on the transform flags.
|
||||
* @param x
|
||||
|
||||
@@ -115,7 +115,8 @@ class EPaperBase : public Display,
|
||||
bool is_idle_() const;
|
||||
void setup_pins_() const;
|
||||
virtual bool reset();
|
||||
virtual void initialise(bool partial);
|
||||
virtual bool initialise(bool partial);
|
||||
void send_init_sequence_(const uint8_t *sequence, size_t length);
|
||||
void wait_for_idle_(bool should_wait);
|
||||
bool init_buffer_(size_t buffer_length);
|
||||
bool rotate_coordinates_(int &x, int &y);
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace esphome::epaper_spi {
|
||||
|
||||
static const char *const TAG = "epaper_spi.waveshare";
|
||||
|
||||
void EpaperWaveshare::initialise(bool partial) {
|
||||
bool EpaperWaveshare::initialise(bool partial) {
|
||||
EPaperBase::initialise(partial);
|
||||
if (partial) {
|
||||
this->cmd_data(0x32, this->partial_lut_, this->partial_lut_length_);
|
||||
@@ -17,6 +17,7 @@ void EpaperWaveshare::initialise(bool partial) {
|
||||
this->cmd_data(0x3C, {0x05});
|
||||
}
|
||||
this->send_red_ = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void EpaperWaveshare::set_window() {
|
||||
|
||||
@@ -18,7 +18,7 @@ class EpaperWaveshare : public EPaperMono {
|
||||
partial_lut_length_(partial_lut_length) {}
|
||||
|
||||
protected:
|
||||
void initialise(bool partial) override;
|
||||
bool initialise(bool partial) override;
|
||||
void set_window() override;
|
||||
void refresh_screen(bool partial) override;
|
||||
void deep_sleep() override;
|
||||
|
||||
@@ -1169,8 +1169,8 @@ def _show_framework_migration_message(name: str, variant: str) -> None:
|
||||
+ "(We've been warning about this change since ESPHome 2025.8.0)\n"
|
||||
+ "\n"
|
||||
+ "Why we made this change:\n"
|
||||
+ color(AnsiFore.GREEN, " ✨ Up to 40% smaller firmware binaries\n")
|
||||
+ color(AnsiFore.GREEN, " ⚡ 2-3x faster compile times\n")
|
||||
+ color(AnsiFore.GREEN, " ✨ Smaller firmware binaries\n")
|
||||
+ color(AnsiFore.GREEN, " ⚡ Faster compile times\n")
|
||||
+ color(AnsiFore.GREEN, " 🚀 Better performance and newer features\n")
|
||||
+ color(AnsiFore.GREEN, " 🔧 More actively maintained by ESPHome\n")
|
||||
+ "\n"
|
||||
|
||||
@@ -81,6 +81,10 @@ void Application::register_component_(Component *comp) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this->components_.size() >= ESPHOME_COMPONENT_COUNT) {
|
||||
ESP_LOGE(TAG, "Cannot register component %s - at capacity!", LOG_STR_ARG(comp->get_component_log_str()));
|
||||
return;
|
||||
}
|
||||
this->components_.push_back(comp);
|
||||
}
|
||||
void Application::setup() {
|
||||
|
||||
Reference in New Issue
Block a user