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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*********************
  2. * extui_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: <http://www.gnu.org/licenses/>. *
  19. ****************************************************************************/
  20. #include "../inc/MarlinConfigPre.h"
  21. #if BOTH(EXTUI_EXAMPLE, EXTENSIBLE_UI)
  22. #include "extui/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 onFactoryReset() {}
  55. void onStoreSettings(char *buff) {
  56. // Called when saving to EEPROM (i.e. M500). If the ExtUI needs
  57. // permanent data to be stored, it can write up to eeprom_data_size bytes
  58. // into buff.
  59. // Example:
  60. // static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size);
  61. // memcpy(buff, &myDataStruct, sizeof(myDataStruct));
  62. }
  63. void onLoadSettings(const char *buff) {
  64. // Called while loading settings from EEPROM. If the ExtUI
  65. // needs to retrieve data, it should copy up to eeprom_data_size bytes
  66. // from buff
  67. // Example:
  68. // static_assert(sizeof(myDataStruct) <= ExtUI::eeprom_data_size);
  69. // memcpy(&myDataStruct, buff, sizeof(myDataStruct));
  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. void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float zval) {
  80. // Called when any mesh points are updated
  81. }
  82. #if ENABLED(POWER_LOSS_RECOVERY)
  83. void OnPowerLossResume() {
  84. // Called on resume from power-loss
  85. }
  86. #endif
  87. #if HAS_PID_HEATING
  88. void OnPidTuning(const result_t rst) {
  89. // Called for temperature PID tuning result
  90. }
  91. #endif
  92. }
  93. #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI