From 8cbbd927616eb837cbe8cb541649871dcfcaeb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 21 Jan 2019 11:53:37 +0100 Subject: [PATCH] [ion/device] Fix keyboard output GPIO activation --- ion/src/device/keyboard.cpp | 4 ++-- ion/src/device/keyboard.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ion/src/device/keyboard.cpp b/ion/src/device/keyboard.cpp index 91c634dae..0e2047d1c 100644 --- a/ion/src/device/keyboard.cpp +++ b/ion/src/device/keyboard.cpp @@ -53,8 +53,8 @@ State scan() { for (uint8_t i=0; igetBitRange(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 diff --git a/ion/src/device/keyboard.h b/ion/src/device/keyboard.h index fa69ab39f..7247745a6 100644 --- a/ion/src/device/keyboard.h +++ b/ion/src/device/keyboard.h @@ -52,8 +52,8 @@ inline void activateRow(uint8_t row) { * the others to 1. */ uint16_t rowState = ~(1<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);