16 Commits (1c384930f324c25f0f88124ff146f072cb8cecff)

Author SHA1 Message Date
Scott Lahteine f9ded2a7c4 Wrap macros to prevent bad expansions 9 years ago
Scott Lahteine ff13070b59 Use _BV macros, patch up others 9 years ago
Scott Lahteine 209f5f21e0 Use macros where possible
Apply `constrain`, `NOMORE`, `NOLESS` and `CRITICAL_SECTION` macros
wherever possible.
9 years ago
Scott Lahteine 0c7f7ebcfb Styling adjustments (PR#2668 & PR#2670)
Keep "astyled" reformatting
9 years ago
Scott Lahteine 46453905d6 Apply remaining ENABLED/DISABLED conditionals 9 years ago
Scott Lahteine 58cfcd4239 Overridable Options - Part 5
Apply `ENABLED` / `DISABLED` macros to files needing only a small
number of changes.
9 years ago
AnHardt 8b876241bd 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.
9 years ago
Scott Lahteine 96ace72ddc Servos attach/detach based only on servo config
Assuming #2470 fixed up the main issue.
9 years ago
Scott Lahteine eacfe132aa Change the name of servos[] and servo_t 9 years ago
Scott Lahteine 3b23ccd366 Patch servos code for move
- Have `Servo::attach` explicitly return -1 if it fails
- Check for -1 in `Servo::move` because `servoIndex` might be 0
- Make `attach` / `detach` calls conditional on `SERVO_LEVELING`
- Move `SERVO_LEVELING` define to `Conditionals.h`
9 years ago
AnHardt a6628f12cc Eliminate the further use of the pin-parameter 9 years ago
AnHardt 8504992e9f Remove the additional pin variable in Servo.cpp
as sugested by @c-born
inhttps://github.com/MarlinFirmware/Marlin/issues/1885#issuecomment-92618240
9 years ago
Scott Lahteine 391386dd94 Update configs for new servo deactivation 9 years ago
AnHardt 2ddb2a2be9 Add Servo::move() to servo.cpp
move(pin, angel) - Sequence of attach(pin), write(angel),
                   if DEACTIVATE_SERVOS_AFTER_MOVE is defined waits SERVO_DEACTIVATION_DELAY, than detaches.

As we have jitter on the servos during moves of the steppers, and detaching them improves this behaviour,
the usual sequence to handle a servo movement is:
attach(pin)
write(angel)
delay(until the servo finished the move)
detache()

Here a function to handle the complete sequence.
9 years ago
Scott Lahteine 42465ee444 Cleanup of comments & spacing 10 years ago
Ivan Galvez Junquera 59529b755d Fixed lowercase change missing on commit a22a228b.
Servo.cpp and Servo.h were changed to lowercase in Makefile but not their actual filenames.
10 years ago