Ignore:
Timestamp:
2011-11-09T14:55:04Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
747ef72
Parents:
f317490
Message:

usbhid: Comment and whitespace fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/kbd/kbddev.c

    rf317490 r2d1ba51  
    103103/*----------------------------------------------------------------------------*/
    104104static const uint8_t USB_KBD_BOOT_REPORT_DESCRIPTOR[] = {
    105         0x05, 0x01,  // Usage Page (Generic Desktop),
    106         0x09, 0x06,  // Usage (Keyboard),
    107         0xA1, 0x01,  // Collection (Application),
    108         0x75, 0x01,  //   Report Size (1),
    109         0x95, 0x08,  //   Report Count (8),
    110         0x05, 0x07,  //   Usage Page (Key Codes);
    111         0x19, 0xE0,  //   Usage Minimum (224),
    112         0x29, 0xE7,  //   Usage Maximum (231),
    113         0x15, 0x00,  //   Logical Minimum (0),
    114         0x25, 0x01,  //   Logical Maximum (1),
    115         0x81, 0x02,  //   Input (Data, Variable, Absolute),   ; Modifier byte
    116         0x95, 0x01,  //   Report Count (1),
    117         0x75, 0x08,  //   Report Size (8),
    118         0x81, 0x01,  //   Input (Constant),                   ; Reserved byte
    119         0x95, 0x05,  //   Report Count (5),
    120         0x75, 0x01,  //   Report Size (1),
    121         0x05, 0x08,  //   Usage Page (Page# for LEDs),
    122         0x19, 0x01,  //   Usage Minimum (1),
    123         0x29, 0x05,  //   Usage Maxmimum (5),
    124         0x91, 0x02,  //   Output (Data, Variable, Absolute),  ; LED report
    125         0x95, 0x01,  //   Report Count (1),
    126         0x75, 0x03,  //   Report Size (3),
    127         0x91, 0x01,  //   Output (Constant),              ; LED report padding
    128         0x95, 0x06,  //   Report Count (6),
    129         0x75, 0x08,  //   Report Size (8),
    130         0x15, 0x00,  //   Logical Minimum (0),
    131         0x25, 0xff,  //   Logical Maximum (255),
    132         0x05, 0x07,  //   Usage Page (Key Codes),
    133         0x19, 0x00,  //   Usage Minimum (0),
    134         0x29, 0xff,  //   Usage Maximum (255),
    135         0x81, 0x00,  //   Input (Data, Array),            ; Key arrays (6 bytes)
    136         0xC0           // End Collection
    137 
     105        0x05, 0x01,  /* Usage Page (Generic Desktop), */
     106        0x09, 0x06,  /* Usage (Keyboard), */
     107        0xA1, 0x01,  /* Collection (Application), */
     108        0x75, 0x01,  /*   Report Size (1), */
     109        0x95, 0x08,  /*   Report Count (8), */
     110        0x05, 0x07,  /*   Usage Page (Key Codes); */
     111        0x19, 0xE0,  /*   Usage Minimum (224), */
     112        0x29, 0xE7,  /*   Usage Maximum (231), */
     113        0x15, 0x00,  /*   Logical Minimum (0), */
     114        0x25, 0x01,  /*   Logical Maximum (1), */
     115        0x81, 0x02,  /*   Input (Data, Variable, Absolute),  ; Modifier byte */
     116        0x95, 0x01,  /*   Report Count (1), */
     117        0x75, 0x08,  /*   Report Size (8), */
     118        0x81, 0x01,  /*   Input (Constant),                  ; Reserved byte */
     119        0x95, 0x05,  /*   Report Count (5), */
     120        0x75, 0x01,  /*   Report Size (1), */
     121        0x05, 0x08,  /*   Usage Page (Page# for LEDs), */
     122        0x19, 0x01,  /*   Usage Minimum (1), */
     123        0x29, 0x05,  /*   Usage Maxmimum (5), */
     124        0x91, 0x02,  /*   Output (Data, Variable, Absolute),  ; LED report */
     125        0x95, 0x01,  /*   Report Count (1), */
     126        0x75, 0x03,  /*   Report Size (3), */
     127        0x91, 0x01,  /*   Output (Constant),            ; LED report padding */
     128        0x95, 0x06,  /*   Report Count (6), */
     129        0x75, 0x08,  /*   Report Size (8), */
     130        0x15, 0x00,  /*   Logical Minimum (0), */
     131        0x25, 0xff,  /*   Logical Maximum (255), */
     132        0x05, 0x07,  /*   Usage Page (Key Codes), */
     133        0x19, 0x00,  /*   Usage Minimum (0), */
     134        0x29, 0xff,  /*   Usage Maximum (255), */
     135        0x81, 0x00,  /*   Input (Data, Array),   ; Key arrays (6 bytes) */
     136        0xC0         /* End Collection */
    138137};
    139138/*----------------------------------------------------------------------------*/
     
    207206
    208207}
    209 
    210208/*----------------------------------------------------------------------------*/
    211209/* Key processing functions                                                   */
     
    448446        usb_hid_report_path_set_report_id(path, hid_dev->report_id);
    449447
    450         // fill in the currently pressed keys
    451 
     448        /* Fill in the currently pressed keys. */
    452449        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    453450            &hid_dev->report, NULL, path,
     
    462459                assert(i < kbd_dev->key_count);
    463460
    464                 // save the key usage
     461                /* Save the key usage. */
    465462                if (field->value != 0) {
    466463                        kbd_dev->keys[i] = field->usage;
     
    500497        }
    501498
    502         /*
    503          * Store the initialized HID device and HID ops
    504          * to the DDF function.
    505          */
     499        /* Store the initialized HID device and HID ops
     500         * to the DDF function. */
    506501        fun->ops = &kbd_dev->ops;
    507502        fun->driver_data = kbd_dev;
     
    511506                usb_log_error("Could not bind DDF function: %s.\n",
    512507                    str_error(rc));
    513                 fun->driver_data = NULL; /* We need this later */
     508                fun->driver_data = NULL; /* We did not allocate this. */
    514509                ddf_fun_destroy(fun);
    515510                return rc;
     
    527522                    HID_KBD_CLASS_NAME, str_error(rc));
    528523                if (ddf_fun_unbind(fun) == EOK) {
    529                         fun->driver_data = NULL; /* We need this later */
     524                        fun->driver_data = NULL; /* We did not allocate this. */
    530525                        ddf_fun_destroy(fun);
    531526                } else {
     
    674669        }
    675670
    676         /*
    677          * Set LEDs according to initial setup.
    678          * Set Idle rate
    679          */
     671        /* Set LEDs according to initial setup.
     672         * Set Idle rate */
    680673        usb_kbd_set_led(hid_dev, kbd_dev);
    681674
     
    779772                if (usb_kbd_is_initialized(kbd_dev)) {
    780773                        kbd_dev->initialized = USB_KBD_STATUS_TO_DESTROY;
    781                         /* wait for autorepeat */
     774                        /* Wait for autorepeat */
    782775                        async_usleep(CHECK_DELAY);
    783776                }
Note: See TracChangeset for help on using the changeset viewer.