My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 "extensible_ui/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. }
  83. #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI