Changeset df6ded8 in mainline for uspace/drv/hid/usbhid/multimedia/multimedia.c
- Timestamp:
- 2018-02-28T16:37:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b20da0
- Parents:
- f5e5f73 (diff), b2dca8de (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. - git-author:
- Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
- git-committer:
- Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/hid/usbhid/multimedia/multimedia.c
rf5e5f73 rdf6ded8 2 2 * Copyright (c) 2011 Lubos Slovak 3 3 * Copyright (c) 2011 Vojtech Horky 4 * Copyright (c) 2018 Ondrej Hlavaty 4 5 * All rights reserved. 5 6 * … … 86 87 ipc_callid_t icallid, ipc_call_t *icall) 87 88 { 88 usb_log_debug(NAME " default_connection_handler() \n");89 usb_log_debug(NAME " default_connection_handler()"); 89 90 90 91 usb_multimedia_t *multim_dev = ddf_fun_data_get(fun); … … 95 96 if (multim_dev->console_sess == NULL) { 96 97 multim_dev->console_sess = sess; 97 usb_log_debug(NAME " Saved session to console: %p \n",98 usb_log_debug(NAME " Saved session to console: %p", 98 99 sess); 99 100 async_answer_0(icallid, EOK); … … 137 138 }; 138 139 139 usb_log_debug2(NAME " Sending key %d to the console \n", ev.key);140 usb_log_debug2(NAME " Sending key %d to the console", ev.key); 140 141 if (multim_dev->console_sess == NULL) { 141 142 usb_log_warning( … … 149 150 async_exchange_end(exch); 150 151 } else { 151 usb_log_warning("Failed to send multimedia key. \n");152 usb_log_warning("Failed to send multimedia key."); 152 153 } 153 154 } … … 159 160 } 160 161 161 usb_log_debug(NAME " Initializing HID/multimedia structure... \n");162 usb_log_debug(NAME " Initializing HID/multimedia structure..."); 162 163 163 164 /* Create the exposed function. */ … … 165 166 hid_dev->usb_dev, fun_exposed, NAME); 166 167 if (fun == NULL) { 167 usb_log_error("Could not create DDF function node. \n");168 usb_log_error("Could not create DDF function node."); 168 169 return ENOMEM; 169 170 } … … 184 185 errno_t rc = ddf_fun_bind(fun); 185 186 if (rc != EOK) { 186 usb_log_error("Could not bind DDF function: %s. \n",187 usb_log_error("Could not bind DDF function: %s.", 187 188 str_error(rc)); 188 189 ddf_fun_destroy(fun); … … 190 191 } 191 192 192 usb_log_debug(NAME " function created (handle: %" PRIun "). \n",193 usb_log_debug(NAME " function created (handle: %" PRIun ").", 193 194 ddf_fun_get_handle(fun)); 194 195 … … 199 200 str_error(rc)); 200 201 if (ddf_fun_unbind(fun) != EOK) { 201 usb_log_error("Failed to unbind %s, won't destroy. \n",202 usb_log_error("Failed to unbind %s, won't destroy.", 202 203 ddf_fun_get_name(fun)); 203 204 } else { … … 210 211 *data = fun; 211 212 212 usb_log_debug(NAME " HID/multimedia structure initialized. \n");213 usb_log_debug(NAME " HID/multimedia structure initialized."); 213 214 return EOK; 214 215 } … … 224 225 async_hangup(multim_dev->console_sess); 225 226 if (ddf_fun_unbind(fun) != EOK) { 226 usb_log_error("Failed to unbind %s, won't destroy. \n",227 usb_log_error("Failed to unbind %s, won't destroy.", 227 228 ddf_fun_get_name(fun)); 228 229 } else { 229 usb_log_debug2("%s unbound. \n", ddf_fun_get_name(fun));230 usb_log_debug2("%s unbound.", ddf_fun_get_name(fun)); 230 231 /* This frees multim_dev too as it was stored in 231 232 * fun->data */ … … 266 267 while (field != NULL) { 267 268 if (field->value != 0) { 268 usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X) \n",269 usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)", 269 270 field->value, field->usage); 270 271 const unsigned key = … … 272 273 const char *key_str = 273 274 usbhid_multimedia_usage_to_str(field->usage); 274 usb_log_info("Pressed key: %s \n", key_str);275 usb_log_info("Pressed key: %s", key_str); 275 276 usb_multimedia_push_ev(multim_dev, KEY_PRESS, key); 276 277 }
Note:
See TracChangeset
for help on using the changeset viewer.