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.

extui_dgus_lcd.cpp 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * extui_dgus_lcd.cpp
  24. *
  25. * DGUS implementation for Marlin by coldtobi, Feb-May 2019
  26. */
  27. #include "../inc/MarlinConfigPre.h"
  28. #if ENABLED(DGUS_LCD)
  29. #include "extensible_ui/ui_api.h"
  30. #include "extensible_ui/lib/dgus/DGUSDisplay.h"
  31. #include "extensible_ui/lib/dgus/DGUSDisplayDefinition.h"
  32. namespace ExtUI {
  33. void onStartup() {
  34. dgusdisplay.InitDisplay();
  35. ScreenHandler.UpdateScreenVPData();
  36. }
  37. void onIdle() { ScreenHandler.loop(); }
  38. void onPrinterKilled(PGM_P error, PGM_P component) {
  39. ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, PSTR(""), GET_TEXT(MSG_PLEASE_RESET), true, true, true, true);
  40. ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL);
  41. while (!ScreenHandler.loop()); // Wait while anything is left to be sent
  42. }
  43. void onMediaInserted() { ScreenHandler.SDCardInserted(); }
  44. void onMediaError() { ScreenHandler.SDCardError(); }
  45. void onMediaRemoved() { ScreenHandler.SDCardRemoved(); }
  46. void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
  47. void onPrintTimerStarted() {}
  48. void onPrintTimerPaused() {}
  49. void onPrintTimerStopped() {}
  50. void onFilamentRunout(const extruder_t extruder) {}
  51. void onUserConfirmRequired(const char * const msg) {
  52. if (msg) {
  53. ScreenHandler.sendinfoscreen(PSTR("Please confirm."), nullptr, msg, nullptr, true, true, false, true);
  54. ScreenHandler.SetupConfirmAction(ExtUI::setUserConfirmed);
  55. ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POPUP);
  56. }
  57. else if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_POPUP ) {
  58. ScreenHandler.SetupConfirmAction(nullptr);
  59. ScreenHandler.PopToOldScreen();
  60. }
  61. }
  62. void onStatusChanged(const char * const msg) { ScreenHandler.setstatusmessage(msg); }
  63. void onFactoryReset() {}
  64. void onLoadSettings() {}
  65. void onStoreSettings() {}
  66. }
  67. #endif // DGUS_LCD