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.

kill_screen.cpp 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*******************
  2. * kill_screen.cpp *
  3. *******************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  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. * To view a copy of the GNU General Public License, go to the following *
  19. * location: <https://www.gnu.org/licenses/>. *
  20. ****************************************************************************/
  21. #include "../config.h"
  22. #if ENABLED(TOUCH_UI_FTDI_EVE)
  23. #include "screens.h"
  24. using namespace FTDI;
  25. // The kill screen is an oddball that happens after Marlin has killed the events
  26. // loop. So we only have a show() method rather than onRedraw(). The KillScreen
  27. // should not be used as a model for other UI screens as it is an exception.
  28. void KillScreen::show(const char *message) {
  29. CommandProcessor cmd;
  30. cmd.cmd(CMD_DLSTART)
  31. .cmd(CLEAR_COLOR_RGB(Theme::bg_color))
  32. .cmd(CLEAR(true,true,true))
  33. .tag(0);
  34. #define GRID_COLS 4
  35. #define GRID_ROWS 8
  36. cmd.font(Theme::font_large)
  37. .cmd(COLOR_RGB(Theme::bg_text_enabled))
  38. .text(BTN_POS(1,2), BTN_SIZE(4,1), message)
  39. .text(BTN_POS(1,3), BTN_SIZE(4,1), GET_TEXT_F(MSG_HALTED))
  40. .text(BTN_POS(1,6), BTN_SIZE(4,1), GET_TEXT_F(MSG_PLEASE_RESET));
  41. #undef GRID_COLS
  42. #undef GRID_ROWS
  43. cmd.cmd(DL::DL_DISPLAY)
  44. .cmd(CMD_SWAP)
  45. .execute();
  46. InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FAILED, PLAY_SYNCHRONOUS);
  47. }
  48. #endif // TOUCH_UI_FTDI_EVE