aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-04-18 15:51:14 +0900
committertmk <nobody@nowhere>2013-04-18 15:52:23 +0900
commita77ae5f84312e295daabfdc46c79a627b84fee4f (patch)
treeda558b5f16f35f52ed6de6047fe547c4423b8fe2
parent1eb67303ee7b8a037d035e97ffd2d19b030fe3f2 (diff)
downloadqmk_firmware-a77ae5f84312e295daabfdc46c79a627b84fee4f.tar.gz
qmk_firmware-a77ae5f84312e295daabfdc46c79a627b84fee4f.zip
Add support of iWRAP5
- mouse virtical wheel - consumer page
-rw-r--r--keyboard/hhkb/Makefile.iwrap22
-rw-r--r--protocol/iwrap.mk18
-rw-r--r--protocol/iwrap/combo.desc1
-rw-r--r--protocol/iwrap/consumer.desc1
-rw-r--r--protocol/iwrap/iWRAP4.txt (renamed from protocol/iwrap/iWRAP.txt)0
-rw-r--r--protocol/iwrap/iWRAP5.txt345
-rw-r--r--protocol/iwrap/iwrap.c15
-rw-r--r--protocol/iwrap/keyboard.desc1
-rw-r--r--protocol/iwrap/main.c19
-rw-r--r--protocol/iwrap/mouse.desc1
-rw-r--r--protocol/vusb.mk6
11 files changed, 402 insertions, 27 deletions
diff --git a/keyboard/hhkb/Makefile.iwrap b/keyboard/hhkb/Makefile.iwrap
index 8d7f4fc66..2d9d82c48 100644
--- a/keyboard/hhkb/Makefile.iwrap
+++ b/keyboard/hhkb/Makefile.iwrap
@@ -29,8 +29,6 @@ OPT_DEFS = -DDEBUG_LEVEL=0
29# MCU name, you MUST set this to match the board you are using 29# MCU name, you MUST set this to match the board you are using
30# type "make clean" after changing this, so all files will be rebuilt 30# type "make clean" after changing this, so all files will be rebuilt
31MCU = atmega328p 31MCU = atmega328p
32# avrdude doesn't know atmega168p
33AVRDUDE_MCU = $(MCU)
34 32
35 33
36# Processor frequency. 34# Processor frequency.
@@ -41,6 +39,15 @@ AVRDUDE_MCU = $(MCU)
41F_CPU = 12000000 39F_CPU = 12000000
42 40
43 41
42# Boot Section Size in *bytes*
43# Teensy halfKay 512
44# Teensy++ halfKay 1024
45# Atmel DFU loader 4096
46# LUFA bootloader 4096
47# USBaspLoader 2048
48OPT_DEFS += -DBOOTLOADER_SIZE=2048
49
50
44# Build Options 51# Build Options
45# comment out to disable the options. 52# comment out to disable the options.
46# 53#
@@ -75,8 +82,8 @@ AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
75# to submit bug reports. 82# to submit bug reports.
76#AVRDUDE_VERBOSE = -v -v 83#AVRDUDE_VERBOSE = -v -v
77 84
78#AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) 85#AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
79AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -c $(AVRDUDE_PROGRAMMER) 86AVRDUDE_FLAGS = -p $(MCU) -c $(AVRDUDE_PROGRAMMER)
80AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) 87AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
81AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) 88AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
82AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) 89AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
@@ -89,9 +96,8 @@ PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE
89VPATH += $(TARGET_DIR) 96VPATH += $(TARGET_DIR)
90VPATH += $(TOP_DIR) 97VPATH += $(TOP_DIR)
91 98
92#include $(TOP_DIR)/protocol/iwrap.mk 99include $(TOP_DIR)/protocol/iwrap.mk
93# To be swatchable btween Bluetooth and USB. Comment out if you don't need USB. 100# TODO: to be selectable: V-USB, LUFA or PJRC
94include $(TOP_DIR)/protocol/vusb.mk 101#include $(TOP_DIR)/protocol/vusb.mk
95#include $(TOP_DIR)/protocol.mk
96include $(TOP_DIR)/common.mk 102include $(TOP_DIR)/common.mk
97include $(TOP_DIR)/rules.mk 103include $(TOP_DIR)/rules.mk
diff --git a/protocol/iwrap.mk b/protocol/iwrap.mk
index 96aa4140c..e1d0efe69 100644
--- a/protocol/iwrap.mk
+++ b/protocol/iwrap.mk
@@ -2,10 +2,22 @@ IWRAP_DIR = protocol/iwrap
2 2
3OPT_DEFS += -DPROTOCOL_IWRAP 3OPT_DEFS += -DPROTOCOL_IWRAP
4 4
5SRC += $(IWRAP_DIR)/iwrap.c \ 5SRC += $(IWRAP_DIR)/main.c \
6 $(IWRAP_DIR)/iwrap.c \
6 $(IWRAP_DIR)/suart.S \ 7 $(IWRAP_DIR)/suart.S \
7 $(IWRAP_DIR)/sendchar_uart.c \ 8 $(COMMON_DIR)/sendchar_uart.c \
8 $(IWRAP_DIR)/uart.c 9 $(COMMON_DIR)/uart.c
10
11# TODO: compatible with LUFA and PJRC
12# V-USB
13#
14#VUSB_DIR = protocol/vusb
15#OPT_DEFS += -DPROTOCOL_VUSB
16#SRC += $(VUSB_DIR)/vusb.c \
17# $(VUSB_DIR)/usbdrv/usbdrv.c \
18# $(VUSB_DIR)/usbdrv/usbdrvasm.S \
19# $(VUSB_DIR)/usbdrv/oddebug.c
20#VPATH += $(TOP_DIR)/protocol/vusb:$(TOP_DIR)/protocol/vusb/usbdrv
9 21
10 22
11# Search Path 23# Search Path
diff --git a/protocol/iwrap/combo.desc b/protocol/iwrap/combo.desc
new file mode 100644
index 000000000..572f99906
--- /dev/null
+++ b/protocol/iwrap/combo.desc
@@ -0,0 +1 @@
05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c005010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0050c0901a1018503050c1500250109e909ea09e209cd19b529b87501950881020a8a010a21020a2a021a23022a27027501950881020a83010a96010a92010a9e010a94010a060209b209b4750195088102c0
diff --git a/protocol/iwrap/consumer.desc b/protocol/iwrap/consumer.desc
new file mode 100644
index 000000000..d7f2217e8
--- /dev/null
+++ b/protocol/iwrap/consumer.desc
@@ -0,0 +1 @@
050c0901a1018503050c1500250109e909ea09e209cd19b529b87501950881020a8a010a21020a2a021a23022a27027501950881020a83010a96010a92010a9e010a94010a060209b209b4750195088102c0
diff --git a/protocol/iwrap/iWRAP.txt b/protocol/iwrap/iWRAP4.txt
index 2a062d9d9..2a062d9d9 100644
--- a/protocol/iwrap/iWRAP.txt
+++ b/protocol/iwrap/iWRAP4.txt
diff --git a/protocol/iwrap/iWRAP5.txt b/protocol/iwrap/iWRAP5.txt
new file mode 100644
index 000000000..e5ecc5c8e
--- /dev/null
+++ b/protocol/iwrap/iWRAP5.txt
@@ -0,0 +1,345 @@
1Terminology
2===========
3PSM
4HIDP HID Protocol
5L2CAP Logical Link Control Adaptation Protocol
6MTU Maximum Transmission Unit
7
8
9
10HID Protocol Messages
11=====================
123 of HID_SPEC_V11.pdf
13
14Control channel PSM=0x0011
15Interrupt channel PSM=0x0013
16
17HANDSHAKE(0)
18HID_CONTROL(1)
19GET_REPORT(4)
20-------------
21Host requests report(DATA payload on Control channel) from Device
22
23 Size Desc
24------------------------------------------------------------------------------
25HIDP-Hdr 1 7..4: HIDP Message TYpe(4: GET_REPORT)
26 3: Size(1:2-octed buffer size, 0:size of the report)
27 2: 0
28 1..0: Report Type(1:input, 2:output, 3: feature)
29ReportID 1 Optional
30BufferSize 2 Optional(specified when Size=1)
31
32SET_REPORT(5)
33GET_PROTOCOL(6)
34SET_PROTOCOL(7)
35DATA(A)
36-------
37Input/Output Report: All DATA payloads flow on Interrupt channel.
38Other: flows on Control channel.
39
40 Size Desc
41------------------------------------------------------------------------------
42HIDP-Hdr 1 7..4 0xA
43 3..2 Reserved(0)
44 1..0 Report Type(0:Other, 1:Input, 2:Output, 3:Feature)
45Payload N Data
46
47
48
49
50Boot Protocol
51=============
523.3.2
53No report descriptor, fixed report descriptors defined.
54
55Device ReportID Size
56---------------------------------
57Reserved 0
58Keyboard 1 9octets
59Mouse 2 4octets
60Reserved 3-255
61
62Report descriptor
63-----------------
64Report ID is added to USB HID boot protocol descriptor.
65Boot Protocol device doesn't need to supply descriptors. and can send extra data on end of boot report this data will be ignored unless host supports report descriptor.
66
67Report Protocol devices can have specific descriptors. Using Boot protocol descriptor followed by extra data may be useful for compatibility to Boot protocol only supported host.
68
69NOTE:
70Bluegiga HID sample say report ID of mouse is 1 but 2?
71Bluegiga HID sample say report ID of consumer page is 2 but 3?
72** mouse.desc and consumer.desc were fixed.
73 size
74keyboard.desc 67 0x43
75mouse.desc 60 0x3c
76consumer.desc 82 0x52
77combo.desc 209 0xd1
78
79
80
81SDP
82===
83attributes(3.3.2)
84----------
85HIDDeviceSubclass
86 which type is supported in Boot Protocol Mode
877 6
88---
890 1 Keyboard
901 0 Pointing device
911 1 Combo keyboard/pointing device
92
93HIDBootDevice
94 TRUE
95HIDReconnectInitiate
96 TRUE
97
98
99Class of Device/Service
100=======================
101http://phys.sci.hokudai.ac.jp/LABS/yts/pic/GB002/Bluetooth_assigned_numbers_baseband.pdf
102
1030x0005C0 Keyboard and Pointing deivce(combo)
104
105
10623 16 15 8 7 0
107---------------------------------
108Service |Major |Minor |Format
109
110Format type
1111 0
112---
1130 0
114
115Minor Device Class of Peripheral Major
1167 6
117---
1180 1 Keyboard
1191 0 Pointing device
1201 1 Combo keyboard/pointing device
121
122
123Major device classes
12412 11 10 9 8
125--------------
126 0 0 0 0 0 Miscellaneous
127 0 0 0 0 1 Computer
128 0 0 0 1 0 Phone
129 0 0 0 1 1 LAN /Network Access point
130 0 0 1 0 0 Audio/Video (headset,speaker,stereo, video display, vcr.....
131 0 0 1 0 1 *Peripheral (mouse, joystick, keyboards, ..... )
132 0 0 1 1 0 Imaging (printing, scanner, camera, display, ...)
133 1 1 1 1 1 Uncategorized, specific device code not specified
134 X X X X X All other values reserved
135
136
137Major service classes
138bit
139--------------------------------------
14013 Limited Discoverable Mode [Ref #1]
14114 (reserved)
14215 (reserved)
14316 Positioning (Location identification)
14417 Networking (LAN, Ad hoc, ...)
14518 Rendering (Printing, Speaker, ...)
14619 Capturing (Scanner, Microphone, ...)
14720 Object Transfer (v-Inbox, v-Folder, ...)
14821 Audio (Speaker, Microphone, Headset service, ...)
14922 Telephony (Cordless telephony, Modem, Headset service, ...)
15023 Information (WEB-server, WAP-server, ...)
151
152
153
154
155SET PROFILE HID 0d c0 100 0 en 0409 HHKB pro Bluetooth keyboard
156
157{function bit} uint8
158{subclass} uint8
159{version} uint16
160{country} uint8
161{BTlang} char[2]
162{USBlang} uint16
163{name} string
164
165
166SET PROFILE HID 0f c0 100 0 en 0409 TMK Bluetooth keyboard
167
168// composite device: keyboard and mouse
169SET BT CLASS 005c0
170
171
172
173Authentication SSP
174-------------------
175SET BT SSP 2 0 PASS KEY entering
176SET BT SSP 3 0 NO PASS KEY entering
177SET BT SSP <capabilities> <mitm>
178 <capabilities>: 0:display only 1:display+yes/no button 2:keyboard only 3:none
179SET BT SSP 2 1 # 2:keyboard only 1:Man-in-the-middle protection is needed
180SET BT SSP 2 0 # 2:keyboard only 0:Man-in-the-middle protection is not needed
181
182
183SET BT SSP 2 1
184 bond only if MITM protection is supported by host
185SET BT SSP 2 0
186 bond even if MITM protection is not supported by host
187
188On Windows 'Add device' causes SSP PASSKEY event on iWRAP
189 SSP PASSKEY 78:dd:08:b7:e4:a2 ?
190
191If device has display(0 or 1) this event occurs. User should be shown this code on the device.
192 SSP CONFIRM 78:dd:08:b7:e4:a2 517572
193
194
195SET BT SSP 3 0
196 No input/output, No MITM protection.
197 Without procedure of authentication the divice is bond to host.
198
199
200Connect
201=======
202CALL 78:dd:08:b7:e4:a2 11 HID
203
204
205Setting
206========
207SET BT PAIR *
208SET RESET
209
210SET BT CLASS 0005c0
211SET BT AUTH * 0000
212SET BT SSP 2 0
213SET CONTROL CONFIG 800
214SET PROFILE HID 0f c0 0100 00 en 0409 Bluetooth keyboard
215SET PROFILE SPP
216
217SET CONTROL INIT SET CONTROL MUX 0
218SET BT NAME TMK Blootooth WT12
219SET PROFILE HID 0f c0 0100 00 en 0409 TMK Bluetooth keyboard(WT12)
220SDP ADD 1124 HID
221SET BT PAIRCOUNT 4
222SET BT POWER 3 3 3
223SET BT SNIFF 100 20 1 8
224RESET
225
226SET CONTROL BAUD 38400,8n1
227
228# combo keyboard + mouse
229HID SET 7f 05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c005010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0
230
231HID SET d1 05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c005010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0050c0901a1018503050c1500250109e909ea09e209cd19b529b87501950881020a8a010a21020a2a021a23022a27027501950881020a83010a96010a92010a9e010a94010a060209b209b4750195088102c0
232
233
234---------------------
235SET BT BDADDR 00:07:80:47:22:14
236SET BT NAME TMK BT WT12
237SET BT CLASS 0005c0
238SET BT AUTH * 0000
239SET BT IDENT BT:47 f000 5.0.1 Bluegiga iWRAP
240SET BT LAP 9e8b33
241SET BT PAGEMODE 4 2000 1
242SET BT PAIRCOUNT 4
243SET BT PAIR 78:dd:08:b7:e4:a2 fe2fd79e86c6bbfa9351a032bceb2648
244SET BT POWER 3 3 3
245SET BT ROLE 1 f 12c0
246SET BT SNIFF 100 20 1 8
247SET BT SSP 3 0
248SET BT MTU 672
249SET CONTROL BAUD 38400,8n1
250SET CONTROL CD 00 0
251SET CONTROL ECHO 7
252SET CONTROL ESCAPE - 20 1
253SET CONTROL GAIN 0 5
254SET CONTROL INIT SET CONTROL MUX 0
255SET CONTROL MSC DTE 00 00 00 00 00 00
256SET CONTROL PIO 00 00
257SET CONTROL READY 00
258SET PROFILE HID 0f c0 0100 00 en 0409 TMK Bluetooth keyboard
259SET
260SET control config list
261SET CONTROL CONFIG 0000 0000 0000 410e CLOCK_CACHE INTERLACED_INQ INTERLACED_PAGE KLUDGE UART_LATENCY
262
263
264
265WRAP THOR AI (5.0.1 build 620)
266Copyright (c) 2003-2012 Bluegiga Technologies Inc.
267Compiled on Oct 1 2012 10:56:21, running on WT12-A module, psr v31
268 BGIO FTP HFP HFP_AG HID HID_CONSUMER_PAGE HSP MAP MDP OTA PBAP PIO=0x00fc SSP SUBRATE TEST VOLUME
269 - BOCK4 version 620 (Oct 1 2012 10:56:03) (max acl/sco 7/1)
270 - Bluetooth version 3.0, Power class 2
271 - Loader 8615, firmware 8825 (56-bit encryption), native execution mode
272 - up 0 days, 00:13, 0 connections (pool 1)
273 - User configuration:
274&028b = 0000 1388
275&028c = 0001 0020 0100 0001 0008 0000
276&028d = 0000
277&0295 = 0000 0005 000b 0000 0003 0000 0000 0000 0000 0000 0000
278&0298 = c006
279&0299 = 0000 0000
280&02a3 = 0030 0030 0030 0030
281&02a4 = 009d 0000
282&02a5 = 0053 0045 0054 0020 0043 004f 004e 0054 0052 004f 004c 0020 004d 0055 0058 0020 0030
283&02a7 = 0000 05c0
284&02a8 = 400e 0000 0000
285&02aa = 0004 2000 0001 0033 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
286&02ab = 0001 000f 12c0
287&02ac = 0000 0020 002b 0000 0000 0000 0000 0000 0000 0000 000a 0000 0000 0000 0004 0000 0000 0000 0000 02a0 0000 0000 0000 0000
288&02ad = 4d54 204b 5442 5720 3154 0032
289&02b0 = fa65 b0aa 934a 077b a600 d1cc fe58 8dd5
290&02b3 = 0004 0004 0004 0000 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 000d 0007 0005 8afb 0005 0000 1c13 0000 0c3d 0005 b435 0006 b450 0006 0000 1416 000d
291&02b7 = 000f 00c0 0100 0000 0065 006e 0409 4d54 204b 6c42 6575 6f74 746f 2068 656b 6279 616f 6472 0000
292---------------------
293
294
295----------
296after SET RESET
297----------
298WRAP THOR AI (5.0.1 build 620)
299Copyright (c) 2003-2012 Bluegiga Technologies Inc.
300READY.
301set
302SET BT BDADDR 00:07:80:47:22:14
303SET BT NAME WT12
304SET BT CLASS 001f00
305SET BT IDENT BT:47 f000 5.0.1 Bluegiga iWRAP
306SET BT LAP 9e8b33
307SET BT PAGEMODE 4 2000 1
308SET BT POWER 3 3 3
309SET BT ROLE 0 f 7d00
310SET BT SNIFF 0 20 1 8
311SET BT SSP 3 0
312SET BT MTU 667
313SET CONTROL BAUD 115200,8n1
314SET CONTROL CD 00 0
315SET CONTROL ECHO 7
316SET CONTROL ESCAPE 43 00 1
317SET CONTROL GAIN 0 5
318SET CONTROL MSC DTE 00 00 00 00 00 00
319SET CONTROL PIO 00 00
320SET CONTROL READY 00
321SET PROFILE SPP Bluetooth Serial Port
322SET
323
324
325SET CONTROL CONFIG 0000 0000 0000 0100 KLUDGE
326
327
328info config
329WRAP THOR AI (5.0.1 build 620)
330Copyright (c) 2003-2012 Bluegiga Technologies Inc.
331Compiled on Oct 1 2012 10:56:21, running on WT12-A module, psr v31
332 BGIO FTP HFP HFP_AG HID HID_CONSUMER_PAGE HSP MAP MDP OTA PBAP PIO=0x00fc SSP SUBRATE TEST VOLUME
333 - BOCK4 version 620 (Oct 1 2012 10:56:03) (max acl/sco 7/1)
334 - Bluetooth version 3.0, Power class 2
335 - Loader 8615, firmware 8825 (56-bit encryption), native execution mode
336 - up 0 days, 00:00, 0 connections (pool 1)
337 - User configuration:
338&0295 = 0000 0005 000b 0000 0003 0000 0000 0000 0000 0000 0000
339&0299 = 0000 0000
340&02aa = 0004 2000 0001 0033 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
341&02ac = 0000 0000 002b 0000 0000 0000 0000 0000 0000 0000 0002 0000 0000 0000 0010 0000 0000 0000 0000 029b 0000 0000 0000 0000
342&02ad = 5457 3231
343&02b0 = fa65 b0aa 934a 077b a600 d1cc fe58 8dd5
344READY.
345----------
diff --git a/protocol/iwrap/iwrap.c b/protocol/iwrap/iwrap.c
index 3cc9ca306..d65d9e38e 100644
--- a/protocol/iwrap/iwrap.c
+++ b/protocol/iwrap/iwrap.c
@@ -334,7 +334,7 @@ static void send_keyboard(report_keyboard_t *report)
334 // HID raw mode header 334 // HID raw mode header
335 xmit(0x9f); 335 xmit(0x9f);
336 xmit(0x0a); // Length 336 xmit(0x0a); // Length
337 xmit(0xa1); // keyboard report 337 xmit(0xa1); // DATA(Input)
338 xmit(0x01); 338 xmit(0x01);
339 xmit(report->mods); 339 xmit(report->mods);
340 xmit(0x00); // reserved byte(always 0) 340 xmit(0x00); // reserved byte(always 0)
@@ -355,9 +355,16 @@ static void send_mouse(report_mouse_t *report)
355 // HID raw mode header 355 // HID raw mode header
356 xmit(0x9f); 356 xmit(0x9f);
357 xmit(0x05); // Length 357 xmit(0x05); // Length
358 xmit(0xa1); // mouse report 358 xmit(0xa1); // DATA(Input)
359 xmit(0x02); 359 xmit(0x02);
360 xmit(report->buttons); 360 /* vertical wheel support */
361 int8_t wheel = report->v;
362 if (wheel < -15) {
363 wheel = -15;
364 } else if (wheel > 15) {
365 wheel = 15;
366 }
367 xmit(((wheel&0x1f)<<3) | (report->buttons&0x07));
361 xmit(report->x); 368 xmit(report->x);
362 xmit(report->y); 369 xmit(report->y);
363 MUX_FOOTER(0x01); 370 MUX_FOOTER(0x01);
@@ -457,7 +464,7 @@ static void send_consumer(uint16_t data)
457 MUX_HEADER(0x01, 0x07); 464 MUX_HEADER(0x01, 0x07);
458 xmit(0x9f); 465 xmit(0x9f);
459 xmit(0x05); // Length 466 xmit(0x05); // Length
460 xmit(0xa1); // consumer report 467 xmit(0xa1); // DATA(Input)
461 xmit(0x03); 468 xmit(0x03);
462 xmit(bits1); 469 xmit(bits1);
463 xmit(bits2); 470 xmit(bits2);
diff --git a/protocol/iwrap/keyboard.desc b/protocol/iwrap/keyboard.desc
new file mode 100644
index 000000000..d9e7a4c5a
--- /dev/null
+++ b/protocol/iwrap/keyboard.desc
@@ -0,0 +1 @@
05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c0
diff --git a/protocol/iwrap/main.c b/protocol/iwrap/main.c
index ac83280f1..3abdce8df 100644
--- a/protocol/iwrap/main.c
+++ b/protocol/iwrap/main.c
@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
25#include "keyboard.h" 25#include "keyboard.h"
26#include "matrix.h" 26#include "matrix.h"
27#include "host.h" 27#include "host.h"
28#include "action.h"
28#include "iwrap.h" 29#include "iwrap.h"
29#ifdef PROTOCOL_VUSB 30#ifdef PROTOCOL_VUSB
30# include "vusb.h" 31# include "vusb.h"
@@ -40,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
40 41
41static void sleep(uint8_t term); 42static void sleep(uint8_t term);
42static bool console(void); 43static bool console(void);
43static uint8_t console_command(uint8_t c); 44static bool console_command(uint8_t c);
44static uint8_t key2asc(uint8_t key); 45static uint8_t key2asc(uint8_t key);
45 46
46 47
@@ -108,10 +109,13 @@ static void init_vusb(void)
108 109
109void change_driver(host_driver_t *driver) 110void change_driver(host_driver_t *driver)
110{ 111{
112 /*
111 host_clear_keyboard_report(); 113 host_clear_keyboard_report();
112 host_swap_keyboard_report(); 114 host_swap_keyboard_report();
113 host_clear_keyboard_report(); 115 host_clear_keyboard_report();
114 host_send_keyboard_report(); 116 host_send_keyboard_report();
117 */
118 clear_keyboard();
115 _delay_ms(1000); 119 _delay_ms(1000);
116 host_set_driver(driver); 120 host_set_driver(driver);
117} 121}
@@ -168,6 +172,7 @@ int main(void)
168 if (host_get_driver() == vusb_driver()) 172 if (host_get_driver() == vusb_driver())
169 vusb_transfer_keyboard(); 173 vusb_transfer_keyboard();
170#endif 174#endif
175 // TODO: depricated
171 if (matrix_is_modified() || console()) { 176 if (matrix_is_modified() || console()) {
172 last_timer = timer_read(); 177 last_timer = timer_read();
173 sleeping = false; 178 sleeping = false;
@@ -176,6 +181,7 @@ int main(void)
176 iwrap_check_connection(); 181 iwrap_check_connection();
177 } 182 }
178 183
184 // TODO: suspend.h
179 if (host_get_driver() == iwrap_driver()) { 185 if (host_get_driver() == iwrap_driver()) {
180 if (sleeping && !insomniac) { 186 if (sleeping && !insomniac) {
181 _delay_ms(1); // wait for UART to send 187 _delay_ms(1); // wait for UART to send
@@ -201,11 +207,6 @@ static void sleep(uint8_t term)
201 WD_SET(WD_OFF); 207 WD_SET(WD_OFF);
202} 208}
203 209
204ISR(WDT_vect)
205{
206 // wake up
207}
208
209static bool console(void) 210static bool console(void)
210{ 211{
211 // Send to Bluetoot module WT12 212 // Send to Bluetoot module WT12
@@ -244,12 +245,12 @@ static bool console(void)
244 } 245 }
245} 246}
246 247
247uint8_t command_extra() 248bool command_extra(uint8_t code)
248{ 249{
249 return console_command(key2asc(host_get_first_key())); 250 return console_command(key2asc(code));
250} 251}
251 252
252static uint8_t console_command(uint8_t c) 253static bool console_command(uint8_t c)
253{ 254{
254 switch (c) { 255 switch (c) {
255 case 'h': 256 case 'h':
diff --git a/protocol/iwrap/mouse.desc b/protocol/iwrap/mouse.desc
new file mode 100644
index 000000000..f2c432500
--- /dev/null
+++ b/protocol/iwrap/mouse.desc
@@ -0,0 +1 @@
05010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0
diff --git a/protocol/vusb.mk b/protocol/vusb.mk
index 77b1c6337..3227ca7bf 100644
--- a/protocol/vusb.mk
+++ b/protocol/vusb.mk
@@ -10,10 +10,10 @@ SRC += $(VUSB_DIR)/main.c \
10 10
11 11
12ifdef NO_UART 12ifdef NO_UART
13SRC += sendchar_null.c 13SRC += $(COMMON_DIR)/sendchar_null.c
14else 14else
15SRC += sendchar_uart.c \ 15SRC += $(COMMON_DIR)/sendchar_uart.c \
16 uart.c 16 $(COMMON_DIR)/uart.c
17endif 17endif
18 18
19 19