Browse Source

Merge remote-tracking branch 'upstream/master'

master
Kai Ryu 5 years ago
parent
commit
da21e0c7d8
100 changed files with 286 additions and 227 deletions
  1. 34
    57
      README.md
  2. 1
    1
      converter/usb_usb/Makefile
  3. 0
    36
      converter/usb_usb/main.cpp
  4. 0
    133
      converter/usb_usb/matrix.c
  5. 221
    0
      converter/usb_usb/usb_usb.cpp
  6. 0
    0
      orphan/IIgs/Makefile
  7. 0
    0
      orphan/IIgs/README
  8. 0
    0
      orphan/IIgs/config.h
  9. 0
    0
      orphan/IIgs/doc/PIN_BYPASS.jpg
  10. 0
    0
      orphan/IIgs/doc/Teensy++_Mod.jpg
  11. 0
    0
      orphan/IIgs/hid_listen.mac
  12. 0
    0
      orphan/IIgs/keymap.c
  13. 0
    0
      orphan/IIgs/led.c
  14. 0
    0
      orphan/IIgs/matrix.c
  15. 30
    0
      orphan/README.md
  16. 0
    0
      orphan/ascii_usb/Makefile
  17. 0
    0
      orphan/ascii_usb/README
  18. 0
    0
      orphan/ascii_usb/config.h
  19. 0
    0
      orphan/ascii_usb/keymap.c
  20. 0
    0
      orphan/ascii_usb/led.c
  21. 0
    0
      orphan/ascii_usb/matrix.c
  22. 0
    0
      orphan/ghost_squid/Makefile.lufa
  23. 0
    0
      orphan/ghost_squid/README.md
  24. 0
    0
      orphan/ghost_squid/config.h
  25. 0
    0
      orphan/ghost_squid/keymap.c
  26. 0
    0
      orphan/ghost_squid/keymap_ansi.h
  27. 0
    0
      orphan/ghost_squid/led.c
  28. 0
    0
      orphan/ghost_squid/matrix.c
  29. 0
    0
      orphan/hid_liber/Makefile.lufa
  30. 0
    0
      orphan/hid_liber/Makefile.pjrc
  31. 0
    0
      orphan/hid_liber/README.md
  32. 0
    0
      orphan/hid_liber/config.h
  33. 0
    0
      orphan/hid_liber/keymap.c
  34. 0
    0
      orphan/hid_liber/keymap_alaricljs.h
  35. 0
    0
      orphan/hid_liber/keymap_ansi.h
  36. 0
    0
      orphan/hid_liber/keymap_custom.h
  37. 0
    0
      orphan/hid_liber/keymap_iso.h
  38. 0
    0
      orphan/hid_liber/led.c
  39. 0
    0
      orphan/hid_liber/matrix.c
  40. 0
    0
      orphan/kitten_paw/Makefile.lufa
  41. 0
    0
      orphan/kitten_paw/README.md
  42. 0
    0
      orphan/kitten_paw/config.h
  43. 0
    0
      orphan/kitten_paw/keymap.c
  44. 0
    0
      orphan/kitten_paw/keymap_ansi.h
  45. 0
    0
      orphan/kitten_paw/led.c
  46. 0
    0
      orphan/kitten_paw/matrix.c
  47. 0
    0
      orphan/kmac/Makefile.lufa
  48. 0
    0
      orphan/kmac/Makefile.pjrc
  49. 0
    0
      orphan/kmac/README.md
  50. 0
    0
      orphan/kmac/backlight.c
  51. 0
    0
      orphan/kmac/config.h
  52. 0
    0
      orphan/kmac/keymap.c
  53. 0
    0
      orphan/kmac/keymap_winkey.h
  54. 0
    0
      orphan/kmac/keymap_winkeyless.h
  55. 0
    0
      orphan/kmac/led.c
  56. 0
    0
      orphan/kmac/matrix.c
  57. 0
    0
      orphan/lightpad/Makefile.lufa
  58. 0
    0
      orphan/lightpad/README.md
  59. 0
    0
      orphan/lightpad/backlight.c
  60. 0
    0
      orphan/lightpad/backlight.h
  61. 0
    0
      orphan/lightpad/config.h
  62. 0
    0
      orphan/lightpad/keymap.c
  63. 0
    0
      orphan/lightpad/keymap_lightpad.h
  64. 0
    0
      orphan/lightpad/led.c
  65. 0
    0
      orphan/lightpad/matrix.c
  66. 0
    0
      orphan/lightsaber/Makefile.lufa
  67. 0
    0
      orphan/lightsaber/Makefile.pjrc
  68. 0
    0
      orphan/lightsaber/README.md
  69. 0
    0
      orphan/lightsaber/backlight.c
  70. 0
    0
      orphan/lightsaber/backlight.h
  71. 0
    0
      orphan/lightsaber/config.h
  72. 0
    0
      orphan/lightsaber/keymap.c
  73. 0
    0
      orphan/lightsaber/keymap_winkey.h
  74. 0
    0
      orphan/lightsaber/led.c
  75. 0
    0
      orphan/lightsaber/matrix.c
  76. 0
    0
      orphan/macway/Makefile.lufa
  77. 0
    0
      orphan/macway/Makefile.pjrc
  78. 0
    0
      orphan/macway/config.h
  79. 0
    0
      orphan/macway/doc/back.jpg
  80. 0
    0
      orphan/macway/doc/case.jpg
  81. 0
    0
      orphan/macway/doc/keys.jpg
  82. 0
    0
      orphan/macway/doc/side.jpg
  83. 0
    0
      orphan/macway/doc/switch.jpg
  84. 0
    0
      orphan/macway/doc/teensy.jpg
  85. 0
    0
      orphan/macway/doc/wiring.jpg
  86. 0
    0
      orphan/macway/doc/withHHKB.jpg
  87. 0
    0
      orphan/macway/doc/withThinkPad.jpg
  88. 0
    0
      orphan/macway/keymap.c
  89. 0
    0
      orphan/macway/led.c
  90. 0
    0
      orphan/macway/matrix.c
  91. 0
    0
      orphan/nerd/Makefile
  92. 0
    0
      orphan/nerd/README.md
  93. 0
    0
      orphan/nerd/backlight.c
  94. 0
    0
      orphan/nerd/backlight.h
  95. 0
    0
      orphan/nerd/config.h
  96. 0
    0
      orphan/nerd/keymap_60_ansi150.c
  97. 0
    0
      orphan/nerd/keymap_80_ansi150.c
  98. 0
    0
      orphan/nerd/keymap_common.c
  99. 0
    0
      orphan/nerd/keymap_common.h
  100. 0
    0
      orphan/nerd/matrix.c

