aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--m0110.c8
-rw-r--r--m0110.h2
-rw-r--r--m0110_usb/Makefile4
-rw-r--r--m0110_usb/README2
-rw-r--r--m0110_usb/keymap.c48
5 files changed, 46 insertions, 18 deletions
diff --git a/m0110.c b/m0110.c
index 725675ed8..f4f5223dd 100644
--- a/m0110.c
+++ b/m0110.c
@@ -103,7 +103,7 @@ KEY EVENT:
103 To get scan code, use ((bits&(1<<7)) | ((bits&7F))>>1). 103 To get scan code, use ((bits&(1<<7)) | ((bits&7F))>>1).
104 104
105SCAN CODE: 105SCAN CODE:
106 M0110A 106 M0110
107 ,---------------------------------------------------------. 107 ,---------------------------------------------------------.
108 | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| 108 | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs|
109 |---------------------------------------------------------| 109 |---------------------------------------------------------|
@@ -211,7 +211,9 @@ uint8_t m0110_recv(void)
211 } 211 }
212 } 212 }
213 idle(); 213 idle();
214 print("m0110_send recv data: "); phex(data); print("\n"); 214 if (data != M0110_NULL) {
215 print("m0110_recv data: "); phex(data); print("\n");
216 }
215 return data; 217 return data;
216ERROR: 218ERROR:
217 if (m0110_error) { 219 if (m0110_error) {
@@ -229,7 +231,7 @@ uint8_t m0110_recv_key(void)
229 if (key == 0xFF || key == M0110_NULL) 231 if (key == 0xFF || key == M0110_NULL)
230 return M0110_NULL; 232 return M0110_NULL;
231 else 233 else
232 return (key&(1<<7) | (key&0x7F)>>1); 234 return ((key&(1<<7)) | ((key&0x7F)>>1));
233} 235}
234 236
235 237
diff --git a/m0110.h b/m0110.h
index fe2e91227..f5c1e21bd 100644
--- a/m0110.h
+++ b/m0110.h
@@ -65,7 +65,7 @@ POSSIBILITY OF SUCH DAMAGE.
65extern uint8_t m0110_error; 65extern uint8_t m0110_error;
66 66
67/* host role */ 67/* host role */
68void m0110_host_init(void); 68void m0110_init(void);
69uint8_t m0110_send(uint8_t data); 69uint8_t m0110_send(uint8_t data);
70uint8_t m0110_recv(void); 70uint8_t m0110_recv(void);
71uint8_t m0110_recv_key(void); 71uint8_t m0110_recv_key(void);
diff --git a/m0110_usb/Makefile b/m0110_usb/Makefile
index 8c8460c80..819d7fff3 100644
--- a/m0110_usb/Makefile
+++ b/m0110_usb/Makefile
@@ -36,9 +36,9 @@ F_CPU = 16000000
36# Build Options 36# Build Options
37# *Comment out* to disable the options. 37# *Comment out* to disable the options.
38# 38#
39#MOUSEKEY_ENABLE = yes # Mouse keys 39MOUSEKEY_ENABLE = yes # Mouse keys
40#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support 40#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
41#EXTRAKEY_ENABLE = yes # Audio control and System control 41EXTRAKEY_ENABLE = yes # Audio control and System control
42#NKRO_ENABLE = yes # USB Nkey Rollover 42#NKRO_ENABLE = yes # USB Nkey Rollover
43 43
44 44
diff --git a/m0110_usb/README b/m0110_usb/README
index 4122edb28..6ef98757a 100644
--- a/m0110_usb/README
+++ b/m0110_usb/README
@@ -1,6 +1,6 @@
1M0110 to USB keyboard converter 1M0110 to USB keyboard converter
2=============================== 2===============================
3This firmware converts protocol for Apple Machintosh Keybard M0110. 3This firmware converts the protocol of Apple Macintosh keyboard M0110 into USB.
4 4
5 5
6Connection 6Connection
diff --git a/m0110_usb/keymap.c b/m0110_usb/keymap.c
index 24fe6cd47..bbb699a9a 100644
--- a/m0110_usb/keymap.c
+++ b/m0110_usb/keymap.c
@@ -55,9 +55,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
55 55
56// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. 56// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
57static const uint8_t PROGMEM fn_layer[] = { 57static const uint8_t PROGMEM fn_layer[] = {
58 0, // Fn0 58 1, // Fn0
59 0, // Fn1 59 2, // Fn1
60 0, // Fn2 60 3, // Fn2
61 0, // Fn3 61 0, // Fn3
62 0, // Fn4 62 0, // Fn4
63 0, // Fn5 63 0, // Fn5
@@ -68,8 +68,8 @@ static const uint8_t PROGMEM fn_layer[] = {
68// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. 68// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
69// See layer.c for details. 69// See layer.c for details.
70static const uint8_t PROGMEM fn_keycode[] = { 70static const uint8_t PROGMEM fn_keycode[] = {
71 KB_NO, // Fn0 71 KB_SCOLON, // Fn0
72 KB_NO, // Fn1 72 KB_SLASH, // Fn1
73 KB_NO, // Fn2 73 KB_NO, // Fn2
74 KB_NO, // Fn3 74 KB_NO, // Fn3
75 KB_NO, // Fn4 75 KB_NO, // Fn4
@@ -79,25 +79,51 @@ static const uint8_t PROGMEM fn_keycode[] = {
79}; 79};
80 80
81static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 81static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
82 // LShift and RShift are logically same one button.
83 // LOption and ROption are logically same one button.
82 /* Default Layer: plain keymap 84 /* Default Layer: plain keymap
83 * ,---------------------------------------------------------. 85 * ,---------------------------------------------------------.
84 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bacpa| 86 * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bacpa|
85 * |---------------------------------------------------------| 87 * |---------------------------------------------------------|
86 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| 88 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
87 * |---------------------------------------------------------| 89 * |---------------------------------------------------------|
88 * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return| 90 * |Contro| A| S| D| F| G| H| J| K| L|Fn0| '|Return|
89 * |---------------------------------------------------------| 91 * |---------------------------------------------------------|
90 * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | 92 * |Shift | Z| X| C| V| B| N| M| ,| ,|Fn1| Shift|
91 * `---------------------------------------------------------' 93 * `---------------------------------------------------------'
92 * |Opt|Alt | Space |Alt |Opt| 94 * |Fn2|Alt | Space |Gui |Fn2|
93 * `-----------------------------------------------' 95 * `-----------------------------------------------'
94 */ 96 */
95 KEYMAP( 97 KEYMAP(
96 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, 98 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,
97 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, 99 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS,
98 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, 100 LCTL,A, S, D, F, G, H, J, K, L, FN0, QUOT, ENT,
99 LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, 101 LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1,
100 LGUI,LALT, SPC, RALT 102 FN2, LALT, SPC, LGUI
103 ),
104 // vi mousekeys
105 KEYMAP(
106 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL,
107 CAPS,NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,NO, NO, NO, NO,
108 LCTL,VOLD,VOLU,MUTE,NO, NO, MS_L,MS_D,MS_U,MS_R,FN0, NO, ENT,
109 LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,NO, NO, NO,
110 NO, LALT, BTN1, LGUI
111 ),
112 // vi cusorkeys
113 KEYMAP(
114 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL,
115 CAPS,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, NO, NO, NO, NO,
116 LCTL,NO, NO, NO, NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT,
117 LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN1,
118 NO, LALT, SPC, LGUI
119 ),
120 // HHKB & WASD
121 KEYMAP(
122 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL,
123 CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,BRK, UP, NO, NO,
124 LCTL,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, ENT,
125 LSFT,END, NO, PGDN,NO, VOLD,VOLU,MUTE,END, PGDN,DOWN,
126 FN2, LALT, SPC, LGUI
101 ), 127 ),
102}; 128};
103 129