Skip to content

Commit

Permalink
Display spindle angle relative to position when entering spindle angl…
Browse files Browse the repository at this point in the history
…e display mode
  • Loading branch information
johnsonm committed Jan 2, 2024
1 parent ea505c2 commit 138fbb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion els-f280049c/UserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void UserInterface :: loop( void )
Uint16 currentRpm = core->getRPM();

// read the current spindle position to keep this up to date
Uint16 currentSpindleAngle = encoder->getSpindleAngle();
Uint16 currentSpindleAngle = encoder->getSpindleAngle() + spindleAngleOffset % 3600;

// display an override message, if there is one
overrideMessage();
Expand Down Expand Up @@ -392,6 +392,9 @@ void UserInterface :: menuLoop( Uint16 currentRpm )
// Spindle position / RPM
case kShowPosition: // init
setMessage(showAngle ? &RPM : &POSITION);
if (showAngle) {
spindleAngleOffset = encoder->getSpindleAngle();
}
this-menuState++;
break;
case kShowPosition+1: // wait for keypress, either select this option, move to new or timeout
Expand Down
2 changes: 2 additions & 0 deletions els-f280049c/UserInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class UserInterface
const MESSAGE *message;
Uint16 messageTime;

Uint16 spindleAngleOffset;

const FEED_THREAD *loadFeedTable();
LED_REG calculateLEDs();
void setMessage(const MESSAGE *message);
Expand Down

0 comments on commit 138fbb8

Please sign in to comment.