summaryrefslogtreecommitdiff
path: root/keyboards/deng
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/deng')
-rw-r--r--keyboards/deng/thirty/config.h3
-rw-r--r--keyboards/deng/thirty/halconf.h20
-rw-r--r--keyboards/deng/thirty/info.json1
-rw-r--r--keyboards/deng/thirty/mcuconf.h21
-rw-r--r--keyboards/deng/thirty/rules.mk2
-rw-r--r--keyboards/deng/thirty/thirty.c5
6 files changed, 49 insertions, 3 deletions
diff --git a/keyboards/deng/thirty/config.h b/keyboards/deng/thirty/config.h
index d80983202f..20e6673dd2 100644
--- a/keyboards/deng/thirty/config.h
+++ b/keyboards/deng/thirty/config.h
@@ -15,6 +15,9 @@
*/
#pragma once
+#define BACKLIGHT_PWM_DRIVER PWMD2
+#define BACKLIGHT_PWM_CHANNEL 4
+
/* RGB Matrix */
#ifdef RGB_MATRIX_ENABLE
#define RGB_MATRIX_LED_COUNT 30
diff --git a/keyboards/deng/thirty/halconf.h b/keyboards/deng/thirty/halconf.h
new file mode 100644
index 0000000000..b107a87e75
--- /dev/null
+++ b/keyboards/deng/thirty/halconf.h
@@ -0,0 +1,20 @@
+/* Copyright 2020 Nick Brassel (tzarc)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#define HAL_USE_PWM TRUE
+
+#include_next <halconf.h>
diff --git a/keyboards/deng/thirty/info.json b/keyboards/deng/thirty/info.json
index 1d9b018e6b..59f3616215 100644
--- a/keyboards/deng/thirty/info.json
+++ b/keyboards/deng/thirty/info.json
@@ -17,7 +17,6 @@
},
"diode_direction": "COL2ROW",
"backlight": {
- "driver": "software",
"pin": "B11",
"levels": 5,
"on_state": 0
diff --git a/keyboards/deng/thirty/mcuconf.h b/keyboards/deng/thirty/mcuconf.h
new file mode 100644
index 0000000000..8ff617051f
--- /dev/null
+++ b/keyboards/deng/thirty/mcuconf.h
@@ -0,0 +1,21 @@
+/* Copyright 2020 Nick Brassel (tzarc)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#include_next <mcuconf.h>
+
+#undef STM32_PWM_USE_TIM2
+#define STM32_PWM_USE_TIM2 TRUE
diff --git a/keyboards/deng/thirty/rules.mk b/keyboards/deng/thirty/rules.mk
index e8ce9e854b..d1753c1e6c 100644
--- a/keyboards/deng/thirty/rules.mk
+++ b/keyboards/deng/thirty/rules.mk
@@ -1,5 +1,3 @@
-# Enter lower-power sleep mode when on the ChibiOS idle thread
-OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
# Wildcard to allow APM32 MCU
DFU_SUFFIX_ARGS = -p FFFF -v FFFF
diff --git a/keyboards/deng/thirty/thirty.c b/keyboards/deng/thirty/thirty.c
index 2e582d6833..7d49bc1b03 100644
--- a/keyboards/deng/thirty/thirty.c
+++ b/keyboards/deng/thirty/thirty.c
@@ -46,3 +46,8 @@ led_config_t g_led_config = {
};
#endif
+
+void board_init(void) {
+ // Remap B11 AF to TIM2_CH4
+ AFIO->MAPR |= AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2;
+}