PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)
Diff: POKITTO_HW/HWButtons.cpp
- Revision:
- 37:dc085d77d849
- Parent:
- 31:f4b9b85c7b62
--- a/POKITTO_HW/HWButtons.cpp Mon Apr 02 22:37:22 2018 +0000 +++ b/POKITTO_HW/HWButtons.cpp Wed Apr 18 08:11:53 2018 +0000 @@ -66,20 +66,20 @@ Pokitto::heldStates[BTN_C] = 1; } void CReleased() { Pokitto::heldStates[BTN_C] = 0; } -void UPressed() { Pokitto::heldStates[BTN_UP] = 1; } +void UPressed() { Pokitto::heldStates[BTN_UP] = 1; Pokitto::heldStates[BTN_DOWN] = 0; } void UReleased() { Pokitto::heldStates[BTN_UP] = 0; } -void DPressed() { Pokitto::heldStates[BTN_DOWN] = 1; } +void DPressed() { Pokitto::heldStates[BTN_DOWN] = 1; Pokitto::heldStates[BTN_UP] = 0;} void DReleased() { Pokitto::heldStates[BTN_DOWN] = 0; } void RPressed() { /* Hardware volume control */ if (Pokitto::heldStates[BTN_C]) _s.volumeUp(); - else Pokitto::heldStates[BTN_RIGHT] = 1; + else { Pokitto::heldStates[BTN_RIGHT] = 1 ; Pokitto::heldStates[BTN_LEFT] = 0;} } void RReleased() { Pokitto::heldStates[BTN_RIGHT] = 0; } void LPressed() { /* Hardware volume control */ if (Pokitto::heldStates[BTN_C]) _s.volumeDown(); - else Pokitto::heldStates[BTN_LEFT] = 1; + else {Pokitto::heldStates[BTN_LEFT] = 1; Pokitto::heldStates[BTN_RIGHT] = 0;} } void LReleased() { Pokitto::heldStates[BTN_LEFT] = 0; }