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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. * Copyright (c) 2017 Victor Perez
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. #if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F7))
  24. #include "../../inc/MarlinConfig.h"
  25. #if HAS_SERVOS
  26. #include "Servo.h"
  27. int8_t libServo::attach(const int pin) {
  28. if (servoIndex >= MAX_SERVOS) return -1;
  29. return super::attach(pin);
  30. }
  31. int8_t libServo::attach(const int pin, const int min, const int max) {
  32. return super::attach(pin, min, max);
  33. }
  34. void libServo::move(const int value) {
  35. constexpr uint16_t servo_delay[] = SERVO_DELAY;
  36. static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
  37. if (attach(0) >= 0) {
  38. write(value);
  39. safe_delay(servo_delay[servoIndex]);
  40. TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
  41. }
  42. }
  43. #endif // HAS_SERVOS
  44. #endif // STM32GENERIC && (STM32F4 || STM32F7)