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.

boot_screen.cpp 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*******************
  2. * boot_screen.cpp *
  3. *******************/
  4. /****************************************************************************
  5. * Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
  6. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  7. * Written By Marcio Teixeira 2019 - Cocoa Press *
  8. * *
  9. * This program is free software: you can redistribute it and/or modify *
  10. * it under the terms of the GNU General Public License as published by *
  11. * the Free Software Foundation, either version 3 of the License, or *
  12. * (at your option) any later version. *
  13. * *
  14. * This program is distributed in the hope that it will be useful, *
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  17. * GNU General Public License for more details. *
  18. * *
  19. * To view a copy of the GNU General Public License, go to the following *
  20. * location: <http://www.gnu.org/licenses/>. *
  21. ****************************************************************************/
  22. #include "../config.h"
  23. #if ENABLED(TOUCH_UI_FTDI_EVE)
  24. #include "screens.h"
  25. #include "../ftdi_eve_lib/extras/poly_ui.h"
  26. #include "../archim2-flash/flash_storage.h"
  27. #ifdef SHOW_CUSTOM_BOOTSCREEN
  28. #ifdef TOUCH_UI_PORTRAIT
  29. #include "../theme/_bootscreen_portrait.h"
  30. #else
  31. #include "../theme/_bootscreen_landscape.h"
  32. #endif
  33. #else
  34. #ifdef TOUCH_UI_PORTRAIT
  35. #include "../theme/marlin_bootscreen_portrait.h"
  36. #else
  37. #include "../theme/marlin_bootscreen_landscape.h"
  38. #endif
  39. #endif
  40. using namespace FTDI;
  41. using namespace Theme;
  42. void BootScreen::onRedraw(draw_mode_t) {
  43. CommandProcessor cmd;
  44. cmd.cmd(CLEAR_COLOR_RGB(0x000000));
  45. cmd.cmd(CLEAR(true,true,true));
  46. CLCD::turn_on_backlight();
  47. SoundPlayer::set_volume(255);
  48. }
  49. void BootScreen::onIdle() {
  50. if (CLCD::is_touching()) {
  51. // If the user is touching the screen at startup, then
  52. // assume the user wants to re-calibrate the screen.
  53. // This gives the user the ability to recover a
  54. // miscalibration that has been stored to EEPROM.
  55. // Also reset display parameters to defaults, just
  56. // in case the display is borked.
  57. InterfaceSettingsScreen::failSafeSettings();
  58. StatusScreen::loadBitmaps();
  59. GOTO_SCREEN(TouchCalibrationScreen);
  60. current_screen.forget();
  61. PUSH_SCREEN(StatusScreen);
  62. StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG));
  63. } else {
  64. if (!UIFlashStorage::is_valid()) {
  65. StatusScreen::loadBitmaps();
  66. SpinnerDialogBox::show(GET_TEXT_F(MSG_PLEASE_WAIT));
  67. UIFlashStorage::format_flash();
  68. SpinnerDialogBox::hide();
  69. }
  70. if (UIData::animations_enabled()) {
  71. // If there is a startup video in the flash SPI, play
  72. // that, otherwise show a static splash screen.
  73. if (!MediaPlayerScreen::playBootMedia())
  74. showSplashScreen();
  75. }
  76. StatusScreen::loadBitmaps();
  77. #ifdef TOUCH_UI_LULZBOT_BIO
  78. GOTO_SCREEN(BioConfirmHomeXYZ);
  79. current_screen.forget();
  80. PUSH_SCREEN(StatusScreen);
  81. PUSH_SCREEN(BioConfirmHomeE);
  82. #elif NUM_LANGUAGES > 1
  83. StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG));
  84. GOTO_SCREEN(LanguageMenu);
  85. #else
  86. StatusScreen::setStatusMessage(GET_TEXT_F(WELCOME_MSG));
  87. GOTO_SCREEN(StatusScreen);
  88. #endif
  89. }
  90. }
  91. void BootScreen::showSplashScreen() {
  92. CommandProcessor cmd;
  93. cmd.cmd(CMD_DLSTART);
  94. cmd.cmd(CLEAR_COLOR_RGB(LOGO_BACKGROUND));
  95. cmd.cmd(CLEAR(true,true,true));
  96. #define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0]))
  97. #define LOGO_PAINT_PATH(rgb, path) cmd.cmd(COLOR_RGB(rgb)); ui.fill(POLY(path));
  98. PolyUI ui(cmd);
  99. LOGO_PAINT_PATHS
  100. cmd.cmd(DL::DL_DISPLAY);
  101. cmd.cmd(CMD_SWAP);
  102. cmd.execute();
  103. ExtUI::delay_ms(2500);
  104. }
  105. #endif // TOUCH_UI_FTDI_EVE