My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

menu_backlash.cpp 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. // Backlash Menu
  24. //
  25. #include "../../inc/MarlinConfigPre.h"
  26. #if BOTH(HAS_MARLINUI_MENU, BACKLASH_GCODE)
  27. #include "menu_item.h"
  28. #include "../../feature/backlash.h"
  29. void menu_backlash() {
  30. START_MENU();
  31. BACK_ITEM(MSG_MAIN);
  32. editable.uint8 = backlash.get_correction_uint8();
  33. EDIT_ITEM_FAST(percent, MSG_BACKLASH_CORRECTION, &editable.uint8, backlash.all_off, backlash.all_on, []{ backlash.set_correction_uint8(editable.uint8); });
  34. #if DISABLED(CORE_BACKLASH) || EITHER(MARKFORGED_XY, MARKFORGED_YX)
  35. #define _CAN_CALI AXIS_CAN_CALIBRATE
  36. #else
  37. #define _CAN_CALI(A) true
  38. #endif
  39. #define EDIT_BACKLASH_DISTANCE(N) do { \
  40. editable.decimal = backlash.get_distance_mm(_AXIS(N)); \
  41. EDIT_ITEM_FAST_N(float43, _AXIS(N), MSG_BACKLASH_N, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_distance_mm(_AXIS(N), editable.decimal); }); \
  42. } while (0);
  43. if (_CAN_CALI(A)) EDIT_BACKLASH_DISTANCE(A);
  44. #if HAS_Y_AXIS && _CAN_CALI(B)
  45. EDIT_BACKLASH_DISTANCE(B);
  46. #endif
  47. #if HAS_Z_AXIS && _CAN_CALI(C)
  48. EDIT_BACKLASH_DISTANCE(C);
  49. #endif
  50. #if HAS_I_AXIS && _CAN_CALI(I)
  51. EDIT_BACKLASH_DISTANCE(I);
  52. #endif
  53. #if HAS_J_AXIS && _CAN_CALI(J)
  54. EDIT_BACKLASH_DISTANCE(J);
  55. #endif
  56. #if HAS_K_AXIS && _CAN_CALI(K)
  57. EDIT_BACKLASH_DISTANCE(K);
  58. #endif
  59. #if HAS_U_AXIS && _CAN_CALI(U)
  60. EDIT_BACKLASH_DISTANCE(U);
  61. #endif
  62. #if HAS_V_AXIS && _CAN_CALI(V)
  63. EDIT_BACKLASH_DISTANCE(V);
  64. #endif
  65. #if HAS_W_AXIS && _CAN_CALI(W)
  66. EDIT_BACKLASH_DISTANCE(W);
  67. #endif
  68. #ifdef BACKLASH_SMOOTHING_MM
  69. editable.decimal = backlash.get_smoothing_mm();
  70. EDIT_ITEM_FAST(float43, MSG_BACKLASH_SMOOTHING, &editable.decimal, 0.0f, 9.9f, []{ backlash.set_smoothing_mm(editable.decimal); });
  71. #endif
  72. END_MENU();
  73. }
  74. #endif // HAS_MARLINUI_MENU && BACKLASH_GCODE