Changeset 24b07ac4 in mainline
- Timestamp:
- 2011-01-29T00:04:28Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b3258ad
- Parents:
- 5935fe4c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/uhci_struct/transfer_descriptor.c
r5935fe4c r24b07ac4 1 #include <stdio.h> 1 2 #include "transfer_descriptor.h" 3 4 #define BUFFER_LEN 10 5 6 static void buffer_to_str(char *str, size_t str_size, 7 uint8_t *buffer, size_t buffer_size) 8 { 9 if (buffer_size == 0) { 10 *str = 0; 11 return; 12 } 13 while (str_size >= 4) { 14 snprintf(str, 4, " %02X", (int) *buffer); 15 str += 3; 16 str_size -= 3; 17 buffer++; 18 buffer_size--; 19 if (buffer_size == 0) { 20 break; 21 } 22 } 23 } 2 24 3 25 void transfer_descriptor_init(transfer_descriptor_t *instance, … … 32 54 buffer, instance->buffer_ptr); 33 55 34 char * buff = buffer; 35 36 uhci_print_verbose("Buffer dump(8B): %x %x %x %x %x %x %x %x.\n", 37 buff[0], buff[1], buff[2], buff[3], buff[4], buff[5], buff[6], buff[7]); 56 char buffer_dump[BUFFER_LEN]; 57 buffer_to_str(buffer_dump, BUFFER_LEN, buffer, size); 58 uhci_print_verbose("Buffer dump (%zuB): %s.\n", size, buffer_dump); 38 59 39 60 instance->next_va = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.