Created
January 29, 2019 01:32
-
-
Save yabberyabber/5835dc5e468e1e466cc087e887a09b98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ObservableDualActionJoystick::TaskPrePeriodic(RobotMode mode) { | |
uint32_t currBtn = GetAllButtons(); | |
if (m_observer != nullptr) { | |
int mask = 1, buttonId = 0; | |
for ( int buttonId = 0; buttonId < 64; buttonId++ ) { | |
if (m_prevBtn & mask != currBtn & mask) { | |
m_observer->ObserveDualActionJoystickStateChange(m_port, buttonId, currBtn & mask); | |
} | |
mask <<= 1; | |
} | |
} | |
m_prevBtn = currBtn; | |
if (m_logCell) { | |
m_logCell->LogPrintf("%x", currBtn); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment