Some more servo code tweaks
Just set up the pin. Don't move to a random position. Simplify servo::move() * servo::move() does not need the pin parameter - The pin is set during servo_init() with attach(). * servo::move() does not need a return value. SERVO_LEVELING is the wrong condition to deactivate the servos. Remove some temporary (Servo *) variables. SanityCheck for the servo indexes.
This commit is contained in:
committed by
Richard Wackerbarth
parent
b116c096bd
commit
8b876241bd
@@ -511,5 +511,21 @@
|
||||
|
||||
#define HAS_BUZZER ((defined(BEEPER) && BEEPER >= 0) || defined(LCD_USE_I2C_BUZZER))
|
||||
|
||||
|
||||
#if defined( NUM_SERVOS ) && (NUM_SERVOS > 0)
|
||||
#ifndef X_ENDSTOP_SERVO_NR
|
||||
#define X_ENDSTOP_SERVO_NR -1
|
||||
#endif
|
||||
#ifndef Y_ENDSTOP_SERVO_NR
|
||||
#define Y_ENDSTOP_SERVO_NR -1
|
||||
#endif
|
||||
#ifndef Z_ENDSTOP_SERVO_NR
|
||||
#define Z_ENDSTOP_SERVO_NR -1
|
||||
#endif
|
||||
#if (X_ENDSTOP_SERVO_NR >= 0) || (Y_ENDSTOP_SERVO_NR >= 0) || (Z_ENDSTOP_SERVO_NR >= 0)
|
||||
#define SERVO_ENDSTOPS {X_ENDSTOP_SERVO_NR, Y_ENDSTOP_SERVO_NR, Z_ENDSTOP_SERVO_NR}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif //CONFIGURATION_LCD
|
||||
#endif //CONDITIONALS_H
|
||||
|
Reference in New Issue
Block a user