From 297aad6ebd8577e826ea738cde25207a61337dc0 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 24 Mar 2020 14:32:23 +1100 Subject: [PATCH] Set backlight and RGB pins for AVR onekeys (#8533) * Set backlight and RGB pins for AVR onekeys * Set pin for ADC as well * Define ADC_PIN for F4 blackpills * Use A0 for F4 ADCs * Set ADC pins for F0 and F1 --- keyboards/handwired/onekey/blackpill_f401/config.h | 2 ++ keyboards/handwired/onekey/blackpill_f411/config.h | 2 ++ keyboards/handwired/onekey/bluepill/config.h | 2 ++ keyboards/handwired/onekey/elite_c/config.h | 6 ++++++ keyboards/handwired/onekey/keymaps/adc/config.h | 1 - keyboards/handwired/onekey/keymaps/adc/keymap.c | 4 ---- keyboards/handwired/onekey/promicro/config.h | 6 ++++++ keyboards/handwired/onekey/proton_c/config.h | 8 +++++--- keyboards/handwired/onekey/stm32f0_disco/config.h | 2 ++ keyboards/handwired/onekey/teensy_2/config.h | 6 ++++++ keyboards/handwired/onekey/teensy_2pp/config.h | 10 ++++++++-- 11 files changed, 39 insertions(+), 10 deletions(-) delete mode 100644 keyboards/handwired/onekey/keymaps/adc/config.h diff --git a/keyboards/handwired/onekey/blackpill_f401/config.h b/keyboards/handwired/onekey/blackpill_f401/config.h index 01555e43152f27fefae253e72066e9727527d8de..c6166380cf26ad5994661208b97610c6613f2ba8 100644 --- a/keyboards/handwired/onekey/blackpill_f401/config.h +++ b/keyboards/handwired/onekey/blackpill_f401/config.h @@ -27,3 +27,5 @@ #define BACKLIGHT_PWM_CHANNEL 1 #define RGB_DI_PIN A1 + +#define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/blackpill_f411/config.h b/keyboards/handwired/onekey/blackpill_f411/config.h index 01555e43152f27fefae253e72066e9727527d8de..c6166380cf26ad5994661208b97610c6613f2ba8 100644 --- a/keyboards/handwired/onekey/blackpill_f411/config.h +++ b/keyboards/handwired/onekey/blackpill_f411/config.h @@ -27,3 +27,5 @@ #define BACKLIGHT_PWM_CHANNEL 1 #define RGB_DI_PIN A1 + +#define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/bluepill/config.h b/keyboards/handwired/onekey/bluepill/config.h index 01555e43152f27fefae253e72066e9727527d8de..c6166380cf26ad5994661208b97610c6613f2ba8 100644 --- a/keyboards/handwired/onekey/bluepill/config.h +++ b/keyboards/handwired/onekey/bluepill/config.h @@ -27,3 +27,5 @@ #define BACKLIGHT_PWM_CHANNEL 1 #define RGB_DI_PIN A1 + +#define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/elite_c/config.h b/keyboards/handwired/onekey/elite_c/config.h index fbcd630d7900d57dbfcece77858cb9fb3da7e599..167373cd39b6d7c2dd7996eb8bb5a426794caace 100644 --- a/keyboards/handwired/onekey/elite_c/config.h +++ b/keyboards/handwired/onekey/elite_c/config.h @@ -21,3 +21,9 @@ #define MATRIX_COL_PINS { F4 } #define MATRIX_ROW_PINS { F5 } #define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +#define RGB_DI_PIN F6 + +#define ADC_PIN F6 diff --git a/keyboards/handwired/onekey/keymaps/adc/config.h b/keyboards/handwired/onekey/keymaps/adc/config.h deleted file mode 100644 index 6f70f09beec2219624baeca92e2cd7deaa104fb4..0000000000000000000000000000000000000000 --- a/keyboards/handwired/onekey/keymaps/adc/config.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/keyboards/handwired/onekey/keymaps/adc/keymap.c b/keyboards/handwired/onekey/keymaps/adc/keymap.c index c5294bbc3da71898e285562a1902efcb9248f5a0..6626894fac11a1b9dff808f6ea8a72290b5204de 100644 --- a/keyboards/handwired/onekey/keymaps/adc/keymap.c +++ b/keyboards/handwired/onekey/keymaps/adc/keymap.c @@ -2,10 +2,6 @@ #include "analog.h" #include -#ifndef ADC_PIN -# define ADC_PIN A0 -#endif - enum custom_keycodes { ADC_SAMPLE = SAFE_RANGE, }; diff --git a/keyboards/handwired/onekey/promicro/config.h b/keyboards/handwired/onekey/promicro/config.h index fbcd630d7900d57dbfcece77858cb9fb3da7e599..167373cd39b6d7c2dd7996eb8bb5a426794caace 100644 --- a/keyboards/handwired/onekey/promicro/config.h +++ b/keyboards/handwired/onekey/promicro/config.h @@ -21,3 +21,9 @@ #define MATRIX_COL_PINS { F4 } #define MATRIX_ROW_PINS { F5 } #define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +#define RGB_DI_PIN F6 + +#define ADC_PIN F6 diff --git a/keyboards/handwired/onekey/proton_c/config.h b/keyboards/handwired/onekey/proton_c/config.h index fe34f94add3f96d4f8e0c1241512e5a83e429e86..3ba4ba649962c58b69e1b7dbc7ac1b18464e1371 100644 --- a/keyboards/handwired/onekey/proton_c/config.h +++ b/keyboards/handwired/onekey/proton_c/config.h @@ -18,8 +18,8 @@ #include "config_common.h" -#define MATRIX_COL_PINS { A3 } -#define MATRIX_ROW_PINS { A2 } +#define MATRIX_COL_PINS { A2 } +#define MATRIX_ROW_PINS { A1 } #define UNUSED_PINS #define BACKLIGHT_PIN B8 @@ -27,4 +27,6 @@ #define BACKLIGHT_PWM_CHANNEL 3 #define BACKLIGHT_PAL_MODE 2 -#define RGB_DI_PIN A1 +#define RGB_DI_PIN A0 + +#define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/stm32f0_disco/config.h b/keyboards/handwired/onekey/stm32f0_disco/config.h index 637ed65d3fa3c8f93d12cc409db4a24555e065da..0d6dd18fa22c0745654f1ac460c6c6c856b74d9f 100644 --- a/keyboards/handwired/onekey/stm32f0_disco/config.h +++ b/keyboards/handwired/onekey/stm32f0_disco/config.h @@ -28,3 +28,5 @@ #define BACKLIGHT_PAL_MODE 0 #define RGB_DI_PIN B15 + +#define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/teensy_2/config.h b/keyboards/handwired/onekey/teensy_2/config.h index fbcd630d7900d57dbfcece77858cb9fb3da7e599..167373cd39b6d7c2dd7996eb8bb5a426794caace 100644 --- a/keyboards/handwired/onekey/teensy_2/config.h +++ b/keyboards/handwired/onekey/teensy_2/config.h @@ -21,3 +21,9 @@ #define MATRIX_COL_PINS { F4 } #define MATRIX_ROW_PINS { F5 } #define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +#define RGB_DI_PIN F6 + +#define ADC_PIN F6 diff --git a/keyboards/handwired/onekey/teensy_2pp/config.h b/keyboards/handwired/onekey/teensy_2pp/config.h index 9d993980c2571378d6a54b78d49fb2e39deb90be..167373cd39b6d7c2dd7996eb8bb5a426794caace 100644 --- a/keyboards/handwired/onekey/teensy_2pp/config.h +++ b/keyboards/handwired/onekey/teensy_2pp/config.h @@ -18,6 +18,12 @@ #include "config_common.h" -#define MATRIX_COL_PINS { B2 } -#define MATRIX_ROW_PINS { B1 } +#define MATRIX_COL_PINS { F4 } +#define MATRIX_ROW_PINS { F5 } #define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +#define RGB_DI_PIN F6 + +#define ADC_PIN F6