Display.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. #include "Display.h"
  2. /*
  3. Big thanks to bodmer for having great TFT and JPEG libraries
  4. https://github.com/bodmer
  5. */
  6. Display::Display()
  7. {
  8. }
  9. // Function to prepare the display and the menus
  10. void Display::RunSetup()
  11. {
  12. run_setup = false;
  13. // Need to declare new
  14. display_buffer = new LinkedList<String>();
  15. tft.init();
  16. tft.setRotation(0); // Portrait
  17. tft.setCursor(0, 0);
  18. //tft.setFreeFont(&FreeMonoBold9pt7b);
  19. // Calibration data
  20. //uint16_t calData[5] = { 390, 3516, 253, 3520, 7 }; tft.setRotation(1); // Portrait
  21. uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait
  22. tft.setTouch(calData);
  23. //tft.fillScreen(TFT_BLACK);
  24. clearScreen();
  25. // Initialize file system
  26. // This should probably have its own class
  27. if (!SPIFFS.begin()) {
  28. Serial.println("SPIFFS initialisation failed!");
  29. while (1) yield(); // Stay here twiddling thumbs waiting
  30. }
  31. // Draw the title screen
  32. drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
  33. //showCenterText(version_number, 250);
  34. tft.drawCentreString(version_number, 120, 250, 2);
  35. digitalWrite(TFT_BL, HIGH);
  36. delay(5000);
  37. }
  38. void Display::tftDrawGraphObjects(byte x_scale)
  39. {
  40. //draw the graph objects
  41. tft.fillRect(11, 5, x_scale+1, 120, TFT_BLACK); // positive start point
  42. tft.fillRect(11, 121, x_scale+1, 119, TFT_BLACK); // negative start point
  43. tft.drawFastVLine(10, 5, 230, TFT_WHITE); // y axis
  44. tft.drawFastHLine(10, HEIGHT_1 - 1, 310, TFT_WHITE); // x axis
  45. tft.setTextColor(TFT_YELLOW); tft.setTextSize(1); // set parameters for y axis labels
  46. //tft.setCursor(3, 116); tft.print(midway); // "0" at center of ya axis
  47. tft.setCursor(3, 6); tft.print("+"); // "+' at top of y axis
  48. tft.setCursor(3, 228); tft.print("0"); // "-" at bottom of y axis
  49. }
  50. void Display::tftDrawColorKey()
  51. {
  52. //Display color key
  53. tft.setTextSize(1); tft.setTextColor(TFT_WHITE);
  54. tft.fillRect(14, 0, 15, 8, TFT_GREEN); tft.setCursor(30, 0); tft.print(" - Beacons");
  55. tft.fillRect(14, 8, 15, 8, TFT_RED); tft.setCursor(30, 8); tft.print(" - Deauths");
  56. tft.fillRect(14, 16, 15, 8, TFT_BLUE); tft.setCursor(30, 16); tft.print(" - Probes");
  57. }
  58. void Display::tftDrawXScaleButtons(byte x_scale)
  59. {
  60. tft.drawFastVLine(234, 0, 20, TFT_WHITE);
  61. tft.setCursor(208, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("X Scale:"); tft.print(x_scale);
  62. key[0].initButton(&tft, // x - box
  63. 220,
  64. 10, // x, y, w, h, outline, fill, text
  65. 20,
  66. 20,
  67. TFT_BLACK, // Outline
  68. TFT_CYAN, // Fill
  69. TFT_BLACK, // Text
  70. "-",
  71. 2);
  72. key[1].initButton(&tft, // x + box
  73. 249,
  74. 10, // x, y, w, h, outline, fill, text
  75. 20,
  76. 20,
  77. TFT_BLACK, // Outline
  78. TFT_CYAN, // Fill
  79. TFT_BLACK, // Text
  80. "+",
  81. 2);
  82. key[0].drawButton();
  83. key[1].drawButton();
  84. }
  85. void Display::tftDrawYScaleButtons(byte y_scale)
  86. {
  87. tft.drawFastVLine(290, 0, 20, TFT_WHITE);
  88. tft.setCursor(265, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Y Scale:"); tft.print(y_scale);
  89. key[2].initButton(&tft, // y - box
  90. 276,
  91. 10, // x, y, w, h, outline, fill, text
  92. 20,
  93. 20,
  94. TFT_BLACK, // Outline
  95. TFT_MAGENTA, // Fill
  96. TFT_BLACK, // Text
  97. "-",
  98. 2);
  99. key[3].initButton(&tft, // y + box
  100. 305,
  101. 10, // x, y, w, h, outline, fill, text
  102. 20,
  103. 20,
  104. TFT_BLACK, // Outline
  105. TFT_MAGENTA, // Fill
  106. TFT_BLACK, // Text
  107. "+",
  108. 2);
  109. key[2].drawButton();
  110. key[3].drawButton();
  111. }
  112. void Display::tftDrawChannelScaleButtons(int set_channel)
  113. {
  114. tft.drawFastVLine(178, 0, 20, TFT_WHITE);
  115. tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Channel:"); tft.print(set_channel);
  116. key[4].initButton(&tft, // channel - box
  117. 164,
  118. 10, // x, y, w, h, outline, fill, text
  119. 20,
  120. 20,
  121. TFT_BLACK, // Outline
  122. TFT_BLUE, // Fill
  123. TFT_BLACK, // Text
  124. "-",
  125. 2);
  126. key[5].initButton(&tft, // channel + box
  127. 193,
  128. 10, // x, y, w, h, outline, fill, text
  129. 20,
  130. 20,
  131. TFT_BLACK, // Outline
  132. TFT_BLUE, // Fill
  133. TFT_BLACK, // Text
  134. "+",
  135. 2);
  136. key[4].drawButton();
  137. key[5].drawButton();
  138. }
  139. void Display::tftDrawExitScaleButtons()
  140. {
  141. //tft.drawFastVLine(178, 0, 20, TFT_WHITE);
  142. //tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Channel:"); tft.print(set_channel);
  143. key[6].initButton(&tft, // Exit box
  144. 137,
  145. 10, // x, y, w, h, outline, fill, text
  146. 20,
  147. 20,
  148. TFT_ORANGE, // Outline
  149. TFT_RED, // Fill
  150. TFT_BLACK, // Text
  151. "X",
  152. 2);
  153. key[6].drawButton();
  154. }
  155. void Display::twoPartDisplay(String center_text)
  156. {
  157. tft.setTextColor(TFT_BLACK, TFT_YELLOW);
  158. tft.fillRect(0,16,HEIGHT_1,144, TFT_YELLOW);
  159. //tft.drawCentreString(center_text,120,82,1);
  160. tft.setTextWrap(true);
  161. tft.setFreeFont(NULL);
  162. //showCenterText(center_text, 82);
  163. //tft.drawCentreString(center_text,120,82,1);
  164. tft.setCursor(0, 82);
  165. tft.println(center_text);
  166. tft.setFreeFont(MENU_FONT);
  167. tft.setTextWrap(false);
  168. }
  169. void Display::touchToExit()
  170. {
  171. tft.setTextColor(TFT_BLACK, TFT_LIGHTGREY);
  172. tft.fillRect(0,16,HEIGHT_1,16, TFT_LIGHTGREY);
  173. tft.drawCentreString("Touch screen to exit",120,16,2);
  174. }
  175. // Function to just draw the screen black
  176. void Display::clearScreen()
  177. {
  178. Serial.println("clearScreen()");
  179. tft.fillScreen(TFT_BLACK);
  180. tft.setCursor(0, 0);
  181. }
  182. void Display::displayBuffer(bool do_clear)
  183. {
  184. if (this->display_buffer->size() > 0)
  185. {
  186. delay(1);
  187. while (display_buffer->size() > 0)
  188. {
  189. xPos = 0;
  190. if ((display_buffer->size() > 0) && (!loading))
  191. {
  192. printing = true;
  193. delay(print_delay_1);
  194. yDraw = scroll_line(TFT_RED);
  195. tft.setCursor(xPos, yDraw);
  196. tft.print(display_buffer->shift());
  197. printing = false;
  198. delay(print_delay_2);
  199. }
  200. if (!tteBar)
  201. blank[(18+(yStart - TOP_FIXED_AREA) / TEXT_HEIGHT)%19] = xPos;
  202. else
  203. blank[(18+(yStart - TOP_FIXED_AREA_2) / TEXT_HEIGHT)%19] = xPos;
  204. }
  205. }
  206. }
  207. void Display::showCenterText(String text, int y)
  208. {
  209. tft.setCursor((SCREEN_WIDTH - (text.length() * 6)) / 2, y);
  210. tft.println(text);
  211. }
  212. void Display::initScrollValues(bool tte)
  213. {
  214. Serial.println("initScrollValues()");
  215. yDraw = YMAX - BOT_FIXED_AREA - TEXT_HEIGHT;
  216. xPos = 0;
  217. if (!tte)
  218. {
  219. yStart = TOP_FIXED_AREA;
  220. yArea = YMAX - TOP_FIXED_AREA - BOT_FIXED_AREA;
  221. }
  222. else
  223. {
  224. yStart = TOP_FIXED_AREA_2;
  225. yArea = YMAX - TOP_FIXED_AREA_2 - BOT_FIXED_AREA;
  226. }
  227. for(int i = 0; i < 18; i++) blank[i] = 0;
  228. }
  229. // Function to execute hardware scroll for TFT screen
  230. int Display::scroll_line(uint32_t color) {
  231. //Serial.println("scroll_line()");
  232. int yTemp = yStart; // Store the old yStart, this is where we draw the next line
  233. // Use the record of line lengths to optimise the rectangle size we need to erase the top line
  234. // Check if we have the "touch to exit bar"
  235. if (!tteBar)
  236. {
  237. tft.fillRect(0,yStart,blank[(yStart-TOP_FIXED_AREA)/TEXT_HEIGHT],TEXT_HEIGHT, color);
  238. // Change the top of the scroll area
  239. yStart+=TEXT_HEIGHT;
  240. // The value must wrap around as the screen memory is a circular buffer
  241. if (yStart >= YMAX - BOT_FIXED_AREA) yStart = TOP_FIXED_AREA + (yStart - YMAX + BOT_FIXED_AREA);
  242. }
  243. else
  244. {
  245. tft.fillRect(0,yStart,blank[(yStart-TOP_FIXED_AREA_2)/TEXT_HEIGHT],TEXT_HEIGHT, color);
  246. // Change the top of the scroll area
  247. yStart+=TEXT_HEIGHT;
  248. // The value must wrap around as the screen memory is a circular buffer
  249. if (yStart >= YMAX - BOT_FIXED_AREA) yStart = TOP_FIXED_AREA_2 + (yStart - YMAX + BOT_FIXED_AREA);
  250. }
  251. // Now we can scroll the display
  252. scrollAddress(yStart);
  253. return yTemp;
  254. }
  255. // Function to setup hardware scroll for TFT screen
  256. void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
  257. Serial.println("setupScrollAread()");
  258. tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
  259. tft.writedata(tfa >> 8); // Top Fixed Area line count
  260. tft.writedata(tfa);
  261. tft.writedata((YMAX-tfa-bfa)>>8); // Vertical Scrolling Area line count
  262. tft.writedata(YMAX-tfa-bfa);
  263. tft.writedata(bfa >> 8); // Bottom Fixed Area line count
  264. tft.writedata(bfa);
  265. }
  266. void Display::scrollAddress(uint16_t vsp) {
  267. tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling pointer
  268. tft.writedata(vsp>>8);
  269. tft.writedata(vsp);
  270. }
  271. // JPEG_functions
  272. void Display::drawJpeg(const char *filename, int xpos, int ypos) {
  273. // Open the named file (the Jpeg decoder library will close it after rendering image)
  274. fs::File jpegFile = SPIFFS.open( filename, "r"); // File handle reference for SPIFFS
  275. //ESP32 always seems to return 1 for jpegFile so this null trap does not work
  276. if ( !jpegFile ) {
  277. Serial.print("ERROR: File \""); Serial.print(filename); Serial.println ("\" not found!");
  278. return;
  279. }
  280. // Use one of the three following methods to initialise the decoder,
  281. // the filename can be a String or character array type:
  282. boolean decoded = JpegDec.decodeFsFile(filename); // or pass the filename (leading / distinguishes SPIFFS files)
  283. if (decoded) {
  284. // print information about the image to the serial port
  285. jpegInfo();
  286. // render the image onto the screen at given coordinates
  287. jpegRender(xpos, ypos);
  288. }
  289. else {
  290. Serial.println("Jpeg file format not supported!");
  291. }
  292. }
  293. void Display::drawStylus()
  294. {
  295. uint16_t x = 0, y = 0; // To store the touch coordinates
  296. // Pressed will be set true is there is a valid touch on the screen
  297. boolean pressed = tft.getTouch(&x, &y);
  298. // Draw a white spot at the detected coordinates
  299. if (pressed) {
  300. tft.fillCircle(x, y, 2, TFT_WHITE);
  301. //Serial.print("x,y = ");
  302. //Serial.print(x);
  303. //Serial.print(",");
  304. //Serial.println(y);
  305. }
  306. }
  307. //====================================================================================
  308. // Decode and render the Jpeg image onto the TFT screen
  309. //====================================================================================
  310. void Display::jpegRender(int xpos, int ypos) {
  311. // retrieve infomration about the image
  312. uint16_t *pImg;
  313. int16_t mcu_w = JpegDec.MCUWidth;
  314. int16_t mcu_h = JpegDec.MCUHeight;
  315. int32_t max_x = JpegDec.width;
  316. int32_t max_y = JpegDec.height;
  317. // Jpeg images are draw as a set of image block (tiles) called Minimum Coding Units (MCUs)
  318. // Typically these MCUs are 16x16 pixel blocks
  319. // Determine the width and height of the right and bottom edge image blocks
  320. int32_t min_w = minimum(mcu_w, max_x % mcu_w);
  321. int32_t min_h = minimum(mcu_h, max_y % mcu_h);
  322. // save the current image block size
  323. int32_t win_w = mcu_w;
  324. int32_t win_h = mcu_h;
  325. // record the current time so we can measure how long it takes to draw an image
  326. uint32_t drawTime = millis();
  327. // save the coordinate of the right and bottom edges to assist image cropping
  328. // to the screen size
  329. max_x += xpos;
  330. max_y += ypos;
  331. // read each MCU block until there are no more
  332. while ( JpegDec.readSwappedBytes()) { // Swapped byte order read
  333. // save a pointer to the image block
  334. pImg = JpegDec.pImage;
  335. // calculate where the image block should be drawn on the screen
  336. int mcu_x = JpegDec.MCUx * mcu_w + xpos; // Calculate coordinates of top left corner of current MCU
  337. int mcu_y = JpegDec.MCUy * mcu_h + ypos;
  338. // check if the image block size needs to be changed for the right edge
  339. if (mcu_x + mcu_w <= max_x) win_w = mcu_w;
  340. else win_w = min_w;
  341. // check if the image block size needs to be changed for the bottom edge
  342. if (mcu_y + mcu_h <= max_y) win_h = mcu_h;
  343. else win_h = min_h;
  344. // copy pixels into a contiguous block
  345. if (win_w != mcu_w)
  346. {
  347. for (int h = 1; h < win_h-1; h++)
  348. {
  349. memcpy(pImg + h * win_w, pImg + (h + 1) * mcu_w, win_w << 1);
  350. }
  351. }
  352. // draw image MCU block only if it will fit on the screen
  353. if ( mcu_x < tft.width() && mcu_y < tft.height())
  354. {
  355. // Now push the image block to the screen
  356. tft.pushImage(mcu_x, mcu_y, win_w, win_h, pImg);
  357. }
  358. else if ( ( mcu_y + win_h) >= tft.height()) JpegDec.abort();
  359. }
  360. // calculate how long it took to draw the image
  361. drawTime = millis() - drawTime; // Calculate the time it took
  362. }
  363. //====================================================================================
  364. // Print information decoded from the Jpeg image
  365. //====================================================================================
  366. void Display::jpegInfo() {
  367. /*
  368. Serial.println("===============");
  369. Serial.println("JPEG image info");
  370. Serial.println("===============");
  371. Serial.print ("Width :"); Serial.println(JpegDec.width);
  372. Serial.print ("Height :"); Serial.println(JpegDec.height);
  373. Serial.print ("Components :"); Serial.println(JpegDec.comps);
  374. Serial.print ("MCU / row :"); Serial.println(JpegDec.MCUSPerRow);
  375. Serial.print ("MCU / col :"); Serial.println(JpegDec.MCUSPerCol);
  376. Serial.print ("Scan type :"); Serial.println(JpegDec.scanType);
  377. Serial.print ("MCU width :"); Serial.println(JpegDec.MCUWidth);
  378. Serial.print ("MCU height :"); Serial.println(JpegDec.MCUHeight);
  379. Serial.println("===============");
  380. Serial.println("");
  381. */
  382. }
  383. //====================================================================================
  384. // Open a Jpeg file and send it to the Serial port in a C array compatible format
  385. //====================================================================================
  386. void createArray(const char *filename) {
  387. // Open the named file
  388. fs::File jpgFile = SPIFFS.open( filename, "r"); // File handle reference for SPIFFS
  389. // File jpgFile = SD.open( filename, FILE_READ); // or, file handle reference for SD library
  390. if ( !jpgFile ) {
  391. Serial.print("ERROR: File \""); Serial.print(filename); Serial.println ("\" not found!");
  392. return;
  393. }
  394. uint8_t data;
  395. byte line_len = 0;
  396. Serial.println("");
  397. Serial.println("// Generated by a JPEGDecoder library example sketch:");
  398. Serial.println("// https://github.com/Bodmer/JPEGDecoder");
  399. Serial.println("");
  400. Serial.println("#if defined(__AVR__)");
  401. Serial.println(" #include <avr/pgmspace.h>");
  402. Serial.println("#endif");
  403. Serial.println("");
  404. Serial.print ("const uint8_t ");
  405. while (*filename != '.') Serial.print(*filename++);
  406. Serial.println("[] PROGMEM = {"); // PROGMEM added for AVR processors, it is ignored by Due
  407. while ( jpgFile.available()) {
  408. data = jpgFile.read();
  409. Serial.print("0x"); if (abs(data) < 16) Serial.print("0");
  410. Serial.print(data, HEX); Serial.print(",");// Add value and comma
  411. line_len++;
  412. if ( line_len >= 32) {
  413. line_len = 0;
  414. Serial.println();
  415. }
  416. }
  417. Serial.println("};\r\n");
  418. jpgFile.close();
  419. }
  420. // End JPEG_functions
  421. // SPIFFS_functions
  422. #ifdef ESP8266
  423. void Display::listFiles(void) {
  424. Serial.println();
  425. Serial.println("SPIFFS files found:");
  426. fs::Dir dir = SPIFFS.openDir("/"); // Root directory
  427. String line = "=====================================";
  428. Serial.println(line);
  429. Serial.println(" File name Size");
  430. Serial.println(line);
  431. while (dir.next()) {
  432. String fileName = dir.fileName();
  433. Serial.print(fileName);
  434. int spaces = 21 - fileName.length(); // Tabulate nicely
  435. while (spaces--) Serial.print(" ");
  436. fs::File f = dir.openFile("r");
  437. String fileSize = (String) f.size();
  438. spaces = 10 - fileSize.length(); // Tabulate nicely
  439. while (spaces--) Serial.print(" ");
  440. Serial.println(fileSize + " bytes");
  441. }
  442. Serial.println(line);
  443. Serial.println();
  444. delay(1000);
  445. }
  446. #endif
  447. //====================================================================================
  448. #ifdef ESP32
  449. void Display::listFiles(void) {
  450. listDir(SPIFFS, "/", 0);
  451. }
  452. void Display::listDir(fs::FS &fs, const char * dirname, uint8_t levels) {
  453. Serial.println();
  454. Serial.println("SPIFFS files found:");
  455. Serial.printf("Listing directory: %s\n", "/");
  456. String line = "=====================================";
  457. Serial.println(line);
  458. Serial.println(" File name Size");
  459. Serial.println(line);
  460. fs::File root = fs.open(dirname);
  461. if (!root) {
  462. Serial.println("Failed to open directory");
  463. return;
  464. }
  465. if (!root.isDirectory()) {
  466. Serial.println("Not a directory");
  467. return;
  468. }
  469. fs::File file = root.openNextFile();
  470. while (file) {
  471. if (file.isDirectory()) {
  472. Serial.print("DIR : ");
  473. String fileName = file.name();
  474. Serial.print(fileName);
  475. if (levels) {
  476. listDir(fs, file.name(), levels - 1);
  477. }
  478. } else {
  479. String fileName = file.name();
  480. Serial.print(" " + fileName);
  481. int spaces = 20 - fileName.length(); // Tabulate nicely
  482. while (spaces--) Serial.print(" ");
  483. String fileSize = (String) file.size();
  484. spaces = 10 - fileSize.length(); // Tabulate nicely
  485. while (spaces--) Serial.print(" ");
  486. Serial.println(fileSize + " bytes");
  487. }
  488. file = root.openNextFile();
  489. }
  490. Serial.println(line);
  491. Serial.println();
  492. delay(1000);
  493. }
  494. #endif
  495. void Display::updateBanner(String msg)
  496. {
  497. this->img.deleteSprite();
  498. this->img.setColorDepth(8);
  499. this->img.createSprite(SCREEN_WIDTH, TEXT_HEIGHT);
  500. this->buildBanner(msg, current_banner_pos);
  501. this->img.pushSprite(0, 0);
  502. current_banner_pos--;
  503. if (current_banner_pos <= 0)
  504. current_banner_pos = SCREEN_WIDTH;
  505. }
  506. void Display::buildBanner(String msg, int xpos)
  507. {
  508. int h = TEXT_HEIGHT;
  509. // We could just use fillSprite(color) but lets be a bit more creative...
  510. // Fill with rainbow stripes
  511. //while (h--) img.drawFastHLine(0, h, SCREEN_WIDTH, 255);
  512. // Draw some graphics, the text will apear to scroll over these
  513. //img.fillRect (SCREEN_WIDTH / 2 - 20, TEXT_HEIGHT / 2 - 10, 40, 20, TFT_YELLOW);
  514. //img.fillCircle(SCREEN_WIDTH / 2, TEXT_HEIGHT / 2, 10, TFT_ORANGE);
  515. // Now print text on top of the graphics
  516. img.setTextSize(2); // Font size scaling is x1
  517. img.setTextFont(0); // Font 4 selected
  518. img.setTextColor(TFT_WHITE); // Black text, no background colour
  519. img.setTextWrap(false); // Turn of wrap so we can print past end of sprite
  520. // Need to print twice so text appears to wrap around at left and right edges
  521. img.setCursor(xpos, 2); // Print text at xpos
  522. img.print(msg);
  523. img.setCursor(xpos - SCREEN_WIDTH, 2); // Print text at xpos - sprite width
  524. img.print(msg);
  525. }
  526. void Display::main()
  527. {
  528. return;
  529. }
  530. // End SPIFFS_functions