From 87e6b7bf9a468d7e382754e820c9c5c66bd373e3 Mon Sep 17 00:00:00 2001 From: Gondolindrim Date: Sun, 12 Dec 2021 12:39:19 -0300 Subject: [PATCH 1/3] Add 'capslock backlight' capability to Iron180 --- keyboards/iron180/config.h | 3 +++ keyboards/iron180/iron180.c | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/keyboards/iron180/config.h b/keyboards/iron180/config.h index bb71496b530d..97f07a402e16 100644 --- a/keyboards/iron180/config.h +++ b/keyboards/iron180/config.h @@ -47,3 +47,6 @@ along with this program. If not, see . #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE + +// Turn backlight on-off according to capslock (off by default) +//#define CAPSLOCK_BACKLIGHT diff --git a/keyboards/iron180/iron180.c b/keyboards/iron180/iron180.c index 236f8176f6dc..546ff7fc8f57 100644 --- a/keyboards/iron180/iron180.c +++ b/keyboards/iron180/iron180.c @@ -1,5 +1,5 @@ /* -Copyright 2020 Álvaro "Gondolindrim" Volpato +Copyright 2021 Álvaro "Gondolindrim" Volpato 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 @@ -16,3 +16,18 @@ along with this program. If not, see . */ #include "iron180.h" + +#ifdef CAPSLOCK_BACKLIGHT +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if (!led_state.caps_lock){ + if (is_backlight_breathing()) breathing_disable(); + backlight_disable(); + } + else { + if (is_backlight_breathing()) breathing_enable(); + backlight_enable(); + } + return res; +} +#endif From e8e9ce18183935ed07ad8787a63d09ced0e84f78 Mon Sep 17 00:00:00 2001 From: Gondolindrim Date: Sun, 12 Dec 2021 12:45:00 -0300 Subject: [PATCH 2/3] Update readme --- keyboards/iron180/readme.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/keyboards/iron180/readme.md b/keyboards/iron180/readme.md index 1dbffae1d4e4..d89ca912ef58 100644 --- a/keyboards/iron180/readme.md +++ b/keyboards/iron180/readme.md @@ -31,3 +31,16 @@ Then, after accessing the DFU state, use a tool like `dfu-util` or the QMK Toolb make iron180:default:flash See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## The 'caps lock backlight' feature + +The Iron180 firmware allows the user to adjust the backlight according to the caps lock key. This will toggle *all backlight LEDs* according to caps lock, enabling backlight when caps is on and disabling when it is off. + +This option is specially useful if you are only interested in the caps lock LED and want it to work as an indicator; however, it must be noted that this works keyboard-wide, so if that is your case you should only solder the caps lock key LED and none else. + +This option is disabled by default; in order to enable it, you must un-comment the last line in `config.h`: + + // Turn backlight on-off according to capslock + #define CAPSLOCK_BACKLIGHT + +Then compile and flash the firmware. From 1c60add0680fa64883f988770a1445a0b819c312 Mon Sep 17 00:00:00 2001 From: Gondolindrim Date: Mon, 13 Dec 2021 23:13:00 -0300 Subject: [PATCH 3/3] Revers CAPSLOCK_BACKLIGHT back to default --- keyboards/iron180/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/iron180/config.h b/keyboards/iron180/config.h index 97f07a402e16..cc5c81a50cc1 100644 --- a/keyboards/iron180/config.h +++ b/keyboards/iron180/config.h @@ -49,4 +49,4 @@ along with this program. If not, see . #define LOCKING_RESYNC_ENABLE // Turn backlight on-off according to capslock (off by default) -//#define CAPSLOCK_BACKLIGHT +#define CAPSLOCK_BACKLIGHT