Skip to content

Commit

Permalink
correctly handle feedback in DIRECT mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
pabender committed Oct 5, 2018
1 parent 6a91ad6 commit e299455
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions java/src/jmri/jmrix/dccpp/DCCppTurnout.java
Expand Up @@ -154,7 +154,11 @@ public void setCommandedState(int s) {
synchronized (this) { synchronized (this) {
newKnownState(INCONSISTENT); newKnownState(INCONSISTENT);
} }
} } else if( _activeFeedbackType == DIRECT ){
synchronized (this) {
newKnownState(s);
}
}
} }


// Handle a request to change state by sending a DCC++ command // Handle a request to change state by sending a DCC++ command
Expand Down Expand Up @@ -194,7 +198,7 @@ synchronized protected void forwardCommandChangeToLayout(int s) {
// Convert the integer Turnout value to boolean for DCC++ internal code. // Convert the integer Turnout value to boolean for DCC++ internal code.
// Assume if it's not THROWN (true), it must be CLOSED (false). // Assume if it's not THROWN (true), it must be CLOSED (false).
msg = DCCppMessage.makeAccessoryDecoderMsg(mNumber, newstate); msg = DCCppMessage.makeAccessoryDecoderMsg(mNumber, newstate);
internalState = IDLE; // change this! internalState = IDLE;
break; break;


} }
Expand Down

0 comments on commit e299455

Please sign in to comment.