Skip to content

Commit

Permalink
Tiny bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
peteGSX committed Feb 20, 2024
1 parent f1547d3 commit 3831a6d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions IOFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ void displayTTEXConfig() {
Serial.println(F("EX-Turntable in TURNTABLE mode"));
#endif

#if defined(ROTATE_FORWARD_ONLY)
Serial.println(F("Rotating in forward direction only"));
#elif defined(ROTATE_REVERSE_ONLY)
Serial.println(F("Rotating in reverse direction only"));
#else
Serial.println(F("Rotating/moving in the shortest direction"));
#endif

// If in sensor testing mode, display this, don't enable stepper or I2C
if (sensorTesting) {
Serial.println(F("SENSOR TESTING ENABLED, EX-Turntable operations disabled"));
Expand Down
10 changes: 9 additions & 1 deletion TurntableFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ void moveToPosition(long steps, uint8_t phaseSwitch) {
#if TURNTABLE_EX_MODE == TRAVERSER
// If we're in traverser mode, very simple logic, negative move to limit, positive move to home.
moveSteps = lastStep - steps;
#else
// In turntable mode we can force always moving forwards or reverse
#if defined(ROTATE_FORWARD_ONLY)
if (debug) Serial.println(F("Force forward move only"));
if ()
#elif defined(ROTATE_REVERSE_ONLY)

#else
if ((steps - lastStep) > halfTurnSteps) {
moveSteps = steps - fullTurnSteps - lastStep;
Expand All @@ -181,7 +188,8 @@ void moveToPosition(long steps, uint8_t phaseSwitch) {
} else {
moveSteps = steps - lastStep;
}
#endif
#endif // Turntable forward/reverse/shortest distance
#endif // Turntable/traverser
Serial.print(F(" - moving "));
Serial.print(moveSteps);
Serial.println(F(" steps"));
Expand Down
4 changes: 4 additions & 0 deletions defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@
#error Both ROTATE_FORWARD_ONLY and ROTATE_REVERSE_ONLY defined, please only define one or the other
#endif

#if (TURNTABLE_EX_MODE == TRAVERSER && defined(ROTATE_FORWARD_ONLY)) || (TURNTABLE_EX_MODE == TRAVERSER && defined(ROTATE_REVERSE_ONLY))
#error Traverser mode cannot operate with ROTATE_FORWARD_ONLY or ROTATE_REVERSE_ONLY
#endif

#endif

0 comments on commit 3831a6d

Please sign in to comment.