Changeset 664a331c in mainline for uspace/lib/usb
- Timestamp:
- 2011-04-29T11:43:28Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2571089
- Parents:
- 28d7185 (diff), f19f1b7 (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. - Location:
- uspace/lib/usb
- Files:
-
- 3 edited
-
include/usb/classes/hidut.h (modified) (1 diff)
-
include/usb/usb.h (modified) (1 diff)
-
src/debug.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/classes/hidut.h
r28d7185 r664a331c 46 46 USB_HIDUT_PAGE_KEYBOARD = 7, 47 47 USB_HIDUT_PAGE_LED = 8, 48 USB_HIDUT_PAGE_BUTTON = 9 49 /* USB_HIDUT_PAGE_ = , */ 48 USB_HIDUT_PAGE_BUTTON = 9, 49 USB_HIDUT_PAGE_ORDINAL = 0x0a, 50 USB_HIDUT_PAGE_TELEPHONY_DEVICE = 0x0b, 51 USB_HIDUT_PAGE_CONSUMER = 0x0c 50 52 } usb_hidut_usage_page_t; 51 53 -
uspace/lib/usb/include/usb/usb.h
r28d7185 r664a331c 96 96 USB_REQUEST_RECIPIENT_DEVICE = 0, 97 97 USB_REQUEST_RECIPIENT_INTERFACE = 1, 98 USB_REQUEST_RECIPIENT_ENDPOINT = 2 98 USB_REQUEST_RECIPIENT_ENDPOINT = 2, 99 USB_REQUEST_RECIPIENT_OTHER = 3 99 100 } usb_request_recipient_t; 100 101 -
uspace/lib/usb/src/debug.c
r28d7185 r664a331c 158 158 159 159 /** Fibril local storage for the dumped buffer. */ 160 static fibril_local char buffer_dump[BUFFER_DUMP_LEN]; 160 static fibril_local char buffer_dump[2][BUFFER_DUMP_LEN]; 161 /** Fibril local storage for buffer switching. */ 162 static fibril_local int buffer_dump_index = 0; 161 163 162 164 /** Dump buffer into string. … … 167 169 * can not do that) and you do not have to guard it against concurrent 168 170 * calls to it. 169 * The only limitation is that each call rewrites the buffer again. 171 * The only limitation is that each second call rewrites the buffer again 172 * (internally, two buffer are used in cyclic manner). 170 173 * Thus, it is necessary to copy the buffer elsewhere (that includes printing 171 174 * to screen or writing to file). … … 173 176 * that is not a big limitation. 174 177 * 175 * @warning You cannot use this function twice in the same printf178 * @warning You cannot use this function more than twice in the same printf 176 179 * (see detailed explanation). 177 180 * … … 185 188 { 186 189 /* 187 * Remove previous string (that might also reveal double usage of 188 * this function). 190 * Remove previous string. 189 191 */ 190 bzero(buffer_dump , BUFFER_DUMP_LEN);192 bzero(buffer_dump[buffer_dump_index], BUFFER_DUMP_LEN); 191 193 192 194 if (buffer == NULL) { … … 202 204 /* How many bytes are available in the output buffer. */ 203 205 size_t buffer_remaining_size = BUFFER_DUMP_LEN - 1 - REMAINDER_STR_LEN; 204 char *it = buffer_dump ;206 char *it = buffer_dump[buffer_dump_index]; 205 207 206 208 size_t index = 0; … … 253 255 } 254 256 255 return buffer_dump; 257 /* Next time, use the other buffer. */ 258 buffer_dump_index = 1 - buffer_dump_index; 259 260 /* Need to take the old one due to previous line. */ 261 return buffer_dump[1 - buffer_dump_index]; 256 262 } 257 263
Note:
See TracChangeset
for help on using the changeset viewer.
