Changeset 890961a in mainline for uspace/app/vuhid/ifaces.h
- Timestamp:
- 2011-04-29T12:37:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e67399e
- Parents:
- b20de1d (diff), 9d05599 (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vuhid/ifaces.h
rb20de1d r890961a 1 1 /* 2 * Copyright (c) 201 0Vojtech Horky2 * Copyright (c) 2011 Vojtech Horky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libusbvirt29 /** @addtogroup usbvirthid 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @brief Debugging support.33 * 34 34 */ 35 #i nclude <stdio.h>36 # include <bool.h>35 #ifndef VUHID_IFACES_H_ 36 #define VUHID_IFACES_H_ 37 37 38 #include " private.h"38 #include "virthid.h" 39 39 40 extern vuhid_interface_t *available_hid_interfaces[]; 40 41 41 static void debug_print(int level, uint8_t tag, 42 int current_level, uint8_t enabled_tags, 43 const char *format, va_list args) 44 { 45 if (level > current_level) { 46 return; 47 } 48 49 if ((tag & enabled_tags) == 0) { 50 return; 51 } 52 53 bool print_prefix = true; 54 55 if ((format[0] == '%') && (format[1] == 'M')) { 56 format += 2; 57 print_prefix = false; 58 } 59 60 if (print_prefix) { 61 printf("[vusb]: "); 62 while (--level > 0) { 63 printf(" "); 64 } 65 } 66 67 vprintf(format, args); 68 69 if (print_prefix) { 70 printf("\n"); 71 } 72 } 73 74 75 void user_debug(usbvirt_device_t *device, int level, uint8_t tag, 76 const char *format, ...) 77 { 78 va_list args; 79 va_start(args, format); 80 81 debug_print(level, tag, 82 device->debug_level, device->debug_enabled_tags, 83 format, args); 84 85 va_end(args); 86 } 87 88 void lib_debug(usbvirt_device_t *device, int level, uint8_t tag, 89 const char *format, ...) 90 { 91 va_list args; 92 va_start(args, format); 93 94 debug_print(level, tag, 95 device->lib_debug_level, device->lib_debug_enabled_tags, 96 format, args); 97 98 va_end(args); 99 } 100 42 #endif 101 43 /** 102 44 * @}
Note:
See TracChangeset
for help on using the changeset viewer.