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.

dwin_lcd.cpp 2.2KB

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. /********************************************************************************
  23. * @file lcd/e3v2/marlinui/dwin_lcd.cpp
  24. * @brief DWIN screen control functions
  25. ********************************************************************************/
  26. #include "../../../inc/MarlinConfigPre.h"
  27. #if IS_DWIN_MARLINUI
  28. #include "../../../inc/MarlinConfig.h"
  29. #include "dwin_lcd.h"
  30. #include <string.h> // for memset
  31. //#define DEBUG_OUT 1
  32. #include "../../../core/debug_out.h"
  33. /*-------------------------------------- System variable function --------------------------------------*/
  34. void DWIN_Startup() {
  35. DEBUG_ECHOPGM("\r\nDWIN handshake ");
  36. delay(750); // Delay here or init later in the boot process
  37. const bool success = DWIN_Handshake();
  38. if (success) DEBUG_ECHOLNPGM("ok."); else DEBUG_ECHOLNPGM("error.");
  39. DWIN_Frame_SetDir(TERN(DWIN_MARLINUI_LANDSCAPE, 0, 1));
  40. DWIN_Frame_Clear(Color_Bg_Black); // MarlinUI handles the bootscreen so just clear here
  41. DWIN_JPG_ShowAndCache(3);
  42. DWIN_UpdateLCD();
  43. }
  44. /*---------------------------------------- Picture related functions ----------------------------------------*/
  45. // Draw an Icon
  46. // libID: Icon library ID
  47. // picID: Icon ID
  48. // x/y: Upper-left point
  49. void DWIN_ICON_Show(uint8_t libID, uint8_t picID, uint16_t x, uint16_t y) {
  50. DWIN_ICON_Show(true, false, false, libID, picID, x, y);
  51. }
  52. #endif // IS_DWIN_MARLINUI