Changeset 3e95cd7 in mainline
- Timestamp:
- 2011-05-26T15:57:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- aaa3d82b
- Parents:
- 3e6e2b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/multimedia/multimedia.c
r3e6e2b9 r3e95cd7 59 59 typedef struct usb_multimedia_t { 60 60 /** Previously pressed keys (not translated to key codes). */ 61 int32_t *keys_old;61 //int32_t *keys_old; 62 62 /** Currently pressed keys (not translated to key codes). */ 63 int32_t *keys;63 //int32_t *keys; 64 64 /** Count of stored keys (i.e. number of keys in the report). */ 65 size_t key_count;65 //size_t key_count; 66 66 /** IPC phone to the console device (for sending key events). */ 67 67 int console_phone; … … 175 175 176 176 // free all buffers 177 if ((*multim_dev)->keys != NULL) {178 free((*multim_dev)->keys);179 }180 if ((*multim_dev)->keys_old != NULL) {181 free((*multim_dev)->keys_old);182 }177 // if ((*multim_dev)->keys != NULL) { 178 // free((*multim_dev)->keys); 179 // } 180 // if ((*multim_dev)->keys_old != NULL) { 181 // free((*multim_dev)->keys_old); 182 // } 183 183 184 184 free(*multim_dev); … … 244 244 multim_dev->console_phone = -1; 245 245 246 usb_hid_report_path_t *path = usb_hid_report_path();247 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_CONSUMER, 0);248 249 usb_hid_report_path_set_report_id(path, 1);250 251 multim_dev->key_count = usb_hid_report_size(252 hid_dev->report, 1, USB_HID_REPORT_TYPE_INPUT);253 254 usb_hid_report_path_free(path);255 256 usb_log_debug(NAME " Size of the input report: %zu\n",257 multim_dev->key_count);258 259 multim_dev->keys = (int32_t *)calloc(multim_dev->key_count,260 sizeof(int32_t));261 262 if (multim_dev->keys == NULL) {263 usb_log_fatal("No memory!\n");264 free(multim_dev);265 return ENOMEM;266 }267 268 multim_dev->keys_old =269 (int32_t *)calloc(multim_dev->key_count, sizeof(int32_t));270 271 if (multim_dev->keys_old == NULL) {272 usb_log_fatal("No memory!\n");273 free(multim_dev->keys);274 free(multim_dev);275 return ENOMEM;276 }246 // usb_hid_report_path_t *path = usb_hid_report_path(); 247 // usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_CONSUMER, 0); 248 249 // usb_hid_report_path_set_report_id(path, 1); 250 251 // multim_dev->key_count = usb_hid_report_size( 252 // hid_dev->report, 1, USB_HID_REPORT_TYPE_INPUT); 253 254 // usb_hid_report_path_free(path); 255 256 // usb_log_debug(NAME " Size of the input report: %zu\n", 257 // multim_dev->key_count); 258 259 // multim_dev->keys = (int32_t *)calloc(multim_dev->key_count, 260 // sizeof(int32_t)); 261 262 // if (multim_dev->keys == NULL) { 263 // usb_log_fatal("No memory!\n"); 264 // free(multim_dev); 265 // return ENOMEM; 266 // } 267 268 // multim_dev->keys_old = 269 // (int32_t *)calloc(multim_dev->key_count, sizeof(int32_t)); 270 271 // if (multim_dev->keys_old == NULL) { 272 // usb_log_fatal("No memory!\n"); 273 // free(multim_dev->keys); 274 // free(multim_dev); 275 // return ENOMEM; 276 // } 277 277 278 278 /*! @todo Autorepeat */
Note:
See TracChangeset
for help on using the changeset viewer.