Ignore:
Timestamp:
2011-05-27T13:27:22Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0c904a3
Parents:
8242dd86 (diff), 567a3e2 (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:

Development changes

File:
1 edited

Legend:

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

    r8242dd86 re56b8a3  
    4343#include <usb/debug.h>
    4444#include <usb/hid/usages/core.h>
     45#include <usb/hid/usages/consumer.h>
    4546
    4647#include <errno.h>
     
    5859typedef struct usb_multimedia_t {
    5960        /** Previously pressed keys (not translated to key codes). */
    60         int32_t *keys_old;
     61        //int32_t *keys_old;
    6162        /** Currently pressed keys (not translated to key codes). */
    62         int32_t *keys;
     63        //int32_t *keys;
    6364        /** Count of stored keys (i.e. number of keys in the report). */
    64         size_t key_count;       
     65        //size_t key_count;     
    6566        /** IPC phone to the console device (for sending key events). */
    6667        int console_phone;
     
    174175       
    175176        // free all buffers
    176         if ((*multim_dev)->keys != NULL) {
    177                 free((*multim_dev)->keys);
    178         }
    179         if ((*multim_dev)->keys_old != NULL) {
    180                 free((*multim_dev)->keys_old);
    181         }
     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//      }
    182183
    183184        free(*multim_dev);
     
    209210                return rc;
    210211        }
     212       
     213        usb_log_debug("%s function created. Handle: %d\n", NAME, fun->handle);
    211214       
    212215        rc = ddf_fun_add_to_class(fun, "keyboard");
     
    241244        multim_dev->console_phone = -1;
    242245       
    243         usb_hid_report_path_t *path = usb_hid_report_path();
    244         usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_CONSUMER, 0);
    245        
    246         usb_hid_report_path_set_report_id(path, 1);
    247        
    248         multim_dev->key_count = usb_hid_report_size(
    249             hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
    250 
    251         usb_hid_report_path_free(path);
    252        
    253         usb_log_debug(NAME " Size of the input report: %zu\n",
    254             multim_dev->key_count);
    255        
    256         multim_dev->keys = (int32_t *)calloc(multim_dev->key_count,
    257             sizeof(int32_t));
    258        
    259         if (multim_dev->keys == NULL) {
    260                 usb_log_fatal("No memory!\n");
    261                 free(multim_dev);
    262                 return ENOMEM;
    263         }
    264        
    265         multim_dev->keys_old =
    266                 (int32_t *)calloc(multim_dev->key_count, sizeof(int32_t));
    267        
    268         if (multim_dev->keys_old == NULL) {
    269                 usb_log_fatal("No memory!\n");
    270                 free(multim_dev->keys);
    271                 free(multim_dev);
    272                 return ENOMEM;
    273         }
     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//      }
    274277       
    275278        /*! @todo Autorepeat */
     
    357360                            usb_multimedia_map_usage(field->usage);
    358361                        const char *key_str =
    359                             usb_multimedia_usage_to_str(field->usage);
     362                            usbhid_multimedia_usage_to_str(field->usage);
    360363                        usb_log_info("Pressed key: %s\n", key_str);
    361364                        usb_multimedia_push_ev(hid_dev, multim_dev, KEY_PRESS,
Note: See TracChangeset for help on using the changeset viewer.