Skip to content

Commit

Permalink
Merge branch 'master' into orbit
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Aug 22, 2024
2 parents 7ca6a40 + ec8a779 commit cb40934
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion VortexEngine/src/Menus/MenuList/EditorConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

EditorConnection::EditorConnection(const RGBColor &col, bool advanced) :
Menu(col, advanced),
m_state(STATE_DISCONNECTED)
m_state(STATE_DISCONNECTED),
m_allowReset(true)
{
}

Expand Down Expand Up @@ -57,6 +58,8 @@ bool EditorConnection::receiveMessage(const char *message)
if (m_receiveBuffer.unserializerAtEnd()) {
m_receiveBuffer.clear();
}
// we have now received at least one command, do not allow resetting
m_allowReset = false;
return true;
}

Expand Down Expand Up @@ -202,10 +205,16 @@ void EditorConnection::sendCurModeVL()
// handlers for clicks
void EditorConnection::onShortClick()
{
// if the device has received any commands do not reset!
if (!m_allowReset) {
return;
}
// reset, this won't actually disconnect the com port
m_state = STATE_DISCONNECTED;
// clear the demo
clearDemo();
// sent a reset, do not allow another
m_allowReset = false;
}

void EditorConnection::onShortClick2()
Expand Down
2 changes: 2 additions & 0 deletions VortexEngine/src/Menus/MenuList/EditorConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class EditorConnection : public Menu
EditorConnectionState m_state;
// the data that is received
ByteStream m_receiveBuffer;
// Whether at least one command has been received yet
bool m_allowReset;
};

#endif

0 comments on commit cb40934

Please sign in to comment.