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.

example.cpp 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*********************
  2. * example.cpp *
  3. *********************/
  4. /****************************************************************************
  5. * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
  6. * *
  7. * This program is free software: you can redistribute it and/or modify *
  8. * it under the terms of the GNU General Public License as published by *
  9. * the Free Software Foundation, either version 3 of the License, or *
  10. * (at your option) any later version. *
  11. * *
  12. * This program is distributed in the hope that it will be useful, *
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  15. * GNU General Public License for more details. *
  16. * *
  17. * To view a copy of the GNU General Public License, go to the following *
  18. * location: <https://www.gnu.org/licenses/>. *
  19. ****************************************************************************/
  20. #include "../../../inc/MarlinConfigPre.h"
  21. #if BOTH(EXTUI_EXAMPLE, EXTENSIBLE_UI)
  22. #include "../ui_api.h"
  23. // To implement a new UI, complete the functions below and
  24. // read or update Marlin's state using the methods in the
  25. // ExtUI methods in "../ui_api.h"
  26. //
  27. // Although it may be possible to access other state
  28. // variables from Marlin, using the API here possibly
  29. // helps ensure future compatibility.
  30. namespace ExtUI {
  31. void onStartup() {
  32. /* Initialize the display module here. The following
  33. * routines are available for access to the GPIO pins:
  34. *
  35. * SET_OUTPUT(pin)
  36. * SET_INPUT_PULLUP(pin)
  37. * SET_INPUT(pin)
  38. * WRITE(pin,value)
  39. * READ(pin)
  40. */
  41. }
  42. void onIdle() {}
  43. void onPrinterKilled(PGM_P const error, PGM_P const component) {}
  44. void onMediaInserted() {}
  45. void onMediaError() {}
  46. void onMediaRemoved() {}
  47. void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
  48. void onPrintTimerStarted() {}
  49. void onPrintTimerPaused() {}
  50. void onPrintTimerStopped() {}
  51. void onFilamentRunout(const extruder_t extruder) {}
  52. void onUserConfirmRequired(const char * const msg) {}
  53. void onStatusChanged(const char * const msg) {}
  54. void onHomingStart() {}
  55. void onHomingComplete() {}
  56. void onPrintFinished() {}
  57. void onFactoryReset() {}
  58. void onStoreSettings(char *buff) {
  59. // Called when saving to EEPROM (i.e. M500). If the ExtUI needs
  60. // permanent data to be stored, it can write up to eeprom_data_size bytes
  61. // into buff.
  62. // Example:
  63. // static_assert(sizeof(myDataStruct) <= eeprom_data_size);
  64. // memcpy(buff, &myDataStruct, sizeof(myDataStruct));
  65. }
  66. void onLoadSettings(const char *buff) {
  67. // Called while loading settings from EEPROM. If the ExtUI
  68. // needs to retrieve data, it should copy up to eeprom_data_size bytes
  69. // from buff
  70. // Example:
  71. // static_assert(sizeof(myDataStruct) <= eeprom_data_size);
  72. // memcpy(&myDataStruct, buff, sizeof(myDataStruct));
  73. }
  74. void onPostprocessSettings() {
  75. // Called after loading or resetting stored settings
  76. }
  77. void onConfigurationStoreWritten(bool success) {
  78. // Called after the entire EEPROM has been written,
  79. // whether successful or not.
  80. }
  81. void onConfigurationStoreRead(bool success) {
  82. // Called after the entire EEPROM has been read,
  83. // whether successful or not.
  84. }
  85. #if HAS_MESH
  86. void onMeshLevelingStart() {}
  87. void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
  88. // Called when any mesh points are updated
  89. }
  90. void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) {
  91. // Called to indicate a special condition
  92. }
  93. #endif
  94. #if ENABLED(POWER_LOSS_RECOVERY)
  95. void onPowerLossResume() {
  96. // Called on resume from power-loss
  97. }
  98. #endif
  99. #if HAS_PID_HEATING
  100. void onPidTuning(const result_t rst) {
  101. // Called for temperature PID tuning result
  102. }
  103. #endif
  104. void onSteppersDisabled() {}
  105. void onSteppersEnabled() {}
  106. }
  107. #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI