"bluescreen on Boot"

develop
LuBeDa 3 years ago
parent 79587a7c64
commit d01c63f96f

@ -269,7 +269,7 @@ namespace esphome
if (this->clock->now().is_valid()) if (this->clock->now().is_valid())
{ {
ESP_LOGD(TAG, "time sync => start running"); ESP_LOGD(TAG, "time sync => start running");
this->bitmap_screen("[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63519,63519,63519,63519,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63519,0,0,0,0,2016,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,63488,0,63488,0,0,0,63519,0,0,0,0,2016,2016,0,0,0,65514,0,65514,0,0,0,31,0,0,0,64512,0,0,64512,0,63488,63488,0,63488,63488,0,0,63519,63519,63519,0,0,2016,0,2016,0,65514,0,65514,0,65514,0,31,31,31,0,0,0,64512,64512,0,0,63488,63488,63488,63488,63488,0,0,63519,0,0,0,0,2016,0,2016,0,65514,0,65514,0,65514,0,0,31,0,0,0,0,64512,64512,0,0,0,63488,63488,63488,0,0,0,63519,63519,63519,63519,0,2016,0,2016,0,65514,0,65514,0,65514,0,0,0,31,31,0,64512,0,0,64512,0,0,0,63488,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]",1,10); this->bitmap_screen("[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63519,63519,63519,63519,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63519,0,0,0,0,2016,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,63488,0,63488,0,0,0,63519,0,0,0,0,2016,2016,0,0,0,65514,0,65514,0,0,0,31,0,0,0,64512,0,0,64512,0,63488,63488,0,63488,63488,0,0,63519,63519,63519,0,0,2016,0,2016,0,65514,0,65514,0,65514,0,31,31,31,0,0,0,64512,64512,0,0,63488,63488,63488,63488,63488,0,0,63519,0,0,0,0,2016,0,2016,0,65514,0,65514,0,65514,0,0,31,0,0,0,0,64512,64512,0,0,0,63488,63488,63488,0,0,0,63519,63519,63519,63519,0,2016,0,2016,0,65514,0,65514,0,65514,0,0,0,31,31,0,64512,0,0,64512,0,0,0,63488,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]", 1, 10);
this->clock_screen(14 * 24 * 60, this->clock_time, false, C_RED, C_GREEN, C_BLUE); this->clock_screen(14 * 24 * 60, this->clock_time, false, C_RED, C_GREEN, C_BLUE);
this->date_screen(14 * 24 * 60, (int)this->clock_time / 2, false, C_RED, C_GREEN, C_BLUE); this->date_screen(14 * 24 * 60, (int)this->clock_time / 2, false, C_RED, C_GREEN, C_BLUE);
this->is_running = true; this->is_running = true;
@ -348,8 +348,11 @@ namespace esphome
void EHMTX::remove_expired_queue_element() void EHMTX::remove_expired_queue_element()
{ {
time_t ts = this->clock->now().timestamp; if (this->clock->now().is_valid())
{
std::string infotext; std::string infotext;
time_t ts = this->clock->now().timestamp;
for (size_t i = 0; i < MAXQUEUE; i++) for (size_t i = 0; i < MAXQUEUE; i++)
{ {
if ((this->queue[i]->endtime > 0) && (this->queue[i]->endtime < ts)) if ((this->queue[i]->endtime > 0) && (this->queue[i]->endtime < ts))
@ -384,6 +387,9 @@ namespace esphome
case MODE_TEXT_SCREEN: case MODE_TEXT_SCREEN:
infotext = "TEXT"; infotext = "TEXT";
break; break;
case MODE_BITMAP_SCREEN:
infotext = "BITMAP";
break;
default: default:
break; break;
} }
@ -394,7 +400,7 @@ namespace esphome
} }
} }
} }
}
void EHMTX::tick() void EHMTX::tick()
{ {
this->hue_++; this->hue_++;
@ -406,10 +412,10 @@ namespace esphome
esphome::hsv_to_rgb(this->hue_, 0.8, 0.8, red, green, blue); esphome::hsv_to_rgb(this->hue_, 0.8, 0.8, red, green, blue);
this->rainbow_color = Color(uint8_t(255 * red), uint8_t(255 * green), uint8_t(255 * blue)); this->rainbow_color = Color(uint8_t(255 * red), uint8_t(255 * green), uint8_t(255 * blue));
if (this->is_running && this->clock->now().is_valid())
{
time_t ts = this->clock->now().timestamp; time_t ts = this->clock->now().timestamp;
if (this->is_running)
{
if (millis() - this->last_scroll_time >= this->scroll_interval) if (millis() - this->last_scroll_time >= this->scroll_interval)
{ {
this->scroll_step++; this->scroll_step++;
@ -940,10 +946,6 @@ namespace esphome
{ {
ESP_LOGCONFIG(TAG, "weekstart: sunday"); ESP_LOGCONFIG(TAG, "weekstart: sunday");
} }
if (this->clock->now().is_valid())
{
this->is_running = true;
}
} }
void EHMTX::add_icon(EHMTX_Icon *icon) void EHMTX::add_icon(EHMTX_Icon *icon)

@ -37,7 +37,7 @@ namespace esphome
class EHMTX : public PollingComponent, public api::CustomAPIDevice { class EHMTX : public PollingComponent, public api::CustomAPIDevice {
protected: protected:
float get_setup_priority() const override { return esphome::setup_priority::BEFORE_CONNECTION; } float get_setup_priority() const override { return esphome::setup_priority::AFTER_WIFI; }
uint8_t brightness_; uint8_t brightness_;
uint32_t boot_anim=0; uint32_t boot_anim=0;
uint8_t screen_pointer; uint8_t screen_pointer;

Loading…
Cancel
Save