MCPcopy Create free account
hub / github.com/cifertech/ESP32-DIV / Printspoofer

Function Printspoofer

ESP32-DIV/bluetooth.cpp:246–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246void Printspoofer(String text, uint16_t color, bool extraSpace = false) {
247 tft.drawFastHLine(0, 19, 240, UI_LINE);
248 const int visibleLines = spooferVisibleLines();
249 if (spooferlineIndex >= visibleLines) {
250 for (int i = 0; i < visibleLines - 1; i++) {
251 spooferBuffer[i] = spooferBuffer[i + 1];
252 colorspooferBuffer[i] = colorspooferBuffer[i + 1];
253 }
254 spooferlineIndex = visibleLines - 1;
255 }
256
257 spooferBuffer[spooferlineIndex] = text;
258 colorspooferBuffer[spooferlineIndex] = color;
259 spooferlineIndex++;
260
261 if (extraSpace && spooferlineIndex < visibleLines) {
262 spooferBuffer[spooferlineIndex] = "";
263 colorspooferBuffer[spooferlineIndex] = TFT_WHITE;
264 spooferlineIndex++;
265 }
266
267 for (int i = 0; i < spooferlineIndex && i < visibleLines; i++) {
268 int yPos = i * LINE_HEIGHT + SPOOFER_LOG_TOP;
269 if (!spooferLineFits(yPos)) {
270 continue;
271 }
272
273 tft.fillRect(5, yPos, tft.width() - 10, LINE_HEIGHT, TFT_BLACK);
274
275 tft.setTextColor(colorspooferBuffer[i], TFT_BLACK);
276 tft.setCursor(5, yPos);
277 tft.print(spooferBuffer[i]);
278 }
279}
280
281void sppferLoadingBar(int step) {
282 int totalSteps = 4;

Callers 3

sppferLoadingBarFunction · 0.85
toggleAdvertisingFunction · 0.85
spooferSetupFunction · 0.85

Calls 2

spooferVisibleLinesFunction · 0.85
spooferLineFitsFunction · 0.85

Tested by

no test coverage detected