My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nextion_tft.h 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /* ****************************************
  24. * lcd/extui/nextion/nextion_tft.h
  25. * ****************************************
  26. * Extensible_UI implementation for Nextion
  27. * https://github.com/Skorpi08
  28. * ***************************************/
  29. #include "nextion_tft_defs.h"
  30. #include "../../../inc/MarlinConfigPre.h"
  31. #include "../ui_api.h"
  32. class NextionTFT {
  33. private:
  34. static uint8_t command_len;
  35. static char nextion_command[MAX_CMND_LEN];
  36. static char selectedfile[MAX_PATH_LEN];
  37. public:
  38. NextionTFT();
  39. static void Startup();
  40. static void IdleLoop();
  41. static void PrinterKilled(FSTR_P const, FSTR_P const);
  42. static void ConfirmationRequest(const char * const);
  43. static void StatusChange(const char * const);
  44. static void SendtoTFT(FSTR_P const=nullptr);
  45. //static void SendtoTFTLN(FSTR_P const=nullptr);
  46. static void UpdateOnChange();
  47. static void PrintFinished();
  48. static void PanelInfo(uint8_t);
  49. private:
  50. static bool ReadTFTCommand();
  51. static void SendFileList(int8_t);
  52. static void SelectFile();
  53. static void ProcessPanelRequest();
  54. static void PanelAction(uint8_t);
  55. static void _format_time(char *, uint32_t);
  56. };
  57. extern NextionTFT nextion;