diff options
author | cbbrowne <cbbrowne@cbbrowne.tor.int-afilias.info> | 2016-11-25 12:06:35 -0500 |
---|---|---|
committer | cbbrowne <cbbrowne@cbbrowne.tor.int-afilias.info> | 2016-11-25 12:06:35 -0500 |
commit | e3c735e400e6e7e78cbc9dfb17626e6066d8cf80 (patch) | |
tree | a5e2fddc86172922aa7d61be0d18ee8fc3d14e5e | |
parent | c05cbaf534d7d58bb8ca4cd9405525b941194372 (diff) | |
parent | bf23ac96f62be1cb36d414e76599523af3caf00f (diff) | |
download | qmk_firmware-e3c735e400e6e7e78cbc9dfb17626e6066d8cf80.tar.gz qmk_firmware-e3c735e400e6e7e78cbc9dfb17626e6066d8cf80.zip |
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
-rw-r--r-- | build_keyboard.mk | 1 | ||||
-rw-r--r-- | quantum/config_common.h | 4 | ||||
-rw-r--r-- | readme.md | 39 | ||||
-rw-r--r-- | tmk_core/common/avr/suspend.c | 11 |
4 files changed, 47 insertions, 8 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk index 61aebf3935..055ce632ae 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -199,6 +199,7 @@ endif VPATH += $(KEYBOARD_PATH) VPATH += $(COMMON_VPATH) +include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/common.mk SRC += $(TMK_COMMON_SRC) diff --git a/quantum/config_common.h b/quantum/config_common.h index 8ed5f4a106..6b525fe1c6 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h @@ -76,10 +76,9 @@ } while(0) # else # error "USART configuration is needed." +# endif #endif -// I'm fairly sure these aren't needed, but oh well - Jack - /* * PS/2 Interrupt configuration */ @@ -125,4 +124,3 @@ #endif -#endif @@ -1157,6 +1157,45 @@ The firmware supports 5 different light effects, and the color (hue, saturation, Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20. +## PS/2 Mouse Support + +Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device. +In order to do this you must first enable the option in your Makefile. + + PS2_MOUSE_ENABLE = yes + +Then, decide whether to use interrupts (better if your microcontroller supports them) or busywait, and enable the relevant option. + + PS2_USE_INT = yes + // PS2_USE_BUSYWAIT = yes + +If you're using a teensy and have hooked up the clock on your PS/2 device to D1 and the data to D0, you're all set. +Otherwise, you will need to update the following defines in your `config.h`: + + #define PS2_CLOCK_PORT PORTD + #define PS2_CLOCK_PIN PIND + #define PS2_CLOCK_DDR DDRD + #define PS2_CLOCK_BIT 1 + + #define PS2_DATA_PORT PORTD + #define PS2_DATA_PIN PIND + #define PS2_DATA_DDR DDRD + #define PS2_DATA_BIT 0 + +And with `PS2_USE_INT` also define these macros: + + #define PS2_INT_INIT() do { \ + EICRA |= ((1<<ISC11) | \ + (0<<ISC10)); \ + } while (0) + #define PS2_INT_ON() do { \ + EIMSK |= (1<<INT1); \ + } while (0) + #define PS2_INT_OFF() do { \ + EIMSK &= ~(1<<INT1); \ + } while (0) + #define PS2_INT_VECT INT1_vect + ## Safety Considerations You probably don't want to "brick" your keyboard, making it impossible diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 8a7272bbc5..0c81e83612 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -47,6 +47,7 @@ void suspend_idle(uint8_t time) sleep_disable(); } +#ifndef NO_SUSPEND_POWER_DOWN /* Power down MCU with watchdog timer * wdto: watchdog timer timeout defined in <avr/wdt.h> * WDTO_15MS @@ -61,6 +62,7 @@ void suspend_idle(uint8_t time) * WDTO_8S */ static uint8_t wdt_timeout = 0; + static void power_down(uint8_t wdto) { #ifdef PROTOCOL_LUFA @@ -98,19 +100,19 @@ static void power_down(uint8_t wdto) // Disable watchdog after sleep wdt_disable(); } +#endif void suspend_power_down(void) { +#ifndef NO_SUSPEND_POWER_DOWN power_down(WDTO_15MS); +#endif } __attribute__ ((weak)) void matrix_power_up(void) {} __attribute__ ((weak)) void matrix_power_down(void) {} bool suspend_wakeup_condition(void) { -#ifdef BACKLIGHT_ENABLE - backlight_set(0); -#endif matrix_power_up(); matrix_scan(); matrix_power_down(); @@ -126,10 +128,9 @@ void suspend_wakeup_init(void) // clear keyboard state clear_keyboard(); #ifdef BACKLIGHT_ENABLE - backlight_set(0); backlight_init(); #endif -led_set(host_keyboard_leds()); + led_set(host_keyboard_leds()); } #ifndef NO_SUSPEND_POWER_DOWN |