From faaaa134fd436be400aa2c7841b38907899d49a6 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 6 Jun 2019 12:09:56 -0700 Subject: Replace DEBOUNCING_DELAY (deprecated) with DEBOUNCE (#5997) --- keyboards/converter/hp_46010a/config.h | 4 +--- keyboards/converter/hp_46010a/matrix.c | 14 +++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'keyboards/converter/hp_46010a') diff --git a/keyboards/converter/hp_46010a/config.h b/keyboards/converter/hp_46010a/config.h index f77ed4115..b7297ab88 100644 --- a/keyboards/converter/hp_46010a/config.h +++ b/keyboards/converter/hp_46010a/config.h @@ -30,6 +30,4 @@ along with this program. If not, see . #define MATRIX_COLS 8 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - - +#define DEBOUNCE 5 diff --git a/keyboards/converter/hp_46010a/matrix.c b/keyboards/converter/hp_46010a/matrix.c index 2ca7d0357..ac9224087 100644 --- a/keyboards/converter/hp_46010a/matrix.c +++ b/keyboards/converter/hp_46010a/matrix.c @@ -34,18 +34,18 @@ along with this program. If not, see . #include "config.h" -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +#ifndef DEBOUNCE +# define DEBOUNCE 5 #endif -#if ( DEBOUNCING_DELAY > 0 ) +#if ( DEBOUNCE > 0 ) static uint16_t debouncing_time ; static bool debouncing = false ; #endif static uint8_t matrix [MATRIX_ROWS] = {0}; -#if ( DEBOUNCING_DELAY > 0 ) +#if ( DEBOUNCE > 0 ) static uint8_t matrix_debounce_old [MATRIX_ROWS] = {0}; static uint8_t matrix_debounce_new [MATRIX_ROWS] = {0}; #endif @@ -172,7 +172,7 @@ uint8_t matrix_scan(void) { // the first byte of the keyboard's output data can be ignored Matrix_ThrowByte(); -#if ( DEBOUNCING_DELAY > 0 ) +#if ( DEBOUNCE > 0 ) for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { //transfer old debouncing values @@ -194,8 +194,8 @@ uint8_t matrix_scan(void) { #endif -#if ( DEBOUNCING_DELAY > 0 ) - if ( debouncing && ( timer_elapsed( debouncing_time ) > DEBOUNCING_DELAY ) ) { +#if ( DEBOUNCE > 0 ) + if ( debouncing && ( timer_elapsed( debouncing_time ) > DEBOUNCE ) ) { for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { matrix[row] = matrix_debounce_new[row] ; -- cgit v1.2.3