]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Extend maximum number of backlight levels to 31 (#6351)
authorfauxpark <fauxpark@gmail.com>
Wed, 17 Jul 2019 04:58:29 +0000 (14:58 +1000)
committerDrashna Jaelre <drashna@live.com>
Wed, 17 Jul 2019 04:58:29 +0000 (21:58 -0700)
docs/feature_backlight.md
tmk_core/common/backlight.h

index b06db89e4df9fa6fcd19be0349b2abf1a5fda973..26a5078ca09a4cb8233910f91c44ea5cfce4b9bc 100644 (file)
@@ -65,7 +65,7 @@ To change the behaviour of the backlighting, `#define` these in your `config.h`:
 |---------------------|-------------|-------------------------------------------------------------------------------------------------------------|
 |`BACKLIGHT_PIN`      |`B7`         |The pin that controls the LEDs. Unless you are designing your own keyboard, you shouldn't need to change this|
 |`BACKLIGHT_PINS`     |*Not defined*|experimental: see below for more information                                                                 |
 |---------------------|-------------|-------------------------------------------------------------------------------------------------------------|
 |`BACKLIGHT_PIN`      |`B7`         |The pin that controls the LEDs. Unless you are designing your own keyboard, you shouldn't need to change this|
 |`BACKLIGHT_PINS`     |*Not defined*|experimental: see below for more information                                                                 |
-|`BACKLIGHT_LEVELS`   |`3`          |The number of brightness levels (maximum 15 excluding off)                                                   |
+|`BACKLIGHT_LEVELS`   |`3`          |The number of brightness levels (maximum 31 excluding off)                                                   |
 |`BACKLIGHT_CAPS_LOCK`|*Not defined*|Enable Caps Lock indicator using backlight (for keyboards without dedicated LED)                             |
 |`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if supported                                                                     |
 |`BREATHING_PERIOD`   |`6`          |The length of one backlight "breath" in seconds                                                              |
 |`BACKLIGHT_CAPS_LOCK`|*Not defined*|Enable Caps Lock indicator using backlight (for keyboards without dedicated LED)                             |
 |`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if supported                                                                     |
 |`BREATHING_PERIOD`   |`6`          |The length of one backlight "breath" in seconds                                                              |
index cc56fb9af060859a9d05b3bc6d5b3841b82dbd71..0a38771206071571048e2734e7015c5875b930ed 100644 (file)
@@ -22,8 +22,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #ifndef BACKLIGHT_LEVELS
   #define BACKLIGHT_LEVELS 3
 
 #ifndef BACKLIGHT_LEVELS
   #define BACKLIGHT_LEVELS 3
-#elif BACKLIGHT_LEVELS > 15
-  #error "Maximum value of BACKLIGHT_LEVELS is 15"
+#elif BACKLIGHT_LEVELS > 31
+  #error "Maximum value of BACKLIGHT_LEVELS is 31"
 #endif
 
 typedef union {
 #endif
 
 typedef union {
@@ -31,7 +31,8 @@ typedef union {
     struct {
         bool    enable    :1;
         bool    breathing :1;
     struct {
         bool    enable    :1;
         bool    breathing :1;
-        uint8_t level     :4;
+        uint8_t reserved  :1; // Reserved for possible future backlight modes
+        uint8_t level     :5;
     };
 } backlight_config_t;
 
     };
 } backlight_config_t;