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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2019 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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * M421.cpp - Auto Bed Leveling
  24. */
  25. #include "../../../inc/MarlinConfig.h"
  26. #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
  27. #include "../../gcode.h"
  28. #include "../../../feature/bedlevel/abl/abl.h"
  29. /**
  30. * M421: Set a single Mesh Bed Leveling Z coordinate
  31. *
  32. * Usage:
  33. * M421 I<xindex> J<yindex> Z<linear>
  34. * M421 I<xindex> J<yindex> Q<offset>
  35. */
  36. void GcodeSuite::M421() {
  37. int8_t ix = parser.intval('I', -1), iy = parser.intval('J', -1);
  38. const bool hasI = ix >= 0,
  39. hasJ = iy >= 0,
  40. hasZ = parser.seen('Z'),
  41. hasQ = !hasZ && parser.seen('Q');
  42. if (!hasI || !hasJ || !(hasZ || hasQ))
  43. SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS);
  44. else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))
  45. SERIAL_ERROR_MSG(MSG_ERR_MESH_XY);
  46. else {
  47. z_values[ix][iy] = parser.value_linear_units() + (hasQ ? z_values[ix][iy] : 0);
  48. #if ENABLED(ABL_BILINEAR_SUBDIVISION)
  49. bed_level_virt_interpolate();
  50. #endif
  51. #if ENABLED(EXTENSIBLE_UI)
  52. ExtUI::onMeshUpdate(ix, iy, z_values[ix][iy]);
  53. #endif
  54. }
  55. }
  56. #endif // AUTO_BED_LEVELING_BILINEAR