+ 34
- 57
README.md View File

@@ -1,12 +1,15 @@
TMK Keyboard Firmware Collection
================================
This is a keyboard firmware with some useful features for Atmel AVR controller.
This repository includes keyboard and converter firmware projects built with [`tmk_core`][tmk_core] keyboard library.

Source code is available here: <http://github.com/tmk/tmk_keyboard>
The latest source code is available here: <http://github.com/tmk/tmk_keyboard>


Updates
-------
#### 2016/06/22
Some projects were moved from `converter` and `keyboard` to `orphan` directory. Those might be removed in some future but you will be able to access them with `orphans` tag. See <https://github.com/tmk/tmk_keyboard/issues/173>

#### 2016/02/10
core: flabbergast's Chibios protocol was merged from <https://github.com/flabbergast/tmk_keyboard/tree/chibios> (@72b1668). See [tmk_core/protocol/chibios/README.md](tmk_core/protocol/chibios/README.md). Chibios protocol supports Cortex-M such as STM32 and Kinetis.

@@ -19,28 +22,6 @@ In `Makefile` you need to set `TMK_DIR` to indicate core library location now.



Features
--------
These features can be used in your keyboard.

* Multi-layer Keymap - Multiple keyboard layouts with layer switching
* Mouse key - Mouse control with keyboard
* System Control Key - Power Down, Sleep, Wake Up and USB Remote Wake up
* Media Control Key - Volume Down/Up, Mute, Next/Prev track, Play, Stop and etc
* USB NKRO - 120 keys(+ 8 modifiers) simultaneously
* PS/2 mouse support - PS/2 mouse(TrackPoint) as composite device
* Keyboard protocols - PS/2, ADB, M0110, Sun and other old keyboard protocols
* User Function - Customizable function of key with writing code
* Macro - Very primitive at this time
* Keyboard Tricks - Oneshot modifier and modifier with tapping feature
* Debug Console - Messages for debug and interaction with firmware
* Virtual DIP Switch - Configurations stored EEPROM(Boot Magic)
* Locking CapsLock - Mechanical switch support for CapsLock
* Breathing Sleep LED - Sleep indicator with charm during USB suspend
* Backlight - Control backlight levels



