You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
535 B
C++
29 lines
535 B
C++
8 years ago
|
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
|
||
|
|
||
|
|
||
|
#include "HAL_Servo_Teensy.h"
|
||
|
#include "../../../MarlinConfig.h"
|
||
|
|
||
|
|
||
|
int8_t libServo::attach(int pin) {
|
||
|
if (this->servoIndex >= MAX_SERVOS) return -1;
|
||
|
return Servo::attach(pin);
|
||
|
}
|
||
|
|
||
|
int8_t libServo::attach(int pin, int min, int max) {
|
||
|
return Servo::attach(pin, min, max);
|
||
|
}
|
||
|
|
||
|
void libServo::move(int value) {
|
||
|
if (this->attach(0) >= 0) {
|
||
|
this->write(value);
|
||
|
delay(SERVO_DELAY);
|
||
|
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
||
|
this->detach();
|
||
|
#endif
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
#endif
|