Rework example code, fix bugs and get to compiling state. Also introduce missing logic for the Matrix code to keep track of what column is active.

This commit is contained in:
2021-11-22 20:10:08 +00:00
parent 8ebc1a5523
commit 690afdbce5
18 changed files with 194 additions and 26 deletions

View File

@ -48,8 +48,8 @@ void Joystick::AddMuxButton(uint8_t channel, Mux* mux, ButtonType type, bool pul
_addButton(type, new MuxReader(channel, mux, pullup));
}
void Joystick::AddMatrixButton(uint8_t row, uint8_t col, ButtonType type, bool pullup) {
_addButton(type, new MatrixReader(row, col, pullup));
void Joystick::AddMatrixButton(uint8_t row, uint8_t col, Matrix* matrix, ButtonType type, bool pullup) {
_addButton(type, new MatrixReader(row, col, matrix, pullup));
}
void Joystick::AddEncoder(uint8_t pin1, uint8_t pin2, ButtonType type) {
@ -147,6 +147,7 @@ void Joystick::_UpdateAxis(uint8_t index) {
}
void Joystick::_addButton(ButtonType type, Reader* reader) {
Button* button;
switch (type) {
case BUTTON_PASSTHRU:
button = new PassthruButton(_virtual_buttons, reader);