muele-marlin/Marlin/src/HAL/HAL_TEENSY35_36/HAL_Servo_Teensy.cpp

26 lines
600 B
C++
Raw Normal View History

#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
#include "HAL_Servo_Teensy.h"
2017-09-06 11:28:32 +00:00
#include "../../inc/MarlinConfig.h"
2017-09-27 08:33:29 +00:00
int8_t libServo::attach(const int pin) {
if (this->servoIndex >= MAX_SERVOS) return -1;
return Servo::attach(pin);
}
2017-09-27 08:33:29 +00:00
int8_t libServo::attach(const int pin, const int min, const int max) {
return Servo::attach(pin, min, max);
}
2017-09-27 08:33:29 +00:00
void libServo::move(const int value) {
if (this->attach(0) >= 0) {
this->write(value);
delay(SERVO_DELAY);
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
this->detach();
#endif
}
}
2017-09-27 08:33:29 +00:00
#endif // __MK64FX512__ || __MK66FX1M0__