Skip to content

Commit

Permalink
Add configuration option to ignore all keypresses (including up/down)…
Browse files Browse the repository at this point in the history
… when the machine is running..
  • Loading branch information
clough42 committed Oct 6, 2020
1 parent 94ebec9 commit 1f81220
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
15 changes: 15 additions & 0 deletions els-f280049c/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,21 @@
#define HARDWARE_VERSION 2




//================================================================================
// FEATURES
//
// Additional features that can be enabled for your configuration.
//================================================================================

// Ignore all key presses when the machine is running. Normally, only the mode
// and direction keys are ignored.
//#define IGNORE_ALL_KEYS_WHEN_RUNNING




//================================================================================
// CPU / TIMING
//
Expand Down
25 changes: 17 additions & 8 deletions els-f280049c/UserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,24 @@ void UserInterface :: loop( void )
}
}

// these keys can be operated when the machine is running
if( keys.bit.UP )
{
newFeed = feedTable->next();
}
if( keys.bit.DOWN )
{
newFeed = feedTable->previous();
#ifdef IGNORE_ALL_KEYS_WHEN_RUNNING
if( currentRpm == 0 )
{
#endif // IGNORE_ALL_KEYS_WHEN_RUNNING

// these keys can be operated when the machine is running
if( keys.bit.UP )
{
newFeed = feedTable->next();
}
if( keys.bit.DOWN )
{
newFeed = feedTable->previous();
}

#ifdef IGNORE_ALL_KEYS_WHEN_RUNNING
}
#endif // IGNORE_ALL_KEYS_WHEN_RUNNING

// if we have changed the feed
if( newFeed != NULL ) {
Expand Down

0 comments on commit 1f81220

Please sign in to comment.