83 startMs_ = esp_timer_get_time() / 1000;
89 auto* gfx =
static_cast<Gdey029T94*
>(
display->getNativeHandle());
92 const uint16_t width =
display->getWidth();
93 const uint16_t height =
display->getHeight();
96 int boxX = (width - BOX_WIDTH) / 2;
97 int boxY = (height - BOX_HEIGHT) / 2;
102 gfx->setTextColor(EPD_BLACK);
107 int textX = boxX + 15;
108 int textY = boxY + (BOX_HEIGHT / 2) - 4;
112 int iconX = boxX + 20;
113 int iconY = boxY + (BOX_HEIGHT / 2);
118 gfx->drawLine(iconX - 5, iconY, iconX - 2, iconY + 4, EPD_BLACK);
119 gfx->drawLine(iconX - 2, iconY + 4, iconX + 6, iconY - 5, EPD_BLACK);
121 gfx->drawLine(iconX - 5, iconY + 1, iconX - 2, iconY + 5, EPD_BLACK);
122 gfx->drawLine(iconX - 2, iconY + 5, iconX + 6, iconY - 4, EPD_BLACK);
127 gfx->drawLine(iconX - 5, iconY - 5, iconX + 5, iconY + 5, EPD_BLACK);
128 gfx->drawLine(iconX - 5, iconY + 5, iconX + 5, iconY - 5, EPD_BLACK);
130 gfx->drawLine(iconX - 4, iconY - 5, iconX + 6, iconY + 5, EPD_BLACK);
131 gfx->drawLine(iconX - 4, iconY + 5, iconX + 6, iconY - 5, EPD_BLACK);
136 gfx->drawCircle(iconX, iconY, 6, EPD_BLACK);
137 gfx->fillRect(iconX - 1, iconY - 3, 2, 2, EPD_BLACK);
138 gfx->fillRect(iconX - 1, iconY, 2, 5, EPD_BLACK);
142 gfx->drawLine(iconX - 5, iconY - 6, iconX + 5, iconY - 6, EPD_BLACK);
143 gfx->drawLine(iconX - 5, iconY + 6, iconX + 5, iconY + 6, EPD_BLACK);
144 gfx->drawLine(iconX - 5, iconY - 6, iconX + 5, iconY + 6, EPD_BLACK);
145 gfx->drawLine(iconX + 5, iconY - 6, iconX - 5, iconY + 6, EPD_BLACK);
146 gfx->fillTriangle(iconX - 3, iconY - 4, iconX + 3, iconY - 4, iconX, iconY - 1, EPD_BLACK);
147 gfx->fillTriangle(iconX - 3, iconY + 4, iconX + 3, iconY + 4, iconX, iconY + 1, EPD_BLACK);
151 gfx->drawTriangle(iconX, iconY - 7, iconX - 6, iconY + 6, iconX + 6, iconY + 6, EPD_BLACK);
152 gfx->fillRect(iconX - 1, iconY - 2, 2, 5, EPD_BLACK);
153 gfx->fillRect(iconX - 1, iconY + 4, 2, 2, EPD_BLACK);
167 constexpr int kLineHeight = 10;
169 size_t lineCount = 1;
170 for (
const char* p = message_; *p; ++p) {
171 if (*p ==
'\n') ++lineCount;
174 int blockY = textY -
static_cast<int>((lineCount - 1) * kLineHeight / 2);
175 const char* lineStart = message_;
177 for (
const char* p = message_;; ++p) {
178 if (*p ==
'\n' || *p ==
'\0') {
180 size_t len =
static_cast<size_t>(p - lineStart);
181 if (len >=
sizeof(lineBuf)) len =
sizeof(lineBuf) - 1;
182 memcpy(lineBuf, lineStart, len);
184 gfx->setCursor(textX, lineY);
189 if (*p ==
'\0')
break;
191 lineY += kLineHeight;