Skip to content

Commit

Permalink
Merge remote-tracking branch 'tmk/master' into cub_layout
Browse files Browse the repository at this point in the history
  • Loading branch information
cub-uanic committed Jan 2, 2015
2 parents c5d3988 + 22d99f2 commit 77815a2
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
1 change: 1 addition & 0 deletions common/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ static bool command_common(uint8_t code)
case KC_CAPSLOCK:
if (host_get_driver()) {
host_driver = host_get_driver();
clear_keyboard();
host_set_driver(0);
print("Locked.\n");
} else {
Expand Down
10 changes: 7 additions & 3 deletions common/keycode.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
/*
* Keycodes based on HID Usage Keyboard/Keypad Page(0x07) plus special codes
* http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
*/
Expand Down Expand Up @@ -140,6 +140,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define KC_VOLD KC_AUDIO_VOL_DOWN
#define KC_MNXT KC_MEDIA_NEXT_TRACK
#define KC_MPRV KC_MEDIA_PREV_TRACK
#define KC_MFFD KC_MEDIA_FAST_FORWARD
#define KC_MRWD KC_MEDIA_REWIND
#define KC_MSTP KC_MEDIA_STOP
#define KC_MPLY KC_MEDIA_PLAY_PAUSE
#define KC_MSEL KC_MEDIA_SELECT
Expand Down Expand Up @@ -390,7 +392,7 @@ enum hid_keyboard_keypad_usage {
KC_RALT,
KC_RGUI,

/* NOTE: 0xE8-FF are used for internal special purpose */
/* NOTE: 0xE8-FF are used for internal special purpose */
};

/* Special keycodes */
Expand Down Expand Up @@ -420,7 +422,9 @@ enum internal_special_keycodes {
KC_WWW_FORWARD,
KC_WWW_STOP,
KC_WWW_REFRESH,
KC_WWW_FAVORITES, /* 0xBA */
KC_WWW_FAVORITES,
KC_MEDIA_FAST_FORWARD,
KC_MEDIA_REWIND, /* 0xBC */

/* Fn key */
KC_FN0 = 0xC0,
Expand Down
5 changes: 4 additions & 1 deletion common/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* supplement for Bluegiga iWRAP HID(not supported by Windows?) */
#define AL_LOCK 0x019E
#define TRANSPORT_RECORD 0x00B2
#define TRANSPORT_FAST_FORWARD 0x00B3
#define TRANSPORT_REWIND 0x00B4
#define TRANSPORT_EJECT 0x00B8
#define AC_MINIMIZE 0x0206
Expand Down Expand Up @@ -158,6 +159,8 @@ typedef struct {
(key == KC_AUDIO_VOL_DOWN ? AUDIO_VOL_DOWN : \
(key == KC_MEDIA_NEXT_TRACK ? TRANSPORT_NEXT_TRACK : \
(key == KC_MEDIA_PREV_TRACK ? TRANSPORT_PREV_TRACK : \
(key == KC_MEDIA_FAST_FORWARD ? TRANSPORT_FAST_FORWARD : \
(key == KC_MEDIA_REWIND ? TRANSPORT_REWIND : \
(key == KC_MEDIA_STOP ? TRANSPORT_STOP : \
(key == KC_MEDIA_EJECT ? TRANSPORT_STOP_EJECT : \
(key == KC_MEDIA_PLAY_PAUSE ? TRANSPORT_PLAY_PAUSE : \
Expand All @@ -171,7 +174,7 @@ typedef struct {
(key == KC_WWW_FORWARD ? AC_FORWARD : \
(key == KC_WWW_STOP ? AC_STOP : \
(key == KC_WWW_REFRESH ? AC_REFRESH : \
(key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0)))))))))))))))))))
(key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0)))))))))))))))))))))

#ifdef __cplusplus
}
Expand Down
16 changes: 15 additions & 1 deletion converter/usb_usb/README
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ Arduino Leonardo
http://arduino.cc/en/Main/ArduinoBoardLeonardo

Circuit@Home USB Host Shield 2.0
http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino
https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/

Buying Arduino Leonardo and USB Host Shield 2.0(from Circuit@home) will be the easiest way, you won't need even soldering iron.
Arduino's Shield will also work well but I think Sparkfun's needs to be modified.

http://arduino.cc/en/Main/ArduinoUSBHostShield
https://www.sparkfun.com/products/9947

Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with some fixes on signal/power routing.
https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini
https://www.sparkfun.com/products/12587
https://www.pjrc.com/teensy/td_libs_USBHostShield.html



Build firmware
Expand All @@ -32,6 +44,8 @@ Limitation
Only supports 'HID Boot protocol'.
Not support keyboard LED yet.

Note that the converter can host only USB "boot protocol" keyboard(6KRO) and not NKRO, it is possible to support NKRO keyboard but you will need to write HID report parser for that. Every NKRO keyboard can have different HID report and it is difficult to support all kind of NKRO keyboards in the market.



Update
Expand Down
2 changes: 2 additions & 0 deletions protocol.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ endif

ifdef PS2_USE_INT
SRC += protocol/ps2_interrupt.c
SRC += protocol/ps2_io_avr.c
OPT_DEFS += -DPS2_USE_INT
endif

ifdef PS2_USE_USART
SRC += protocol/ps2_usart.c
SRC += protocol/ps2_io_avr.c
OPT_DEFS += -DPS2_USE_USART
endif

Expand Down
1 change: 1 addition & 0 deletions protocol/ps2_io_avr.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdbool.h>
#include <avr/io.h>
#include <util/delay.h>

/* Check port settings for clock and data line */
Expand Down

0 comments on commit 77815a2

Please sign in to comment.