Changeset 48ae3ef in mainline for uspace/lib/usbhost/src/endpoint.c
- Timestamp:
- 2011-10-28T21:52:15Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 57e06ef
- Parents:
- 7265558
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/endpoint.c
r7265558 r48ae3ef 54 54 instance->toggle = 0; 55 55 instance->active = false; 56 instance->destroy_hook = NULL;57 56 instance->hc_data.data = NULL; 58 57 instance->hc_data.toggle_get = NULL; … … 70 69 assert(instance); 71 70 assert(!instance->active); 72 if (instance->hc_data.data) { 73 assert(instance->destroy_hook); 74 instance->destroy_hook(instance); 75 } 71 assert(instance->hc_data.data == NULL); 76 72 free(instance); 77 73 } 78 74 /*----------------------------------------------------------------------------*/ 79 75 void endpoint_set_hc_data(endpoint_t *instance, 80 void *data, void (*destroy_hook)(endpoint_t *), 81 int (*toggle_get)(void *), void (*toggle_set)(void *, int)) 76 void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int)) 82 77 { 83 78 assert(instance); 84 instance->destroy_hook = destroy_hook;85 79 instance->hc_data.data = data; 86 80 instance->hc_data.toggle_get = toggle_get; … … 91 85 { 92 86 assert(instance); 93 instance->destroy_hook = NULL;94 87 instance->hc_data.data = NULL; 95 88 instance->hc_data.toggle_get = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.