Changeset 0a9ea4a in mainline for uspace/drv/usbkbd/main.c
- Timestamp:
- 2011-01-14T14:28:57Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d7a74e, 6336b6e
- Parents:
- 45019865 (diff), 2f60e57d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbkbd/main.c
r45019865 r0a9ea4a 90 90 * Callbacks for parser 91 91 */ 92 static void usbkbd_process_keycodes(const uint 16_t *key_codes, size_t count,93 void *arg)92 static void usbkbd_process_keycodes(const uint8_t *key_codes, size_t count, 93 uint8_t modifiers, void *arg) 94 94 { 95 95 printf("Got keys: "); … … 190 190 191 191 usbkbd_print_config(kbd_dev->conf); 192 193 /* 194 * TODO: 195 * 1) select one configuration (lets say the first) 196 * 2) how many interfaces?? how to select one?? 197 * ("The default setting for an interface is always alternate setting zero.") 198 * 3) find endpoint which is IN and INTERRUPT (parse), save its number 199 * as the endpoint for polling 200 */ 192 201 193 202 return EOK; … … 208 217 // get phone to my HC and save it as my parent's phone 209 218 // TODO: maybe not a good idea if DDF will use parent_phone 210 kbd_dev->device->parent_phone = usb_drv_hc_connect_auto(dev, 0); 211 212 kbd_dev->address = usb_drv_get_my_address(dev->parent_phone, 213 dev); 219 int rc = kbd_dev->device->parent_phone = usb_drv_hc_connect_auto(dev, 0); 220 if (rc < 0) { 221 printf("Problem setting phone to HC.\n"); 222 free(kbd_dev); 223 return NULL; 224 } 225 226 rc = kbd_dev->address = usb_drv_get_my_address(dev->parent_phone, dev); 227 if (rc < 0) { 228 printf("Problem getting address of the device.\n"); 229 free(kbd_dev); 230 return NULL; 231 } 214 232 215 233 // doesn't matter now that we have no address … … 239 257 uint8_t *buffer, size_t actual_size) 240 258 { 241 /*242 * here, the parser will be called, probably with some callbacks243 * now only take last 6 bytes and process, i.e. send to kbd244 */245 246 259 usb_hid_report_in_callbacks_t *callbacks = 247 260 (usb_hid_report_in_callbacks_t *)malloc( … … 249 262 callbacks->keyboard = usbkbd_process_keycodes; 250 263 251 usb_hid_parse_report(kbd_dev->parser, buffer, actual_size, callbacks, 252 NULL); 264 //usb_hid_parse_report(kbd_dev->parser, buffer, actual_size, callbacks, 265 // NULL); 266 printf("Calling usb_hid_boot_keyboard_input_report()...\n)"); 267 usb_hid_boot_keyboard_input_report(buffer, actual_size, callbacks, NULL); 253 268 } 254 269
Note:
See TracChangeset
for help on using the changeset viewer.