qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

post_config.h (2481B)


      1 /*
      2 Copyright 2021 monksoffunk
      3 
      4 This program is free software: you can redistribute it and/or modify
      5 it under the terms of the GNU General Public License as published by
      6 the Free Software Foundation, either version 2 of the License, or
      7 (at your option) any later version.
      8 
      9 This program is distributed in the hope that it will be useful,
     10 but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12 GNU General Public License for more details.
     13 
     14 You should have received a copy of the GNU General Public License
     15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
     16 */
     17 
     18 #pragma once
     19 
     20 // RGB LED support
     21 // see ./rules.mk: LED_ANIMATIONS = yes or no
     22 //    see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes
     23 #ifdef RGBLIGHT_ENABLE
     24   #define RGBLIGHT_SPLIT
     25   #ifdef RGBLED_BACK
     26     #ifdef RGBLED_CONT
     27       #define RGBLIGHT_LED_COUNT 48
     28       #define RGBLED_SPLIT { 24, 24 }
     29     #else
     30       #define RGBLIGHT_LED_COUNT 24
     31     #endif
     32   #else
     33     #ifdef RGBLED_BOTH
     34       #ifdef RGBLED_CONT
     35         #define RGBLIGHT_LED_COUNT 60
     36         #define RGBLED_SPLIT { 30, 30 }
     37       #else
     38         #define RGBLIGHT_LED_COUNT 30
     39       #endif
     40     #else
     41       #ifdef RGBLED_CONT
     42         #define RGBLIGHT_LED_COUNT 12
     43         #define RGBLED_SPLIT { 6, 6 }
     44       #else
     45         #define RGBLIGHT_LED_COUNT 6
     46       #endif
     47     #endif
     48   #endif
     49 #endif
     50 
     51 #ifndef IOS_DEVICE_ENABLE
     52   #if (RGBLIGHT_LED_COUNT <= 6) || (defined(RGBLED_CONT) && (RGBLIGHT_LED_COUNT <= 12))
     53     #define RGBLIGHT_LIMIT_VAL 255
     54   #else
     55     #if (RGBLIGHT_LED_COUNT <= 16) || (defined(RGBLED_CONT) && (RGBLIGHT_LED_COUNT <= 32))
     56       #define RGBLIGHT_LIMIT_VAL 130
     57     #else
     58       #define RGBLIGHT_LIMIT_VAL 120
     59     #endif
     60   #endif
     61   #define RGBLIGHT_VAL_STEP 17
     62 #else
     63   #if (RGBLIGHT_LED_COUNT <= 6) || (defined(RGBLED_CONT) && (RGBLIGHT_LED_COUNT <= 12))
     64     #define RGBLIGHT_LIMIT_VAL 90
     65   #else
     66     #if (RGBLIGHT_LED_COUNT <= 16) || (defined(RGBLED_CONT) && (RGBLIGHT_LED_COUNT <= 32))
     67       #define RGBLIGHT_LIMIT_VAL 45
     68     #else
     69       #define RGBLIGHT_LIMIT_VAL 35
     70     #endif
     71   #endif
     72   #define RGBLIGHT_VAL_STEP 4
     73 #endif
     74 
     75 #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
     76 // USB_MAX_POWER_CONSUMPTION value
     77 //  120  RGBoff
     78 //  330  RGB 6
     79 //  300  RGB 32
     80   #define USB_MAX_POWER_CONSUMPTION 400
     81 #else
     82   // fix iPhone and iPad power adapter issue
     83   // iOS device need lessthan 100
     84   #define USB_MAX_POWER_CONSUMPTION 100
     85 #endif