summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/keyboard.c9
-rw-r--r--tmk_core/protocol/serial_soft.c3
2 files changed, 6 insertions, 6 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 125f00ccf7..af2b2fd48b 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -297,13 +297,14 @@ void keyboard_task(void) {
}
#endif
if (debug_matrix) matrix_print();
- for (uint8_t c = 0; c < MATRIX_COLS; c++) {
- if (matrix_change & ((matrix_row_t)1 << c)) {
+ matrix_row_t col_mask = 1;
+ for (uint8_t c = 0; c < MATRIX_COLS; c++, col_mask <<= 1) {
+ if (matrix_change & col_mask) {
action_exec((keyevent_t){
- .key = (keypos_t){.row = r, .col = c}, .pressed = (matrix_row & ((matrix_row_t)1 << c)), .time = (timer_read() | 1) /* time should not be 0 */
+ .key = (keypos_t){.row = r, .col = c}, .pressed = (matrix_row & col_mask), .time = (timer_read() | 1) /* time should not be 0 */
});
// record a processed key
- matrix_prev[r] ^= ((matrix_row_t)1 << c);
+ matrix_prev[r] ^= col_mask;
#ifdef QMK_KEYS_PER_SCAN
// only jump out if we have processed "enough" keys.
if (++keys_processed >= QMK_KEYS_PER_SCAN)
diff --git a/tmk_core/protocol/serial_soft.c b/tmk_core/protocol/serial_soft.c
index b409079954..8624ef733c 100644
--- a/tmk_core/protocol/serial_soft.c
+++ b/tmk_core/protocol/serial_soft.c
@@ -68,7 +68,6 @@ POSSIBILITY OF SUCH DAMAGE.
#endif
/* debug for signal timing, see debug pin with oscilloscope */
-#define SERIAL_SOFT_DEBUG
#ifdef SERIAL_SOFT_DEBUG
# define SERIAL_SOFT_DEBUG_INIT() (DDRD |= 1 << 7)
# define SERIAL_SOFT_DEBUG_TGL() (PORTD ^= 1 << 7)
@@ -169,7 +168,7 @@ void serial_send(uint8_t data) {
/* detect edge of start bit */
ISR(SERIAL_SOFT_RXD_VECT) {
SERIAL_SOFT_DEBUG_TGL();
- SERIAL_SOFT_RXD_INT_ENTER()
+ SERIAL_SOFT_RXD_INT_ENTER();
uint8_t data = 0;