My Marlin configs for Fabrikator Mini and CTC i3 Pro B
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

chiron_extui.cpp 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. * lcd/extui/anycubic_chiron/chiron_extui.cpp
  24. *
  25. * Anycubic Chiron TFT support for Marlin
  26. */
  27. #include "../../../inc/MarlinConfigPre.h"
  28. #if ENABLED(ANYCUBIC_LCD_CHIRON)
  29. #include "../ui_api.h"
  30. #include "chiron_tft.h"
  31. using namespace Anycubic;
  32. namespace ExtUI {
  33. void onStartup() { Chiron.Startup(); }
  34. void onIdle() { Chiron.IdleLoop(); }
  35. void onPrinterKilled(PGM_P const error, PGM_P const component) {
  36. Chiron.PrinterKilled(error,component);
  37. }
  38. void onMediaInserted() { Chiron.MediaEvent(AC_media_inserted); }
  39. void onMediaError() { Chiron.MediaEvent(AC_media_error); }
  40. void onMediaRemoved() { Chiron.MediaEvent(AC_media_removed); }
  41. void onPlayTone(const uint16_t frequency, const uint16_t duration) {
  42. #if ENABLED(SPEAKER)
  43. ::tone(BEEPER_PIN, frequency, duration);
  44. #endif
  45. }
  46. void onPrintTimerStarted() { Chiron.TimerEvent(AC_timer_started); }
  47. void onPrintTimerPaused() { Chiron.TimerEvent(AC_timer_paused); }
  48. void onPrintTimerStopped() { Chiron.TimerEvent(AC_timer_stopped); }
  49. void onFilamentRunout(const extruder_t) { Chiron.FilamentRunout(); }
  50. void onUserConfirmRequired(const char * const msg) { Chiron.ConfirmationRequest(msg); }
  51. void onStatusChanged(const char * const msg) { Chiron.StatusChange(msg); }
  52. void onHomingStart() {}
  53. void onHomingComplete() {}
  54. void onPrintFinished() {}
  55. void onFactoryReset() {}
  56. void onStoreSettings(char *buff) {
  57. // Called when saving to EEPROM (i.e. M500). If the ExtUI needs
  58. // permanent data to be stored, it can write up to eeprom_data_size bytes
  59. // into buff.
  60. // Example:
  61. // static_assert(sizeof(myDataStruct) <= eeprom_data_size);
  62. // memcpy(buff, &myDataStruct, sizeof(myDataStruct));
  63. }
  64. void onLoadSettings(const char *buff) {
  65. // Called while loading settings from EEPROM. If the ExtUI
  66. // needs to retrieve data, it should copy up to eeprom_data_size bytes
  67. // from buff
  68. // Example:
  69. // static_assert(sizeof(myDataStruct) <= eeprom_data_size);
  70. // memcpy(&myDataStruct, buff, sizeof(myDataStruct));
  71. }
  72. void onPostprocessSettings() {
  73. // Called after loading or resetting stored settings
  74. }
  75. void onConfigurationStoreWritten(bool success) {
  76. // Called after the entire EEPROM has been written,
  77. // whether successful or not.
  78. }
  79. void onConfigurationStoreRead(bool success) {
  80. // Called after the entire EEPROM has been read,
  81. // whether successful or not.
  82. }
  83. #if HAS_MESH
  84. void onMeshLevelingStart() {}
  85. void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
  86. // Called when any mesh points are updated
  87. //SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);
  88. }
  89. void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) {
  90. // Called to indicate a special condition
  91. //SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " state:", state);
  92. }
  93. #endif
  94. #if ENABLED(POWER_LOSS_RECOVERY)
  95. // Called on resume from power-loss
  96. void onPowerLossResume() { Chiron.PowerLossRecovery(); }
  97. #endif
  98. #if HAS_PID_HEATING
  99. void onPidTuning(const result_t rst) {
  100. // Called for temperature PID tuning result
  101. }
  102. #endif
  103. void onSteppersDisabled() {}
  104. void onSteppersEnabled() {}
  105. }
  106. #endif // ANYCUBIC_LCD_CHIRON