aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-04-06 21:10:30 +0100
committerGitHub <noreply@github.com>2020-04-06 21:10:30 +0100
commit79010067539ad2043bd41e9701aa1cde21aec5d1 (patch)
treebfbabc4845bca90edc94c6ca61e80e1f4af72c27
parent9bfa713421ccd62fe49493b282d02310accf0523 (diff)
downloadqmk_firmware-79010067539ad2043bd41e9701aa1cde21aec5d1.tar.gz
qmk_firmware-79010067539ad2043bd41e9701aa1cde21aec5d1.zip
Refactor cannonkeys f103 boards to use core backlight (#8089)
* Refactor to use core backlight * Remove custom implementation
-rw-r--r--keyboards/cannonkeys/bluepill/keyboard.c1
-rw-r--r--keyboards/cannonkeys/bluepill/led.c257
-rw-r--r--keyboards/cannonkeys/bluepill/led_custom.h6
-rw-r--r--keyboards/cannonkeys/ortho48/config.h5
-rw-r--r--keyboards/cannonkeys/ortho48/rules.mk4
-rw-r--r--keyboards/cannonkeys/ortho60/config.h3
-rw-r--r--keyboards/cannonkeys/ortho60/rules.mk6
-rw-r--r--keyboards/cannonkeys/ortho75/config.h3
-rw-r--r--keyboards/cannonkeys/ortho75/rules.mk6
-rw-r--r--keyboards/cannonkeys/practice60/config.h3
-rw-r--r--keyboards/cannonkeys/practice60/rules.mk6
-rw-r--r--keyboards/cannonkeys/practice65/config.h3
-rw-r--r--keyboards/cannonkeys/practice65/rules.mk6
13 files changed, 24 insertions, 285 deletions
diff --git a/keyboards/cannonkeys/bluepill/keyboard.c b/keyboards/cannonkeys/bluepill/keyboard.c
index 7eb30ea13..de0015881 100644
--- a/keyboards/cannonkeys/bluepill/keyboard.c
+++ b/keyboards/cannonkeys/bluepill/keyboard.c
@@ -1,6 +1,5 @@
1#include "ch.h" 1#include "ch.h"
2#include "hal.h" 2#include "hal.h"
3#include "led_custom.h"
4#include "util.h" 3#include "util.h"
5#include "quantum.h" 4#include "quantum.h"
6 5
diff --git a/keyboards/cannonkeys/bluepill/led.c b/keyboards/cannonkeys/bluepill/led.c
deleted file mode 100644
index a9ede5bba..000000000
--- a/keyboards/cannonkeys/bluepill/led.c
+++ /dev/null
@@ -1,257 +0,0 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "hal.h"
19#include "backlight.h"
20#include "led.h"
21#include "led_custom.h"
22#include "printf.h"
23
24static void breathing_callback(PWMDriver *pwmp);
25
26static PWMConfig pwmCFG = {
27 0xFFFF, /* PWM clock frequency */
28 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
29 NULL, /* No Callback */
30 {
31 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */
32 {PWM_OUTPUT_DISABLED, NULL},
33 {PWM_OUTPUT_DISABLED, NULL},
34 {PWM_OUTPUT_DISABLED, NULL}
35 },
36 0, /* HW dependent part.*/
37 0
38};
39
40static PWMConfig pwmCFG_breathing = {
41 0xFFFF, /* 10kHz PWM clock frequency */
42 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
43 breathing_callback, /* Breathing Callback */
44 {
45 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */
46 {PWM_OUTPUT_DISABLED, NULL},
47 {PWM_OUTPUT_DISABLED, NULL},
48 {PWM_OUTPUT_DISABLED, NULL}
49 },
50 0, /* HW dependent part.*/
51 0
52};
53
54// See http://jared.geek.nz/2013/feb/linear-led-pwm
55static uint16_t cie_lightness(uint16_t v) {
56 if (v <= 5243) // if below 8% of max
57 return v / 9; // same as dividing by 900%
58 else {
59 uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare
60 // to get a useful result with integer division, we shift left in the expression above
61 // and revert what we've done again after squaring.
62 y = y * y * y >> 8;
63 if (y > 0xFFFFUL) // prevent overflow
64 return 0xFFFFU;
65 else
66 return (uint16_t) y;
67 }
68}
69
70
71void backlight_init_ports(void) {
72 printf("backlight_init_ports()\n");
73 #ifdef BACKLIGHT_ENABLE
74
75 palSetPadMode(GPIOA, 8, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
76 pwmStart(&PWMD1, &pwmCFG);
77 pwmEnableChannel(&PWMD1, 0, PWM_FRACTION_TO_WIDTH(&PWMD1, 0xFFFF,cie_lightness(0xFFFF)));
78 #endif
79}
80
81void backlight_set(uint8_t level) {
82 printf("backlight_set(%d)\n", level);
83 #ifdef BACKLIGHT_ENABLE
84 uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS));
85 printf("duty: (%d)\n", duty);
86 if (level == 0) {
87 // Turn backlight off
88 pwmDisableChannel(&PWMD1, 0);
89 } else {
90 // Turn backlight on
91 if(!is_breathing()){
92 pwmEnableChannel(&PWMD1, 0, PWM_FRACTION_TO_WIDTH(&PWMD1,0xFFFF,duty));
93 }
94 }
95 #endif
96}
97
98
99uint8_t backlight_tick = 0;
100
101void backlight_task(void) {
102}
103
104#define BREATHING_NO_HALT 0
105#define BREATHING_HALT_OFF 1
106#define BREATHING_HALT_ON 2
107#define BREATHING_STEPS 128
108
109static uint8_t breathing_period = BREATHING_PERIOD;
110static uint8_t breathing_halt = BREATHING_NO_HALT;
111static uint16_t breathing_counter = 0;
112
113bool is_breathing(void) {
114 return PWMD1.config == &pwmCFG_breathing;
115}
116
117#define breathing_min() do {breathing_counter = 0;} while (0)
118#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0)
119
120
121void breathing_interrupt_enable(void){
122 pwmStop(&PWMD1);
123 printf("starting with callback\n");
124 pwmStart(&PWMD1, &pwmCFG_breathing);
125 chSysLockFromISR();
126 pwmEnablePeriodicNotification(&PWMD1);
127 pwmEnableChannelI(
128 &PWMD1,
129 0,
130 PWM_FRACTION_TO_WIDTH(
131 &PWMD1,
132 0xFFFF,
133 0xFFFF
134 )
135 );
136 chSysUnlockFromISR();
137}
138
139void breathing_interrupt_disable(void){
140 pwmStop(&PWMD1);
141 printf("starting without callback\n");
142 pwmStart(&PWMD1, &pwmCFG);
143}
144
145void breathing_enable(void)
146{
147 printf("breathing_enable()\n");
148 breathing_counter = 0;
149 breathing_halt = BREATHING_NO_HALT;
150 breathing_interrupt_enable();
151}
152
153void breathing_pulse(void)
154{
155 if (get_backlight_level() == 0)
156 breathing_min();
157 else
158 breathing_max();
159 breathing_halt = BREATHING_HALT_ON;
160 breathing_interrupt_enable();
161}
162
163void breathing_disable(void)
164{
165 printf("breathing_disable()\n");
166 breathing_interrupt_disable();
167 // Restore backlight level
168 backlight_set(get_backlight_level());
169}
170
171void breathing_self_disable(void)
172{
173 if (get_backlight_level() == 0)
174 breathing_halt = BREATHING_HALT_OFF;
175 else
176 breathing_halt = BREATHING_HALT_ON;
177}
178
179void breathing_toggle(void) {
180 if (is_breathing()){
181 printf("disable breathing\n");
182 breathing_disable();
183 } else {
184 printf("enable breathing\n");
185 breathing_enable();
186 }
187}
188
189void breathing_period_set(uint8_t value)
190{
191 if (!value)
192 value = 1;
193 breathing_period = value;
194}
195
196void breathing_period_default(void) {
197 breathing_period_set(BREATHING_PERIOD);
198}
199
200void breathing_period_inc(void)
201{
202 breathing_period_set(breathing_period+1);
203}
204
205void breathing_period_dec(void)
206{
207 breathing_period_set(breathing_period-1);
208}
209
210/* To generate breathing curve in python:
211 * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)]
212 */
213static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
214
215// Use this before the cie_lightness function.
216static inline uint16_t scale_backlight(uint16_t v) {
217 return v / BACKLIGHT_LEVELS * get_backlight_level();
218}
219
220static void breathing_callback(PWMDriver *pwmp)
221{
222 (void)pwmp;
223 uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS;
224 // resetting after one period to prevent ugly reset at overflow.
225 breathing_counter = (breathing_counter + 1) % (breathing_period * 256);
226 uint8_t index = breathing_counter / interval % BREATHING_STEPS;
227
228 if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) ||
229 ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1)))
230 {
231 breathing_interrupt_disable();
232 }
233
234 uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256));
235
236 chSysLockFromISR();
237 pwmEnableChannelI(
238 &PWMD1,
239 0,
240 PWM_FRACTION_TO_WIDTH(
241 &PWMD1,
242 0xFFFF,
243 duty
244 )
245 );
246 chSysUnlockFromISR();
247}
248
249
250void led_set(uint8_t usb_led)
251{
252 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
253 palSetPad(GPIOC, 13);
254 } else {
255 palClearPad(GPIOC, 13);
256 }
257}
diff --git a/keyboards/cannonkeys/bluepill/led_custom.h b/keyboards/cannonkeys/bluepill/led_custom.h
deleted file mode 100644
index 8451c06d6..000000000
--- a/keyboards/cannonkeys/bluepill/led_custom.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#pragma once
2
3void backlight_task(void);
4void breathing_interrupt_disable(void);
5void breathing_interrupt_enable(void);
6bool is_breathing(void);
diff --git a/keyboards/cannonkeys/ortho48/config.h b/keyboards/cannonkeys/ortho48/config.h
index 094be0138..bab0b95c0 100644
--- a/keyboards/cannonkeys/ortho48/config.h
+++ b/keyboards/cannonkeys/ortho48/config.h
@@ -33,6 +33,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define MATRIX_ROW_PINS { B12, C13, A2, A1 } 33#define MATRIX_ROW_PINS { B12, C13, A2, A1 }
34#define DIODE_DIRECTION COL2ROW 34#define DIODE_DIRECTION COL2ROW
35 35
36#define BACKLIGHT_PIN A8
37#define BACKLIGHT_PWM_DRIVER PWMD1
38#define BACKLIGHT_PWM_CHANNEL 1
36#define BACKLIGHT_LEVELS 6 39#define BACKLIGHT_LEVELS 6
37#define BACKLIGHT_BREATHING 40#define BACKLIGHT_BREATHING
38#define BREATHING_PERIOD 6 41#define BREATHING_PERIOD 6
@@ -57,8 +60,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
57#define WS2812_SPI SPID2 60#define WS2812_SPI SPID2
58 61
59 62
60
61
62/* 63/*
63 * Feature disable options 64 * Feature disable options
64 * These options are also useful to firmware size reduction. 65 * These options are also useful to firmware size reduction.
diff --git a/keyboards/cannonkeys/ortho48/rules.mk b/keyboards/cannonkeys/ortho48/rules.mk
index 59c12681c..9c9b79e42 100644
--- a/keyboards/cannonkeys/ortho48/rules.mk
+++ b/keyboards/cannonkeys/ortho48/rules.mk
@@ -11,8 +11,7 @@ DFU_SUFFIX_ARGS = -v 1eaf -p 0003
11 11
12# project specific files 12# project specific files
13VPATH += keyboards/cannonkeys/bluepill 13VPATH += keyboards/cannonkeys/bluepill
14SRC = led.c \ 14SRC = keyboard.c
15 keyboard.c
16 15
17#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration 16#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys 17MOUSEKEY_ENABLE = yes # Mouse keys
@@ -22,7 +21,6 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
22SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 21SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
23NKRO_ENABLE = yes # USB Nkey Rollover 22NKRO_ENABLE = yes # USB Nkey Rollover
24BACKLIGHT_ENABLE = yes 23BACKLIGHT_ENABLE = yes
25BACKLIGHT_DRIVER = custom
26RGBLIGHT_ENABLE = yes 24RGBLIGHT_ENABLE = yes
27 25
28LAYOUTS = ortho_4x12 26LAYOUTS = ortho_4x12
diff --git a/keyboards/cannonkeys/ortho60/config.h b/keyboards/cannonkeys/ortho60/config.h
index 412f0df49..acfc2b53a 100644
--- a/keyboards/cannonkeys/ortho60/config.h
+++ b/keyboards/cannonkeys/ortho60/config.h
@@ -33,6 +33,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } 33#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 }
34#define DIODE_DIRECTION COL2ROW 34#define DIODE_DIRECTION COL2ROW
35 35
36#define BACKLIGHT_PIN A8
37#define BACKLIGHT_PWM_DRIVER PWMD1
38#define BACKLIGHT_PWM_CHANNEL 1
36#define BACKLIGHT_LEVELS 6 39#define BACKLIGHT_LEVELS 6
37#define BACKLIGHT_BREATHING 40#define BACKLIGHT_BREATHING
38#define BREATHING_PERIOD 6 41#define BREATHING_PERIOD 6
diff --git a/keyboards/cannonkeys/ortho60/rules.mk b/keyboards/cannonkeys/ortho60/rules.mk
index 2077eea66..7355fbf93 100644
--- a/keyboards/cannonkeys/ortho60/rules.mk
+++ b/keyboards/cannonkeys/ortho60/rules.mk
@@ -11,8 +11,7 @@ DFU_SUFFIX_ARGS = -v 1eaf -p 0003
11 11
12# project specific files 12# project specific files
13VPATH += keyboards/cannonkeys/bluepill 13VPATH += keyboards/cannonkeys/bluepill
14SRC = led.c \ 14SRC = keyboard.c
15 keyboard.c
16 15
17#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration 16#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys 17MOUSEKEY_ENABLE = yes # Mouse keys
@@ -20,9 +19,8 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = yes # Console for debug 19CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration 20COMMAND_ENABLE = yes # Commands for debug and configuration
22SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 21SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
23NKRO_ENABLE = yes # USB Nkey Rollover 22NKRO_ENABLE = yes # USB Nkey Rollover
24BACKLIGHT_ENABLE = yes 23BACKLIGHT_ENABLE = yes
25BACKLIGHT_DRIVER = custom
26RGBLIGHT_ENABLE = yes 24RGBLIGHT_ENABLE = yes
27 25
28LAYOUTS = ortho_5x12 26LAYOUTS = ortho_5x12
diff --git a/keyboards/cannonkeys/ortho75/config.h b/keyboards/cannonkeys/ortho75/config.h
index 95bb01452..6e3651a83 100644
--- a/keyboards/cannonkeys/ortho75/config.h
+++ b/keyboards/cannonkeys/ortho75/config.h
@@ -33,6 +33,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define MATRIX_ROW_PINS { B12, C13, A2, A1, A3 } 33#define MATRIX_ROW_PINS { B12, C13, A2, A1, A3 }
34#define DIODE_DIRECTION COL2ROW 34#define DIODE_DIRECTION COL2ROW
35 35
36#define BACKLIGHT_PIN A8
37#define BACKLIGHT_PWM_DRIVER PWMD1
38#define BACKLIGHT_PWM_CHANNEL 1
36#define BACKLIGHT_LEVELS 6 39#define BACKLIGHT_LEVELS 6
37#define BACKLIGHT_BREATHING 40#define BACKLIGHT_BREATHING
38#define BREATHING_PERIOD 6 41#define BREATHING_PERIOD 6
diff --git a/keyboards/cannonkeys/ortho75/rules.mk b/keyboards/cannonkeys/ortho75/rules.mk
index 3be309924..8acb50d0c 100644
--- a/keyboards/cannonkeys/ortho75/rules.mk
+++ b/keyboards/cannonkeys/ortho75/rules.mk
@@ -11,8 +11,7 @@ DFU_SUFFIX_ARGS = -v 1eaf -p 0003
11 11
12# project specific files 12# project specific files
13VPATH += keyboards/cannonkeys/bluepill 13VPATH += keyboards/cannonkeys/bluepill
14SRC = led.c \ 14SRC = keyboard.c
15 keyboard.c
16 15
17#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration 16#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys 17MOUSEKEY_ENABLE = yes # Mouse keys
@@ -20,9 +19,8 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = yes # Console for debug 19CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration 20COMMAND_ENABLE = yes # Commands for debug and configuration
22SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 21SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
23NKRO_ENABLE = yes # USB Nkey Rollover 22NKRO_ENABLE = yes # USB Nkey Rollover
24BACKLIGHT_ENABLE = yes 23BACKLIGHT_ENABLE = yes
25BACKLIGHT_DRIVER = custom
26RGBLIGHT_ENABLE = yes 24RGBLIGHT_ENABLE = yes
27ENCODER_ENABLE = yes 25ENCODER_ENABLE = yes
28 26
diff --git a/keyboards/cannonkeys/practice60/config.h b/keyboards/cannonkeys/practice60/config.h
index af23eff32..ec16e39b3 100644
--- a/keyboards/cannonkeys/practice60/config.h
+++ b/keyboards/cannonkeys/practice60/config.h
@@ -33,6 +33,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } 33#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 }
34#define DIODE_DIRECTION COL2ROW 34#define DIODE_DIRECTION COL2ROW
35 35
36#define BACKLIGHT_PIN A8
37#define BACKLIGHT_PWM_DRIVER PWMD1
38#define BACKLIGHT_PWM_CHANNEL 1
36#define BACKLIGHT_LEVELS 6 39#define BACKLIGHT_LEVELS 6
37#define BACKLIGHT_BREATHING 40#define BACKLIGHT_BREATHING
38#define BREATHING_PERIOD 6 41#define BREATHING_PERIOD 6
diff --git a/keyboards/cannonkeys/practice60/rules.mk b/keyboards/cannonkeys/practice60/rules.mk
index be1584d72..0eacb9c7b 100644
--- a/keyboards/cannonkeys/practice60/rules.mk
+++ b/keyboards/cannonkeys/practice60/rules.mk
@@ -11,8 +11,7 @@ DFU_SUFFIX_ARGS = -v 1eaf -p 0003
11 11
12# project specific files 12# project specific files
13VPATH += keyboards/cannonkeys/bluepill 13VPATH += keyboards/cannonkeys/bluepill
14SRC = led.c \ 14SRC = keyboard.c
15 keyboard.c
16 15
17#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration 16#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys 17MOUSEKEY_ENABLE = yes # Mouse keys
@@ -20,9 +19,8 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = yes # Console for debug 19CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration 20COMMAND_ENABLE = yes # Commands for debug and configuration
22SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 21SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
23NKRO_ENABLE = yes # USB Nkey Rollover 22NKRO_ENABLE = yes # USB Nkey Rollover
24BACKLIGHT_ENABLE = yes 23BACKLIGHT_ENABLE = yes
25BACKLIGHT_DRIVER = custom
26RGBLIGHT_ENABLE = yes 24RGBLIGHT_ENABLE = yes
27 25
28LAYOUTS = 60_ansi 26LAYOUTS = 60_ansi
diff --git a/keyboards/cannonkeys/practice65/config.h b/keyboards/cannonkeys/practice65/config.h
index 7ebac8d8e..346af8ff3 100644
--- a/keyboards/cannonkeys/practice65/config.h
+++ b/keyboards/cannonkeys/practice65/config.h
@@ -33,6 +33,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define MATRIX_ROW_PINS { B4, B11, B1, B7, B6 } 33#define MATRIX_ROW_PINS { B4, B11, B1, B7, B6 }
34#define DIODE_DIRECTION COL2ROW 34#define DIODE_DIRECTION COL2ROW
35 35
36#define BACKLIGHT_PIN A8
37#define BACKLIGHT_PWM_DRIVER PWMD1
38#define BACKLIGHT_PWM_CHANNEL 1
36#define BACKLIGHT_LEVELS 6 39#define BACKLIGHT_LEVELS 6
37#define BACKLIGHT_BREATHING 40#define BACKLIGHT_BREATHING
38#define BREATHING_PERIOD 6 41#define BREATHING_PERIOD 6
diff --git a/keyboards/cannonkeys/practice65/rules.mk b/keyboards/cannonkeys/practice65/rules.mk
index d4a396120..90a339bb3 100644
--- a/keyboards/cannonkeys/practice65/rules.mk
+++ b/keyboards/cannonkeys/practice65/rules.mk
@@ -11,8 +11,7 @@ DFU_SUFFIX_ARGS = -v 1eaf -p 0003
11 11
12# project specific files 12# project specific files
13VPATH += keyboards/cannonkeys/bluepill 13VPATH += keyboards/cannonkeys/bluepill
14SRC = led.c \ 14SRC = keyboard.c
15 keyboard.c
16 15
17#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration 16#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys 17MOUSEKEY_ENABLE = yes # Mouse keys
@@ -20,9 +19,8 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = yes # Console for debug 19CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration 20COMMAND_ENABLE = yes # Commands for debug and configuration
22SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 21SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
23NKRO_ENABLE = yes # USB Nkey Rollover 22NKRO_ENABLE = yes # USB Nkey Rollover
24BACKLIGHT_ENABLE = yes 23BACKLIGHT_ENABLE = yes
25BACKLIGHT_DRIVER = custom
26RGBLIGHT_ENABLE = yes 24RGBLIGHT_ENABLE = yes
27 25
28 26