[esp_ldo,mipi_dsi,mipi_rgb] Fix dangling pointer bugs in mark_failed() (#12077)
This commit is contained in:
@@ -14,8 +14,8 @@ void EspLdo::setup() {
|
|||||||
config.flags.adjustable = this->adjustable_;
|
config.flags.adjustable = this->adjustable_;
|
||||||
auto err = esp_ldo_acquire_channel(&config, &this->handle_);
|
auto err = esp_ldo_acquire_channel(&config, &this->handle_);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
auto msg = str_sprintf("Failed to acquire LDO channel %d with voltage %fV", this->channel_, this->voltage_);
|
ESP_LOGE(TAG, "Failed to acquire LDO channel %d with voltage %fV", this->channel_, this->voltage_);
|
||||||
this->mark_failed(msg.c_str());
|
this->mark_failed("Failed to acquire LDO channel");
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGD(TAG, "Acquired LDO channel %d with voltage %fV", this->channel_, this->voltage_);
|
ESP_LOGD(TAG, "Acquired LDO channel %d with voltage %fV", this->channel_, this->voltage_);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ static bool notify_refresh_ready(esp_lcd_panel_handle_t panel, esp_lcd_dpi_panel
|
|||||||
xSemaphoreGiveFromISR(sem, &need_yield);
|
xSemaphoreGiveFromISR(sem, &need_yield);
|
||||||
return (need_yield == pdTRUE);
|
return (need_yield == pdTRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MIPI_DSI::smark_failed(const char *message, esp_err_t err) {
|
||||||
|
ESP_LOGE(TAG, "%s: %s", message, esp_err_to_name(err));
|
||||||
|
this->mark_failed(message);
|
||||||
|
}
|
||||||
|
|
||||||
void MIPI_DSI::setup() {
|
void MIPI_DSI::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Running Setup");
|
ESP_LOGCONFIG(TAG, "Running Setup");
|
||||||
|
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ class MIPI_DSI : public display::Display {
|
|||||||
void set_lanes(uint8_t lanes) { this->lanes_ = lanes; }
|
void set_lanes(uint8_t lanes) { this->lanes_ = lanes; }
|
||||||
void set_madctl(uint8_t madctl) { this->madctl_ = madctl; }
|
void set_madctl(uint8_t madctl) { this->madctl_ = madctl; }
|
||||||
|
|
||||||
void smark_failed(const char *message, esp_err_t err) {
|
void smark_failed(const char *message, esp_err_t err);
|
||||||
auto str = str_sprintf("Setup failed: %s: %s", message, esp_err_to_name(err));
|
|
||||||
this->mark_failed(str.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
void update() override;
|
void update() override;
|
||||||
|
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ void MipiRgb::common_setup_() {
|
|||||||
if (err == ESP_OK)
|
if (err == ESP_OK)
|
||||||
err = esp_lcd_panel_init(this->handle_);
|
err = esp_lcd_panel_init(this->handle_);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
auto msg = str_sprintf("lcd setup failed: %s", esp_err_to_name(err));
|
ESP_LOGE(TAG, "lcd setup failed: %s", esp_err_to_name(err));
|
||||||
this->mark_failed(msg.c_str());
|
this->mark_failed("lcd setup failed");
|
||||||
}
|
}
|
||||||
ESP_LOGCONFIG(TAG, "MipiRgb setup complete");
|
ESP_LOGCONFIG(TAG, "MipiRgb setup complete");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user