[ion/device] Fix keyboard output GPIO activation

This commit is contained in:
Émilie Feral
2019-01-21 11:53:37 +01:00
committed by LeaNumworks
parent 15c87dc0b3
commit 8cbbd92761
2 changed files with 4 additions and 4 deletions

View File

@@ -53,8 +53,8 @@ State scan() {
for (uint8_t i=0; i<Device::numberOfRows; i++) {
Device::activateRow(Device::numberOfRows-1-i);
// TODO: Assert pin numbers are sequentials and dynamically find 8 and 0
uint8_t columns = Device::ColumnGPIO.IDR()->getBitRange(5,0);
// TODO: Assert pin numbers are sequentials and dynamically find 5 and 0
uint8_t columns = Device::ColumnGPIO.IDR()->getBitRange(Device::numberOfColumns-1,0);
/* The key is down if the input is brought low by the output. In other
* words, we want to return true if the input is low (false). So we need to

View File

@@ -52,8 +52,8 @@ inline void activateRow(uint8_t row) {
* the others to 1. */
uint16_t rowState = ~(1<<row);
// TODO: Assert pin numbers are sequentials and dynamically find 9 and 0
Device::RowGPIO.ODR()->setBitRange(9, 0, rowState);
// TODO: Assert pin numbers are sequentials and dynamically find 8 and 0
Device::RowGPIO.ODR()->setBitRange(numberOfRows-1, 0, rowState);
// TODO: 100 us seems to work, but wasn't really calculated
Timing::usleep(100);