Changeset 18b6a88 in mainline for uspace/drv/hid
- Timestamp:
- 2018-04-15T09:35:04Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1f44ca
- Parents:
- 8ebe212
- Location:
- uspace/drv/hid/usbhid
- Files:
-
- 3 edited
-
kbd/kbddev.c (modified) (9 diffs)
-
mouse/mousedev.c (modified) (4 diffs)
-
multimedia/multimedia.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/hid/usbhid/kbd/kbddev.c
r8ebe212 r18b6a88 191 191 } else { 192 192 usb_log_error("%s: console session already set", 193 __FUNCTION__);193 __FUNCTION__); 194 194 async_answer_0(icall_handle, ELIMIT); 195 195 } 196 196 break; 197 197 default: 198 usb_log_error("%s: Unknown method: %d.",199 __FUNCTION__, (int) method);200 async_answer_0(icall_handle, EINVAL);201 break;198 usb_log_error("%s: Unknown method: %d.", 199 __FUNCTION__, (int) method); 200 async_answer_0(icall_handle, EINVAL); 201 break; 202 202 } 203 203 … … 236 236 while (field != NULL) { 237 237 238 if ((field->usage == USB_HID_LED_NUM_LOCK) 239 && (kbd_dev->mods & KM_NUM_LOCK)){238 if ((field->usage == USB_HID_LED_NUM_LOCK) && 239 (kbd_dev->mods & KM_NUM_LOCK)) { 240 240 field->value = 1; 241 241 } 242 242 243 if ((field->usage == USB_HID_LED_CAPS_LOCK) 244 && (kbd_dev->mods & KM_CAPS_LOCK)){243 if ((field->usage == USB_HID_LED_CAPS_LOCK) && 244 (kbd_dev->mods & KM_CAPS_LOCK)) { 245 245 field->value = 1; 246 246 } 247 247 248 if ((field->usage == USB_HID_LED_SCROLL_LOCK) 249 && (kbd_dev->mods & KM_SCROLL_LOCK)){248 if ((field->usage == USB_HID_LED_SCROLL_LOCK) && 249 (kbd_dev->mods & KM_SCROLL_LOCK)) { 250 250 field->value = 1; 251 251 } … … 253 253 field = usb_hid_report_get_sibling( 254 254 &hid_dev->report, field, kbd_dev->led_path, 255 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,255 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 256 256 USB_HID_REPORT_TYPE_OUTPUT); 257 257 } … … 269 269 usb_log_debug("Output report buffer: %s", 270 270 usb_debug_str_buffer(kbd_dev->output_buffer, kbd_dev->output_size, 271 0));271 0)); 272 272 273 273 rc = usbhid_req_set_report( … … 308 308 static inline int usb_kbd_is_lock(unsigned int key_code) 309 309 { 310 return (key_code == KC_NUM_LOCK 311 || key_code == KC_SCROLL_LOCK312 ||key_code == KC_CAPS_LOCK);310 return (key_code == KC_NUM_LOCK || 311 key_code == KC_SCROLL_LOCK || 312 key_code == KC_CAPS_LOCK); 313 313 } 314 314 … … 437 437 438 438 errno_t ret = 439 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);439 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 440 440 if (ret != EOK) { 441 441 usb_log_error("Failed to append to hid/kbd report path."); … … 461 461 if (field->value != 0) { 462 462 kbd_dev->keys[i] = field->usage; 463 } 464 else { 463 } else { 465 464 kbd_dev->keys[i] = 0; 466 465 } … … 469 468 ++i; 470 469 field = usb_hid_report_get_sibling( 471 &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END 472 |USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,470 &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END | 471 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 473 472 USB_HID_REPORT_TYPE_INPUT); 474 473 } … … 742 741 // FIXME - the fibril_mutex_is_locked may not cause 743 742 // fibril scheduling 744 while (fibril_mutex_is_locked(&kbd_dev->repeat_mtx)) {} 743 while (fibril_mutex_is_locked(&kbd_dev->repeat_mtx)) { 744 } 745 745 746 746 /* Free all buffers. */ -
uspace/drv/hid/usbhid/mouse/mousedev.c
r8ebe212 r18b6a88 184 184 hid_dev->report_id, &hid_dev->report, 185 185 USB_HIDUT_USAGE_GENERIC_DESKTOP_Y); 186 const usb_hid_report_field_t *wheel = get_mouse_axis_move_field(186 const usb_hid_report_field_t *wheel = get_mouse_axis_move_field( 187 187 hid_dev->report_id, &hid_dev->report, 188 188 USB_HIDUT_USAGE_GENERIC_DESKTOP_WHEEL); … … 232 232 } 233 233 errno_t ret = 234 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_BUTTON, 0);234 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_BUTTON, 0); 235 235 if (ret != EOK) { 236 236 usb_hid_report_path_free(path); … … 241 241 242 242 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 243 &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END 244 |USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT);243 &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END | 244 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT); 245 245 246 246 while (field != NULL) { … … 263 263 264 264 field = usb_hid_report_get_sibling( 265 &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END 266 |USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,265 &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END | 266 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 267 267 USB_HID_REPORT_TYPE_INPUT); 268 268 } -
uspace/drv/hid/usbhid/multimedia/multimedia.c
r8ebe212 r18b6a88 260 260 261 261 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 262 &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END 263 |USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,262 &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END | 263 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 264 264 USB_HID_REPORT_TYPE_INPUT); 265 265 … … 279 279 280 280 field = usb_hid_report_get_sibling( 281 &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END 282 |USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,281 &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END | 282 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 283 283 USB_HID_REPORT_TYPE_INPUT); 284 284 }
Note:
See TracChangeset
for help on using the changeset viewer.
