From a7b983542c0b4a835c89398f5ba2da8ebe759f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Re=CC=A8kawek?= Date: Sat, 26 Nov 2016 17:19:44 +0100 Subject: [PATCH] Cosmetic changes. --- README.md | 6 +++--- mac_plus_ps2/mac_plus_ps2.ino | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 807de5c..8cd3c6f 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ The order of RJ10 pins is the same as in the computer connector: For the Mini-DIN 6 plug, pins should be connected as follows: -1. +DATA -> pin 2, +1. +DATA -> pin 3, 2. -, 3. GND -> GND, 4. Vcc -> +5V, -5. +CLK -> pin 3, +5. +CLK -> pin 2, 6. - Pinout for the female connector from front (copied from [Wikipedia](https://en.wikipedia.org/wiki/PS/2_port)): @@ -34,4 +34,4 @@ Pinout for the female connector from front (copied from [Wikipedia](https://en.w * [Similar project based on stm32f0discovery kit](http://www.synack.net/~bbraun/mackbd/index.html), * [Mac Plus technical information](http://www.mac.linux-m68k.org/devel/plushw.php) - contains the description of the protocol, -* [Mac Plus scancodes](https://github.com/altercation/tmk_firrmware_hhkb_teensy2/blob/master/protocol/m0110.c). +* [Mac Plus keyboard rawcodes](https://github.com/altercation/tmk_firrmware_hhkb_teensy2/blob/master/protocol/m0110.c). diff --git a/mac_plus_ps2/mac_plus_ps2.ino b/mac_plus_ps2/mac_plus_ps2.ino index 8c7b6d1..2bc886a 100644 --- a/mac_plus_ps2/mac_plus_ps2.ino +++ b/mac_plus_ps2/mac_plus_ps2.ino @@ -66,6 +66,7 @@ void loop() { } } +// reads the command, operates the diagnostic LED and switches pin mode back to OUTPUT byte readCmd() { digitalWrite(LED_BUILTIN, LOW); pinMode(MAC_DATA_PIN, INPUT_PULLUP); @@ -162,8 +163,6 @@ unsigned int getExtendedTransition() { } } -boolean capsLockPressed = false; - unsigned int translate(byte scanCode, boolean extended, boolean released) { unsigned int translated = extended ? extScanCodesTable[scanCode] : scanCodesTable[scanCode]; if (translated == NULL_TRANSITION) { @@ -179,6 +178,8 @@ unsigned int translate(byte scanCode, boolean extended, boolean released) { } } +boolean capsLockPressed = false; + unsigned int handleCapsLockRelease() { if (capsLockPressed) { capsLockPressed = false;