Projects
--------
You can find some keyboard specific projects under `converter` and `keyboard` directory.
@@ -54,32 +35,23 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
* [x68k_usb](converter/x68k_usb/) - [Sharp X68000 keyboard to USB][GH_x68k]
* [sun_usb](converter/sun_usb/) - [Sun] to USB(type4, 5 and 3?)
* [pc98_usb](converter/pc98_usb/) - [PC98] to USB
* [usb_usb](converter/usb_usb/) - USB to USB(experimental)
* [ascii_usb](converter/ascii_usb/) - ASCII(Serial console terminal) to USB
* [ibm4704_usb](converter/ibm4704_usb) - [IBM 4704 keyboard Converter][GH_ibm4704]
* [usb_usb](converter/usb_usb/) - [USB to USB][GH_usb]
* [ibm4704_usb](converter/ibm4704_usb) - [IBM 4704 keyboard to USB][GH_ibm4704]
* [next_usb](converter/next_usb) - NeXT(Non-ADB) to USB, contributed by [BCG](https://github.com/bgould) and based on [Adafruit's work](https://learn.adafruit.com/usb-next-keyboard-with-arduino-micro/overview)

### keyboard
* [hhkb](keyboard/hhkb/) - [Happy Hacking Keyboard pro][GH_hhkb] **my main board**
* [gh60](keyboard/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] **my second board**
* [alps64](keyboard/alps64/) - [Alps64 PCB](https://geekhack.org/index.php?topic=69740.0)
* [hbkb](keyboard/hbkb/) - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
* [hid_liber](keyboard/hid_liber/) - [HID liberation][HID_liber] controller (by alaricljs)
* [phantom](keyboard/phantom/) - [Phantom] keyboard (by Tranquilite)
* [IIgs_Standard](keyboard/IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
* [macway](keyboard/macway/) - [Compact keyboard mod][GH_macway] [retired]
* [KMAC](keyboard/kmac/) - Korean custom keyboard
* [Lightsaber](keyboard/lightsaber/) - Korean custom keyboard
* [Infinity](keyboard/infinity/) - Massdrop [Infinity keyboard][Infinity]
* [NerD](keyboard/nerd/) - Korean custom keyboard
* [KittenPaw](keyboard/kitten_paw) - Custom Majestouch controller
* [Lightpad](keyboard/lightpad) - Korean custom keypad
* [ghost_squid](keyboard/ghost_squid/) - [The Ghost Squid][ghost_squid] controller for [Cooler Master QuickFire XT][cmxt]
* [gh60](keyboard/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] **my second board**
* [onekey](keyboard/onekey/) - Simple one key keyboard example

### External projects using tmk_keyboard
* [ErgoDox_cub-uanic][cub-uanic] - Split Ergonomic Keyboard [ErgoDox][ergodox_org]
* [mcdox][mcdox_tmk] - [mcdox][mcdox]

### Projects based tmk_keyboard or tmk_core
https://github.com/tmk/tmk_keyboard/wiki/TMK-Based-Projects


[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
[GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
[GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
@@ -90,20 +62,12 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
[GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
[GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
[GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0
[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
[Phantom]: http://geekhack.org/index.php?topic=26742
[GH60]: http://geekhack.org/index.php?topic=34959
[GH60_proto]: http://geekhack.org/index.php?topic=37570.0
[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
[Sun]: http://en.wikipedia.org/wiki/Sun-3
[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
[Infinity]: https://www.massdrop.com/buy/infinity-keyboard-kit
[ghost_squid]: http://deskthority.net/wiki/Costar_replacement_controllers#The_Ghost_Squid
[cmxt]: http://gaming.coolermaster.com/en/products/keyboards/quickfirext/
[ergodox_org]: http://ergodox.org/
[cub-uanic]: https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
[mcdox]: https://github.com/DavidMcEwan/mcdox
[mcdox_tmk]: https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox
[tmk_core]: https://github.com/tmk/tmk_core



@@ -131,7 +95,7 @@ Magic Commands
--------------
To see help press `Magic` + `H`.

`Magic` key combination is `LShift` + `RShift` in many project, but `Power` key on ADB converter.
`Magic` key combination is `LShift` + `RShift` in many projects, but `Power` key on ADB converter.
`Magic` keybind can be vary on each project, check `config.h` in project directory.

Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed.
@@ -202,11 +166,11 @@ To avoid configuring accidentally additive salt key `KC_SPACE` also needs to be

Mechanical Locking support
--------------------------
This feature makes it possible for you to use mechanical locking switch for `CapsLock`, `NumLock`
This feature makes it possible for you to use mechanical locking switch for `CapsLock`, `NumLock`
or `ScrollLock`. To enable this feature define these macros in `config.h` and use `KC_LCAP`, `KC_LN
UM` or `KC_LSCR` in keymap for locking key instead of normal `KC_CAPS`, `KC_NLCK` or `KC_SLCK`. Res
ync option tries to keep switch state consistent with keyboard LED state.
#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE

@@ -214,15 +178,21 @@ ync option tries to keep switch state consistent with keyboard LED state.

Start Your Own Project
-----------------------
**TBD**
1. Add `tmk_core` into your repository using `git submodule` or `git subtree`.
2. Copy files from `tmk_keybaord` or other project similar to yours
3. Edit those files to support your keyboard.

See these as examples.
- https://github.com/tmk/infinity_ergodox
- https://github.com/tmk/whitefox



Debugging
--------
Use PJRC's `hid_listen` to see debug messages. You can use the tool for debug even if firmware use LUFA stack.
Use PJRC's `hid_listen` to see debug messages. You can use xprintf() to display debug info, see `tmk_core/common/xprintf.h`.

You can use xprintf() to display debug info on `hid_listen`, see `tmk_core/common/xprintf.h`.
- https://www.pjrc.com/teensy/hid_listen.html



@@ -236,6 +206,13 @@ Files and Directories



Contribution
------------
- Report bugs in github **[Issues](https://github.com/tmk/tmk_keyboard/issues)**.
- Pull requets are also welcomed.



Coding Style
-------------
- Doesn't use Tab to indent, use 4-spaces instead.

+ 1
- 1
converter/usb_usb/Makefile View File

@@ -110,7 +110,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096

SRC = \
keymap_common.c \
matrix.c \
usb_usb.cpp \
main.cpp

ifdef KEYMAP

+ 0
- 36
converter/usb_usb/main.cpp View File

@@ -3,17 +3,9 @@
#include <avr/power.h>
#include <util/delay.h>

// USB HID host
#include "Usb.h"
#include "usbhub.h"
#include "hid.h"
#include "hidboot.h"
#include "parser.h"

// LUFA
#include "lufa.h"

#include "timer.h"
#include "sendchar.h"
#include "debug.h"
#include "keyboard.h"
@@ -64,22 +56,6 @@ static void LUFA_setup(void)



/*
* USB Host Shield HID keyboard
*/
USB usb_host;
USBHub hub1(&usb_host);
HIDBoot<HID_PROTOCOL_KEYBOARD> kbd(&usb_host);
KBDReportParser kbd_parser;


void led_set(uint8_t usb_led)
{
kbd.SetReport(0, 0, 2, 0, 1, &usb_led);
}



int main(void)
{
// LED for debug
@@ -94,10 +70,6 @@ int main(void)

LUFA_setup();

// USB Host Shield setup
usb_host.Init();
kbd.SetReportParser(0, (HIDReportParser*)&kbd_parser);

/* NOTE: Don't insert time consuming job here.
* It'll cause unclear initialization failure when DFU reset(worm start).
*/
@@ -111,17 +83,9 @@ int main(void)

debug("init: done\n");

uint16_t timer;
for (;;) {
keyboard_task();

timer = timer_read();
usb_host.Task();
timer = timer_elapsed(timer);
if (timer > 100) {
debug("host.Task: "); debug_hex16(timer); debug("\n");
}

#if !defined(INTERRUPT_CONTROL_ENDPOINT)
// LUFA Task for control request
USB_USBTask();

+ 0
- 133
converter/usb_usb/matrix.c View File

@@ -1,133 +0,0 @@
/*
Copyright 2011 Jun Wako <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdint.h>
#include <stdbool.h>
#include "usb_hid.h"
#include "keycode.h"
#include "util.h"
#include "print.h"
#include "debug.h"
#include "matrix.h"

/* KEY CODE to Matrix
*
* HID keycode(1 byte):
* Higher 5 bits indicates ROW and lower 3 bits COL.
*
* 7 6 5 4 3 2 1 0
* +---------------+
* | ROW | COL |
* +---------------+
*
* Matrix space(16 * 16):
* r\c0123456789ABCDEF
* 0 +----------------+
* : | |
* : | |
* 16 +----------------+
*/
#define ROW_MASK 0xF0
#define COL_MASK 0x0F
#define CODE(row, col) (((row) << 4) | (col))
#define ROW(code) (((code) & ROW_MASK) >> 4)
#define COL(code) ((code) & COL_MASK)
#define ROW_BITS(code) (1 << COL(code))


uint8_t matrix_rows(void) { return MATRIX_ROWS; }
uint8_t matrix_cols(void) { return MATRIX_COLS; }
void matrix_init(void) {}
bool matrix_has_ghost(void) { return false; }

static bool matrix_is_mod =false;

uint8_t matrix_scan(void) {
static uint16_t last_time_stamp = 0;

if (last_time_stamp != usb_hid_time_stamp) {
last_time_stamp = usb_hid_time_stamp;
matrix_is_mod = true;
} else {
matrix_is_mod = false;
}
return 1;
}

bool matrix_is_modified(void) {

return matrix_is_mod;
}

bool matrix_is_on(uint8_t row, uint8_t col) {
uint8_t code = CODE(row, col);

if (IS_MOD(code)) {
if (usb_hid_keyboard_report.mods & ROW_BITS(code)) {
return true;
}
}
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (usb_hid_keyboard_report.keys[i] == code) {
return true;
}
}
return false;
}

matrix_row_t matrix_get_row(uint8_t row) {
uint16_t row_bits = 0;

if (IS_MOD(CODE(row, 0)) && usb_hid_keyboard_report.mods) {
row_bits |= usb_hid_keyboard_report.mods;
}

for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (IS_ANY(usb_hid_keyboard_report.keys[i])) {
if (row == ROW(usb_hid_keyboard_report.keys[i])) {
row_bits |= ROW_BITS(usb_hid_keyboard_report.keys[i]);
}
}
}
return row_bits;
}

uint8_t matrix_key_count(void) {
uint8_t count = 0;

count += bitpop(usb_hid_keyboard_report.mods);
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (IS_ANY(usb_hid_keyboard_report.keys[i])) {
count++;
}
}
return count;
}

void matrix_print(void) {
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
pbin_reverse(matrix_get_row(row));
#ifdef MATRIX_HAS_GHOST
if (matrix_has_ghost_in_row(row)) {
print(" <ghost");
}
#endif
print("\n");
}
}

+ 221
- 0
converter/usb_usb/usb_usb.cpp View File

@@ -0,0 +1,221 @@
/*
Copyright 2016 Jun Wako <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdint.h>
#include <stdbool.h>

// USB HID host
#include "Usb.h"
#include "usbhub.h"
#include "hid.h"
#include "hidboot.h"
#include "parser.h"

#include "keycode.h"
#include "util.h"
#include "print.h"
#include "debug.h"
#include "timer.h"
#include "matrix.h"
#include "led.h"


/* KEY CODE to Matrix
*
* HID keycode(1 byte):
* Higher 5 bits indicates ROW and lower 3 bits COL.
*
* 7 6 5 4 3 2 1 0
* +---------------+
* | ROW | COL |
* +---------------+
*
* Matrix space(16 * 16):
* r\c0123456789ABCDEF
* 0 +----------------+
* : | |
* : | |
* 16 +----------------+
*/
#define ROW_MASK 0xF0
#define COL_MASK 0x0F
#define CODE(row, col) (((row) << 4) | (col))
#define ROW(code) (((code) & ROW_MASK) >> 4)
#define COL(code) ((code) & COL_MASK)
#define ROW_BITS(code) (1 << COL(code))


// Integrated key state of all keyboards
static report_keyboard_t keyboard_report;

static bool matrix_is_mod =false;

/*
* USB Host Shield HID keyboards
* This supports two cascaded hubs and four keyboards
*/
USB usb_host;
USBHub hub1(&usb_host);
USBHub hub2(&usb_host);
HIDBoot<HID_PROTOCOL_KEYBOARD> kbd1(&usb_host);
HIDBoot<HID_PROTOCOL_KEYBOARD> kbd2(&usb_host);
HIDBoot<HID_PROTOCOL_KEYBOARD> kbd3(&usb_host);
HIDBoot<HID_PROTOCOL_KEYBOARD> kbd4(&usb_host);
KBDReportParser kbd_parser1;
KBDReportParser kbd_parser2;
KBDReportParser kbd_parser3;
KBDReportParser kbd_parser4;


uint8_t matrix_rows(void) { return MATRIX_ROWS; }
uint8_t matrix_cols(void) { return MATRIX_COLS; }
bool matrix_has_ghost(void) { return false; }
void matrix_init(void) {
// USB Host Shield setup
usb_host.Init();
kbd1.SetReportParser(0, (HIDReportParser*)&kbd_parser1);
kbd2.SetReportParser(0, (HIDReportParser*)&kbd_parser2);
kbd3.SetReportParser(0, (HIDReportParser*)&kbd_parser3);
kbd4.SetReportParser(0, (HIDReportParser*)&kbd_parser4);
}

static void or_report(report_keyboard_t report) {
// integrate reports into keyboard_report
keyboard_report.mods |= report.mods;
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (IS_ANY(report.keys[i])) {
for (uint8_t j = 0; j < KEYBOARD_REPORT_KEYS; j++) {
if (! keyboard_report.keys[j]) {
keyboard_report.keys[j] = report.keys[i];
break;
}
}
}
}
}

uint8_t matrix_scan(void) {
static uint16_t last_time_stamp1 = 0;
static uint16_t last_time_stamp2 = 0;
static uint16_t last_time_stamp3 = 0;
static uint16_t last_time_stamp4 = 0;

// check report came from keyboards
if (kbd_parser1.time_stamp != last_time_stamp1 ||
kbd_parser2.time_stamp != last_time_stamp2 ||
kbd_parser3.time_stamp != last_time_stamp3 ||
kbd_parser4.time_stamp != last_time_stamp4) {

last_time_stamp1 = kbd_parser1.time_stamp;
last_time_stamp2 = kbd_parser2.time_stamp;
last_time_stamp3 = kbd_parser3.time_stamp;
last_time_stamp4 = kbd_parser4.time_stamp;

// clear and integrate all reports
keyboard_report = {};
or_report(kbd_parser1.report);
or_report(kbd_parser2.report);
or_report(kbd_parser3.report);
or_report(kbd_parser4.report);

matrix_is_mod = true;

dprintf("state: %02X %02X", keyboard_report.mods, keyboard_report.reserved);
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
dprintf(" %02X", keyboard_report.keys[i]);
}
dprint("\r\n");
} else {
matrix_is_mod = false;
}

uint16_t timer;
timer = timer_read();
usb_host.Task();
timer = timer_elapsed(timer);
if (timer > 100) {
dprintf("host.Task: %d\n", timer);
}

return 1;
}

bool matrix_is_modified(void) {
return matrix_is_mod;
}

bool matrix_is_on(uint8_t row, uint8_t col) {
uint8_t code = CODE(row, col);

if (IS_MOD(code)) {
if (keyboard_report.mods & ROW_BITS(code)) {
return true;
}
}
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (keyboard_report.keys[i] == code) {
return true;
}
}
return false;
}

matrix_row_t matrix_get_row(uint8_t row) {
uint16_t row_bits = 0;

if (IS_MOD(CODE(row, 0)) && keyboard_report.mods) {
row_bits |= keyboard_report.mods;
}

for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (IS_ANY(keyboard_report.keys[i])) {
if (row == ROW(keyboard_report.keys[i])) {
row_bits |= ROW_BITS(keyboard_report.keys[i]);
}
}
}
return row_bits;
}

uint8_t matrix_key_count(void) {
uint8_t count = 0;

count += bitpop(keyboard_report.mods);
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (IS_ANY(keyboard_report.keys[i])) {
count++;
}
}
return count;
}

void matrix_print(void) {
print("\nr/c 0123456789ABCDEF\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
xprintf("%02d: ", row);
print_bin_reverse16(matrix_get_row(row));
print("\n");
}
}

void led_set(uint8_t usb_led)
{
kbd1.SetReport(0, 0, 2, 0, 1, &usb_led);
kbd2.SetReport(0, 0, 2, 0, 1, &usb_led);
kbd3.SetReport(0, 0, 2, 0, 1, &usb_led);
kbd4.SetReport(0, 0, 2, 0, 1, &usb_led);
}

keyboard/IIgs/Makefile → orphan/IIgs/Makefile View File


keyboard/IIgs/README → orphan/IIgs/README View File


keyboard/IIgs/config.h → orphan/IIgs/config.h View File


keyboard/IIgs/doc/PIN_BYPASS.jpg → orphan/IIgs/doc/PIN_BYPASS.jpg View File


keyboard/IIgs/doc/Teensy++_Mod.jpg → orphan/IIgs/doc/Teensy++_Mod.jpg View File


keyboard/IIgs/hid_listen.mac → orphan/IIgs/hid_listen.mac View File


keyboard/IIgs/keymap.c → orphan/IIgs/keymap.c View File


converter/serialmouse_usb/led.c → orphan/IIgs/led.c View File


keyboard/IIgs/matrix.c → orphan/IIgs/matrix.c View File


+ 30
- 0
orphan/README.md View File

@@ -0,0 +1,30 @@
Orphan Projects
===============
These projects won't be updated by tmk anymore and might be removed sometime in the future.
https://github.com/tmk/tmk_keyboard/issues/173

Also see this wiki page to find original repositories/authors and alternative projects.
https://github.com/tmk/tmk_keyboard/wiki/TMK-Based-Projects


* [ascii_usb](ascii_usb/) - ASCII(Serial console terminal) to USB
* [hid_liber](hid_liber/) - [HID liberation][HID_liber] controller (by alaricljs)
* [phantom](phantom/) - [Phantom] keyboard (by Tranquilite)
* [IIgs](IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
* [macway](macway/) - [Compact keyboard mod][GH_macway] [retired]
* [kmac](kmac/) - Korean custom keyboard
* [lightsaber](lightsaber/) - Korean custom keyboard
* [nerd](nerd/) - Korean custom keyboard
* [lightpad](lightpad) - Korean custom keypad
* [kitten_paw](kitten_paw) - Custom Majestouch controller
* [ghost_squid](ghost_squid/) - [The Ghost Squid][ghost_squid] controller for [Cooler Master QuickFire XT][cmxt]
* [terminal_bluefruit](terminal_bluefruit) - [Model M to Bluetooth with Bluefruit EZ-Key HID][Ada]
* [serialmouse_usb](serialmouse_usb) - <https://github.com/tmk/tmk_keyboard/pull/131>

[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
[Phantom]: http://geekhack.org/index.php?topic=26742
[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
[ghost_squid]: http://deskthority.net/wiki/Costar_replacement_controllers#The_Ghost_Squid
[cmxt]: http://gaming.coolermaster.com/en/products/keyboards/quickfirext/
[M_bluefruit]: https://learn.adafruit.com/convert-your-model-m-keyboard-to-bluetooth-with-bluefruit-ez-key-hid/overview

converter/ascii_usb/Makefile → orphan/ascii_usb/Makefile View File


converter/ascii_usb/README → orphan/ascii_usb/README View File


converter/ascii_usb/config.h → orphan/ascii_usb/config.h View File


converter/ascii_usb/keymap.c → orphan/ascii_usb/keymap.c View File


converter/ascii_usb/led.c → orphan/ascii_usb/led.c View File


converter/ascii_usb/matrix.c → orphan/ascii_usb/matrix.c View File


keyboard/ghost_squid/Makefile.lufa → orphan/ghost_squid/Makefile.lufa View File


keyboard/ghost_squid/README.md → orphan/ghost_squid/README.md View File


keyboard/ghost_squid/config.h → orphan/ghost_squid/config.h View File


keyboard/ghost_squid/keymap.c → orphan/ghost_squid/keymap.c View File


keyboard/ghost_squid/keymap_ansi.h → orphan/ghost_squid/keymap_ansi.h View File


keyboard/ghost_squid/led.c → orphan/ghost_squid/led.c View File


keyboard/ghost_squid/matrix.c → orphan/ghost_squid/matrix.c View File


keyboard/hid_liber/Makefile.lufa → orphan/hid_liber/Makefile.lufa View File


keyboard/hid_liber/Makefile.pjrc → orphan/hid_liber/Makefile.pjrc View File


keyboard/hid_liber/README.md → orphan/hid_liber/README.md View File


keyboard/hid_liber/config.h → orphan/hid_liber/config.h View File


keyboard/hid_liber/keymap.c → orphan/hid_liber/keymap.c View File


keyboard/hid_liber/keymap_alaricljs.h → orphan/hid_liber/keymap_alaricljs.h View File


keyboard/hid_liber/keymap_ansi.h → orphan/hid_liber/keymap_ansi.h View File


keyboard/hid_liber/keymap_custom.h → orphan/hid_liber/keymap_custom.h View File


keyboard/hid_liber/keymap_iso.h → orphan/hid_liber/keymap_iso.h View File


keyboard/hid_liber/led.c → orphan/hid_liber/led.c View File


keyboard/hid_liber/matrix.c → orphan/hid_liber/matrix.c View File


keyboard/kitten_paw/Makefile.lufa → orphan/kitten_paw/Makefile.lufa View File


keyboard/kitten_paw/README.md → orphan/kitten_paw/README.md View File


keyboard/kitten_paw/config.h → orphan/kitten_paw/config.h View File


keyboard/kitten_paw/keymap.c → orphan/kitten_paw/keymap.c View File


keyboard/kitten_paw/keymap_ansi.h → orphan/kitten_paw/keymap_ansi.h View File


keyboard/kitten_paw/led.c → orphan/kitten_paw/led.c View File


keyboard/kitten_paw/matrix.c → orphan/kitten_paw/matrix.c View File


keyboard/kmac/Makefile.lufa → orphan/kmac/Makefile.lufa View File


keyboard/kmac/Makefile.pjrc → orphan/kmac/Makefile.pjrc View File


keyboard/kmac/README.md → orphan/kmac/README.md View File


keyboard/kmac/backlight.c → orphan/kmac/backlight.c View File


keyboard/kmac/config.h → orphan/kmac/config.h View File


keyboard/kmac/keymap.c → orphan/kmac/keymap.c View File


keyboard/kmac/keymap_winkey.h → orphan/kmac/keymap_winkey.h View File


keyboard/kmac/keymap_winkeyless.h → orphan/kmac/keymap_winkeyless.h View File


keyboard/kmac/led.c → orphan/kmac/led.c View File


keyboard/kmac/matrix.c → orphan/kmac/matrix.c View File


keyboard/lightpad/Makefile.lufa → orphan/lightpad/Makefile.lufa View File


keyboard/lightpad/README.md → orphan/lightpad/README.md View File


keyboard/lightpad/backlight.c → orphan/lightpad/backlight.c View File


keyboard/lightpad/backlight.h → orphan/lightpad/backlight.h View File


keyboard/lightpad/config.h → orphan/lightpad/config.h View File


keyboard/lightpad/keymap.c → orphan/lightpad/keymap.c View File


keyboard/lightpad/keymap_lightpad.h → orphan/lightpad/keymap_lightpad.h View File


keyboard/lightpad/led.c → orphan/lightpad/led.c View File


keyboard/lightpad/matrix.c → orphan/lightpad/matrix.c View File


keyboard/lightsaber/Makefile.lufa → orphan/lightsaber/Makefile.lufa View File


keyboard/lightsaber/Makefile.pjrc → orphan/lightsaber/Makefile.pjrc View File


keyboard/lightsaber/README.md → orphan/lightsaber/README.md View File


keyboard/lightsaber/backlight.c → orphan/lightsaber/backlight.c View File


keyboard/lightsaber/backlight.h → orphan/lightsaber/backlight.h View File


keyboard/lightsaber/config.h → orphan/lightsaber/config.h View File


keyboard/lightsaber/keymap.c → orphan/lightsaber/keymap.c View File


keyboard/lightsaber/keymap_winkey.h → orphan/lightsaber/keymap_winkey.h View File


keyboard/lightsaber/led.c → orphan/lightsaber/led.c View File


keyboard/lightsaber/matrix.c → orphan/lightsaber/matrix.c View File


keyboard/macway/Makefile.lufa → orphan/macway/Makefile.lufa View File


keyboard/macway/Makefile.pjrc → orphan/macway/Makefile.pjrc View File


keyboard/macway/config.h → orphan/macway/config.h View File


keyboard/macway/doc/back.jpg → orphan/macway/doc/back.jpg View File


keyboard/macway/doc/case.jpg → orphan/macway/doc/case.jpg View File


keyboard/macway/doc/keys.jpg → orphan/macway/doc/keys.jpg View File


keyboard/macway/doc/side.jpg → orphan/macway/doc/side.jpg View File


keyboard/macway/doc/switch.jpg → orphan/macway/doc/switch.jpg View File


keyboard/macway/doc/teensy.jpg → orphan/macway/doc/teensy.jpg View File


keyboard/macway/doc/wiring.jpg → orphan/macway/doc/wiring.jpg View File


keyboard/macway/doc/withHHKB.jpg → orphan/macway/doc/withHHKB.jpg View File


keyboard/macway/doc/withThinkPad.jpg → orphan/macway/doc/withThinkPad.jpg View File


keyboard/macway/keymap.c → orphan/macway/keymap.c View File


keyboard/IIgs/led.c → orphan/macway/led.c View File


keyboard/macway/matrix.c → orphan/macway/matrix.c View File


keyboard/nerd/Makefile → orphan/nerd/Makefile View File


keyboard/nerd/README.md → orphan/nerd/README.md View File


keyboard/nerd/backlight.c → orphan/nerd/backlight.c View File


keyboard/nerd/backlight.h → orphan/nerd/backlight.h View File


keyboard/nerd/config.h → orphan/nerd/config.h View File


keyboard/nerd/keymap_60_ansi150.c → orphan/nerd/keymap_60_ansi150.c View File


keyboard/nerd/keymap_80_ansi150.c → orphan/nerd/keymap_80_ansi150.c View File


keyboard/nerd/keymap_common.c → orphan/nerd/keymap_common.c View File


keyboard/nerd/keymap_common.h → orphan/nerd/keymap_common.h View File


keyboard/nerd/matrix.c → orphan/nerd/matrix.c View File


Some files were not shown because too many files changed in this diff