aboutsummaryrefslogtreecommitdiff
path: root/keyboards/foxlab
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-11-18 17:51:53 +0000
committerGitHub <noreply@github.com>2020-11-18 17:51:53 +0000
commitf00402a2f3d551bcb1fb87245238e2b392192eb5 (patch)
treeaad0bdc88a3fae31ac58cfdd62d99bac06dc67d0 /keyboards/foxlab
parente1e13c53acb24c3617c3de88fa401acb3d628074 (diff)
downloadqmk_firmware-f00402a2f3d551bcb1fb87245238e2b392192eb5.tar.gz
qmk_firmware-f00402a2f3d551bcb1fb87245238e2b392192eb5.zip
Refactor to use led config - Part 3 (#10966)
* Refactor to use led config * Refactor to use led config * Refactor to use led config * Refactor to use led config
Diffstat (limited to 'keyboards/foxlab')
-rw-r--r--keyboards/foxlab/leaf60/hotswap/config.h3
-rw-r--r--keyboards/foxlab/leaf60/hotswap/hotswap.c43
-rw-r--r--keyboards/foxlab/leaf60/universal/config.h3
-rw-r--r--keyboards/foxlab/leaf60/universal/universal.c45
4 files changed, 6 insertions, 88 deletions
diff --git a/keyboards/foxlab/leaf60/hotswap/config.h b/keyboards/foxlab/leaf60/hotswap/config.h
index 26b67586e..0934c87bb 100644
--- a/keyboards/foxlab/leaf60/hotswap/config.h
+++ b/keyboards/foxlab/leaf60/hotswap/config.h
@@ -48,6 +48,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
48/* COL2ROW, ROW2COL*/ 48/* COL2ROW, ROW2COL*/
49#define DIODE_DIRECTION COL2ROW 49#define DIODE_DIRECTION COL2ROW
50 50
51#define LED_CAPS_LOCK_PIN E6
52#define LED_PIN_ON_STATE 0
53
51#define BACKLIGHT_PIN B7 54#define BACKLIGHT_PIN B7
52#define BACKLIGHT_BREATHING 55#define BACKLIGHT_BREATHING
53#define BACKLIGHT_LEVELS 4 56#define BACKLIGHT_LEVELS 4
diff --git a/keyboards/foxlab/leaf60/hotswap/hotswap.c b/keyboards/foxlab/leaf60/hotswap/hotswap.c
index 20778d927..e2de4a7e3 100644
--- a/keyboards/foxlab/leaf60/hotswap/hotswap.c
+++ b/keyboards/foxlab/leaf60/hotswap/hotswap.c
@@ -14,46 +14,3 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16#include "hotswap.h" 16#include "hotswap.h"
17
18// Optional override functions below.
19// You can leave any or all of these undefined.
20// These are only required if you want to perform custom actions.
21
22void matrix_init_kb(void) {
23 // put your keyboard start-up code here
24 // runs once when the firmware starts up
25 setPinOutput(E6);
26 matrix_init_user();
27}
28/*
29
30void matrix_scan_kb(void) {
31 // put your looping keyboard code here
32 // runs every cycle (a lot)
33
34 matrix_scan_user();
35}
36
37bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
38 // put your per-action keyboard code here
39 // runs for every action, just before processing by the firmware
40
41 return process_record_user(keycode, record);
42}
43
44void led_set_kb(uint8_t usb_led) {
45 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
46
47 led_set_user(usb_led);
48}
49
50*/
51
52void led_set_kb(uint8_t usb_led) {
53 if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
54 writePinLow(E6);
55 } else {
56 writePinHigh(E6);
57 }
58 led_set_user(usb_led);
59}
diff --git a/keyboards/foxlab/leaf60/universal/config.h b/keyboards/foxlab/leaf60/universal/config.h
index 9f761f454..f48bae497 100644
--- a/keyboards/foxlab/leaf60/universal/config.h
+++ b/keyboards/foxlab/leaf60/universal/config.h
@@ -48,6 +48,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
48/* COL2ROW, ROW2COL*/ 48/* COL2ROW, ROW2COL*/
49#define DIODE_DIRECTION COL2ROW 49#define DIODE_DIRECTION COL2ROW
50 50
51#define LED_CAPS_LOCK_PIN E6
52#define LED_PIN_ON_STATE 0
53
51#define BACKLIGHT_PIN B7 54#define BACKLIGHT_PIN B7
52#define BACKLIGHT_BREATHING 55#define BACKLIGHT_BREATHING
53#define BACKLIGHT_LEVELS 3 56#define BACKLIGHT_LEVELS 3
diff --git a/keyboards/foxlab/leaf60/universal/universal.c b/keyboards/foxlab/leaf60/universal/universal.c
index 5fe663a1b..197e411d7 100644
--- a/keyboards/foxlab/leaf60/universal/universal.c
+++ b/keyboards/foxlab/leaf60/universal/universal.c
@@ -14,48 +14,3 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16#include "universal.h" 16#include "universal.h"
17
18// Optional override functions below.
19// You can leave any or all of these undefined.
20// These are only required if you want to perform custom actions.
21
22void matrix_init_kb(void) {
23 // put your keyboard start-up code here
24 // runs once when the firmware starts up
25 setPinOutput(E6);
26 matrix_init_user();
27}
28
29/*
30
31void matrix_scan_kb(void) {
32 // put your looping keyboard code here
33 // runs every cycle (a lot)
34
35 matrix_scan_user();
36}
37
38bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
39 // put your per-action keyboard code here
40 // runs for every action, just before processing by the firmware
41
42 return process_record_user(keycode, record);
43}
44
45void led_set_kb(uint8_t usb_led) {
46 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
47
48 led_set_user(usb_led);
49}
50
51*/
52
53
54void led_set_kb(uint8_t usb_led) {
55 if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
56 writePinLow(E6);
57 } else {
58 writePinHigh(E6);
59 }
60 led_set_user(usb_led);
61}