87 startMs_ = esp_timer_get_time() / 1000;
93 auto* gfx =
static_cast<Gdey029T94*
>(
display->getNativeHandle());
96 const uint16_t width =
display->getWidth();
97 const uint16_t height =
display->getHeight();
100 int boxX = (width - BOX_WIDTH) / 2;
101 int boxY = (height - BOX_HEIGHT) / 2;
106 gfx->setTextColor(EPD_BLACK);
111 int textX = boxX + 15;
112 int textY = boxY + (BOX_HEIGHT / 2) - 4;
116 int iconX = boxX + 20;
117 int iconY = boxY + (BOX_HEIGHT / 2);
122 gfx->drawLine(iconX - 5, iconY, iconX - 2, iconY + 4, EPD_BLACK);
123 gfx->drawLine(iconX - 2, iconY + 4, iconX + 6, iconY - 5, EPD_BLACK);
125 gfx->drawLine(iconX - 5, iconY + 1, iconX - 2, iconY + 5, EPD_BLACK);
126 gfx->drawLine(iconX - 2, iconY + 5, iconX + 6, iconY - 4, EPD_BLACK);
131 gfx->drawLine(iconX - 5, iconY - 5, iconX + 5, iconY + 5, EPD_BLACK);
132 gfx->drawLine(iconX - 5, iconY + 5, iconX + 5, iconY - 5, EPD_BLACK);
134 gfx->drawLine(iconX - 4, iconY - 5, iconX + 6, iconY + 5, EPD_BLACK);
135 gfx->drawLine(iconX - 4, iconY + 5, iconX + 6, iconY - 5, EPD_BLACK);
140 gfx->drawCircle(iconX, iconY, 6, EPD_BLACK);
141 gfx->fillRect(iconX - 1, iconY - 3, 2, 2, EPD_BLACK);
142 gfx->fillRect(iconX - 1, iconY, 2, 5, EPD_BLACK);
146 gfx->drawLine(iconX - 5, iconY - 6, iconX + 5, iconY - 6, EPD_BLACK);
147 gfx->drawLine(iconX - 5, iconY + 6, iconX + 5, iconY + 6, EPD_BLACK);
148 gfx->drawLine(iconX - 5, iconY - 6, iconX + 5, iconY + 6, EPD_BLACK);
149 gfx->drawLine(iconX + 5, iconY - 6, iconX - 5, iconY + 6, EPD_BLACK);
150 gfx->fillTriangle(iconX - 3, iconY - 4, iconX + 3, iconY - 4, iconX, iconY - 1, EPD_BLACK);
151 gfx->fillTriangle(iconX - 3, iconY + 4, iconX + 3, iconY + 4, iconX, iconY + 1, EPD_BLACK);
155 gfx->drawTriangle(iconX, iconY - 7, iconX - 6, iconY + 6, iconX + 6, iconY + 6, EPD_BLACK);
156 gfx->fillRect(iconX - 1, iconY - 2, 2, 5, EPD_BLACK);
157 gfx->fillRect(iconX - 1, iconY + 4, 2, 2, EPD_BLACK);
171 constexpr int kLineHeight = 10;
173 size_t lineCount = 1;
174 for (
const char* p = message_; *p; ++p) {
175 if (*p ==
'\n') ++lineCount;
178 int blockY = textY -
static_cast<int>((lineCount - 1) * kLineHeight / 2);
179 const char* lineStart = message_;
181 for (
const char* p = message_;; ++p) {
182 if (*p ==
'\n' || *p ==
'\0') {
184 size_t len =
static_cast<size_t>(p - lineStart);
185 if (len >=
sizeof(lineBuf)) len =
sizeof(lineBuf) - 1;
186 memcpy(lineBuf, lineStart, len);
188 gfx->setCursor(textX, lineY);
193 if (*p ==
'\0')
break;
195 lineY += kLineHeight;