config.h (3089B)
1 /* 2 Copyright 2012 Jun Wako <wakojun@gmail.com> 3 Copyright 2015 Jack Humbert 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 #pragma once 19 20 #define PHYSICAL_LEDS_ENABLE 21 22 #define RGBLIGHT_TIMER 23 24 #ifndef IOS_DEVICE_ENABLE 25 #if RGBLIGHT_LED_COUNT <= 6 26 #define RGBLIGHT_LIMIT_VAL 255 27 #else 28 #define RGBLIGHT_LIMIT_VAL 130 29 #endif 30 #define RGBLIGHT_VAL_STEP 8 31 #else 32 #if RGBLIGHT_LED_COUNT <= 6 33 #define RGBLIGHT_LIMIT_VAL 90 34 #else 35 #define RGBLIGHT_LIMIT_VAL 45 36 #endif 37 #define RGBLIGHT_VAL_STEP 4 38 #endif 39 40 #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) 41 #define USB_MAX_POWER_CONSUMPTION 400 42 #else 43 // iOS device need lessthan 100 44 #define USB_MAX_POWER_CONSUMPTION 100 45 #endif 46 47 #define NUM_LOCK_LED_PIN B6 48 #define CAPS_LOCK_LED_PIN B5 49 // #define SCROLL_LOCK_LED_PIN B6 50 51 // #define NUM_NMOSFET //uncomment this if you using n-mosfet 52 // #define CAPS_NMOSFET //uncomment this if you using n-mosfet 53 // #define SCROLL_NMOSFET //uncomment this if you using n-mosfet 54 55 // #define NUM_INVERT // uncomment this if you want to reverse logic of numlock 56 // This will make it light up only when lock is off 57 // (Doesn't work on mac. There is no num lock, so it will be always off and lit) 58 59 #ifdef NUM_NMOSFET 60 #define RESET_NUM_LOCK_LED() gpio_write_pin_low(NUM_LOCK_LED_PIN) 61 #ifdef NUM_INVERT 62 #define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock) 63 #else 64 #define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock) 65 #endif // NUM_INVERT 66 #else 67 #define RESET_NUM_LOCK_LED() gpio_write_pin_high(NUM_LOCK_LED_PIN) 68 #ifdef NUM_INVERT 69 #define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock) 70 #else 71 #define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock) 72 #endif // NUM_INVERT 73 #endif // NUM_NMOSFET 74 75 #ifdef CAPS_NMOSFET 76 #define RESET_CAPS_LOCK_LED() gpio_write_pin_low(CAPS_LOCK_LED_PIN) 77 #define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock) 78 #else 79 #define RESET_CAPS_LOCK_LED() gpio_write_pin_high(CAPS_LOCK_LED_PIN) 80 #define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock) 81 #endif // CAPS_NMOSFET 82 83 #ifdef SCROLL_NMOSFET 84 #define RESET_SCROLL_LOCK_LED() gpio_write_pin_low(SCROLL_LOCK_LED_PIN) 85 #define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock) 86 #else 87 #define RESET_SCROLL_LOCK_LED() gpio_write_pin_high(SCROLL_LOCK_LED_PIN) 88 #define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock) 89 #endif // SCROLL_NMOSFET