Ignore:
Timestamp:
2011-05-30T19:20:58Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63862a0
Parents:
8c74d15 (diff), 19e0560e (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.
Message:

Removed some disabled code and TODOs. Final merge of HID driver!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/multimedia/multimedia.c

    r8c74d15 r173922f  
    143143        assert(multim_dev != NULL);
    144144       
    145 //      usb_multimedia_t *multim_dev = (usb_multimedia_t *)hid_dev->data;
    146        
    147145        console_event_t ev;
    148146       
     
    173171        // hangup phone to the console
    174172        async_hangup((*multim_dev)->console_phone);
    175        
    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 //      }
    183173
    184174        free(*multim_dev);
     
    245235        multim_dev->console_phone = -1;
    246236       
    247 //      usb_hid_report_path_t *path = usb_hid_report_path();
    248 //      usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_CONSUMER, 0);
    249        
    250 //      usb_hid_report_path_set_report_id(path, 1);
    251        
    252 //      multim_dev->key_count = usb_hid_report_size(
    253 //          hid_dev->report, 1, USB_HID_REPORT_TYPE_INPUT);
    254 
    255 //      usb_hid_report_path_free(path);
    256        
    257 //      usb_log_debug(NAME " Size of the input report: %zu\n",
    258 //          multim_dev->key_count);
    259        
    260 //      multim_dev->keys = (int32_t *)calloc(multim_dev->key_count,
    261 //          sizeof(int32_t));
    262        
    263 //      if (multim_dev->keys == NULL) {
    264 //              usb_log_fatal("No memory!\n");
    265 //              free(multim_dev);
    266 //              return ENOMEM;
    267 //      }
    268        
    269 //      multim_dev->keys_old =
    270 //              (int32_t *)calloc(multim_dev->key_count, sizeof(int32_t));
    271        
    272 //      if (multim_dev->keys_old == NULL) {
    273 //              usb_log_fatal("No memory!\n");
    274 //              free(multim_dev->keys);
    275 //              free(multim_dev);
    276 //              return ENOMEM;
    277 //      }
    278        
    279237        /*! @todo Autorepeat */
    280238       
     
    315273{
    316274        // TODO: checks
     275        if (hid_dev == NULL || data == NULL || buffer == NULL) {
     276                return false;
     277        }
    317278       
    318279        usb_log_debug(NAME " usb_lgtch_polling_callback(%p, %p, %zu)\n",
    319280            hid_dev, buffer, buffer_size);
    320        
    321         if (data == NULL) {
    322                 return EINVAL;  // TODO: other error code?
    323         }
    324281       
    325282        usb_multimedia_t *multim_dev = (usb_multimedia_t *)data;
     
    348305            | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    349306            USB_HID_REPORT_TYPE_INPUT);
    350        
    351 //      unsigned int key;
    352        
     307
    353308        /*! @todo Is this iterating OK if done multiple times?
    354309         *  @todo The parsing is not OK
Note: See TracChangeset for help on using the changeset viewer.