config.h (2832B)
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 EE_HANDS 21 22 #define PHYSICAL_LEDS_ENABLE 23 #define IOS_DEVICE_ENABLE 24 25 #define RGBLIGHT_TIMER 26 27 #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) 28 #define USB_MAX_POWER_CONSUMPTION 400 29 #else 30 // iOS device need lessthan 100 31 #define USB_MAX_POWER_CONSUMPTION 100 32 #endif 33 34 #define NUM_LOCK_LED_PIN D7 35 #define CAPS_LOCK_LED_PIN B5 36 #define SCROLL_LOCK_LED_PIN B6 37 38 // #define NUM_NMOSFET //uncomment this if you using n-mosfet 39 // #define CAPS_NMOSFET //uncomment this if you using n-mosfet 40 // #define SCROLL_NMOSFET //uncomment this if you using n-mosfet 41 42 // #define NUM_INVERT // uncomment this if you want to reverse logic of numlock 43 // This will make it light up only when lock is off 44 // (Doesn't work on mac. There is no num lock, so it will be always off and lit) 45 46 #ifdef NUM_NMOSFET 47 #define RESET_NUM_LOCK_LED() gpio_write_pin_low(NUM_LOCK_LED_PIN) 48 #ifdef NUM_INVERT 49 #define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock) 50 #else 51 #define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock) 52 #endif // NUM_INVERT 53 #else 54 #define RESET_NUM_LOCK_LED() gpio_write_pin_high(NUM_LOCK_LED_PIN) 55 #ifdef NUM_INVERT 56 #define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, led_state.num_lock) 57 #else 58 #define UPDATE_NUM_LOCK_LED() gpio_write_pin(NUM_LOCK_LED_PIN, !led_state.num_lock) 59 #endif // NUM_INVERT 60 #endif // NUM_NMOSFET 61 62 #ifdef CAPS_NMOSFET 63 #define RESET_CAPS_LOCK_LED() gpio_write_pin_low(CAPS_LOCK_LED_PIN) 64 #define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, led_state.caps_lock) 65 #else 66 #define RESET_CAPS_LOCK_LED() gpio_write_pin_high(CAPS_LOCK_LED_PIN) 67 #define UPDATE_CAPS_LOCK_LED() gpio_write_pin(CAPS_LOCK_LED_PIN, !led_state.caps_lock) 68 #endif // CAPS_NMOSFET 69 70 #ifdef SCROLL_NMOSFET 71 #define RESET_SCROLL_LOCK_LED() gpio_write_pin_low(SCROLL_LOCK_LED_PIN) 72 #define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock) 73 #else 74 #define RESET_SCROLL_LOCK_LED() gpio_write_pin_high(SCROLL_LOCK_LED_PIN) 75 #define UPDATE_SCROLL_LOCK_LED() gpio_write_pin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock) 76 #endif // SCROLL_NMOSFET