buffer must be big enough for a frame */
| 204 | |
| 205 | /* buffer must be big enough for a frame */ |
| 206 | static int usb_read(int ep, uint8_t buffer[FRAME_SIZE]) |
| 207 | { |
| 208 | if (USBFS_GetEPState(ep) != USBFS_OUT_BUFFER_FULL) |
| 209 | { |
| 210 | USBFS_EnableOutEP(ep); |
| 211 | wait_until_readable(ep); |
| 212 | } |
| 213 | |
| 214 | int length = USBFS_GetEPCount(ep); |
| 215 | USBFS_ReadOutEP(ep, buffer, length); |
| 216 | while (USBFS_GetEPState(ep) != USBFS_OUT_BUFFER_EMPTY) |
| 217 | ; |
| 218 | return length; |
| 219 | } |
| 220 | |
| 221 | static void cmd_get_version(struct any_frame* f) |
| 222 | { |
no test coverage detected