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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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 onHomingStart() {}
  49. void onHomingComplete() {}
  50. void onPrintFinished() {}
  51. void onFactoryReset() {}
  52. void onStoreSettings(char *buff) {
  53. // Called when saving to EEPROM (i.e. M500). If the ExtUI needs
  54. // permanent data to be stored, it can write up to eeprom_data_size bytes
  55. // into buff.
  56. // Example:
  57. // static_assert(sizeof(myDataStruct) <= eeprom_data_size);
  58. // memcpy(buff, &myDataStruct, sizeof(myDataStruct));
  59. }
  60. void onLoadSettings(const char *buff) {
  61. // Called while loading settings from EEPROM. If the ExtUI
  62. // needs to retrieve data, it should copy up to eeprom_data_size bytes
  63. // from buff
  64. // Example:
  65. // static_assert(sizeof(myDataStruct) <= eeprom_data_size);
  66. // memcpy(&myDataStruct, buff, sizeof(myDataStruct));
  67. }
  68. void onPostprocessSettings() {
  69. // Called after loading or resetting stored settings
  70. }
  71. void onConfigurationStoreWritten(bool success) {
  72. // Called after the entire EEPROM has been written,
  73. // whether successful or not.
  74. }
  75. void onConfigurationStoreRead(bool success) {
  76. // Called after the entire EEPROM has been read,
  77. // whether successful or not.
  78. }
  79. #if HAS_MESH
  80. void onMeshLevelingStart() {}
  81. void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
  82. // Called when any mesh points are updated
  83. }
  84. #endif
  85. #if ENABLED(POWER_LOSS_RECOVERY)
  86. void onPowerLossResume() {
  87. // Called on resume from power-loss
  88. }
  89. #endif
  90. #if HAS_PID_HEATING
  91. void onPidTuning(const result_t rst) {
  92. // Called for temperature PID tuning result
  93. }
  94. #endif
  95. void onSteppersDisabled() {}
  96. void onSteppersEnabled() {}
  97. }
  98. #endif // ANYCUBIC_LCD_I3MEGA