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.

anycubic_i3mega_lcd.cpp 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 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. * anycubic_i3mega_lcd.cpp
  24. */
  25. #include "../../inc/MarlinConfigPre.h"
  26. #if ENABLED(ANYCUBIC_LCD_I3MEGA)
  27. #include "lib/anycubic_i3mega/anycubic_i3mega_lcd.h"
  28. #include "ui_api.h"
  29. #include <Arduino.h> // for the ::tone() call
  30. namespace ExtUI {
  31. void onStartup() { AnycubicTFT.OnSetup(); }
  32. void onIdle() { AnycubicTFT.OnCommandScan(); }
  33. void onPrinterKilled(PGM_P const error, PGM_P const component) { AnycubicTFT.OnKillTFT(); }
  34. void onMediaInserted() { AnycubicTFT.OnSDCardStateChange(true); }
  35. void onMediaError() { AnycubicTFT.OnSDCardError(); }
  36. void onMediaRemoved() { AnycubicTFT.OnSDCardStateChange(false); }
  37. void onPlayTone(const uint16_t frequency, const uint16_t duration) {
  38. #if ENABLED(SPEAKER)
  39. ::tone(BEEPER_PIN, frequency, duration);
  40. #endif
  41. }
  42. void onPrintTimerStarted() { AnycubicTFT.OnPrintTimerStarted(); }
  43. void onPrintTimerPaused() { AnycubicTFT.OnPrintTimerPaused(); }
  44. void onPrintTimerStopped() { AnycubicTFT.OnPrintTimerStopped(); }
  45. void onFilamentRunout(const extruder_t extruder) { AnycubicTFT.OnFilamentRunout(); }
  46. void onUserConfirmRequired(const char * const msg) { AnycubicTFT.OnUserConfirmRequired(msg); }
  47. void onStatusChanged(const char * const msg) {}
  48. void onFactoryReset() {}
  49. void onStoreSettings(char *buff) {
  50. // Called when saving to EEPROM (i.e. M500). If the ExtUI needs
  51. // permanent data to be stored, it can write up to eeprom_data_size bytes
  52. // into buff.
  53. // Example:
  54. // static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size);
  55. // memcpy(buff, &myDataStruct, sizeof(myDataStruct));
  56. }
  57. void onLoadSettings(const char *buff) {
  58. // Called while loading settings from EEPROM. If the ExtUI
  59. // needs to retrieve data, it should copy up to eeprom_data_size bytes
  60. // from buff
  61. // Example:
  62. // static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size);
  63. // memcpy(&myDataStruct, buff, sizeof(myDataStruct));
  64. }
  65. void onConfigurationStoreWritten(bool success) {
  66. // Called after the entire EEPROM has been written,
  67. // whether successful or not.
  68. }
  69. void onConfigurationStoreRead(bool success) {
  70. // Called after the entire EEPROM has been read,
  71. // whether successful or not.
  72. }
  73. void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
  74. // Called when any mesh points are updated
  75. }
  76. #if ENABLED(POWER_LOSS_RECOVERY)
  77. void onPowerLossResume() {
  78. // Called on resume from power-loss
  79. }
  80. #endif
  81. #if HAS_PID_HEATING
  82. void onPidTuning(const result_t rst) {
  83. // Called for temperature PID tuning result
  84. }
  85. #endif
  86. }
  87. #endif // ANYCUBIC_LCD_I3MEGA