MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / usb_read

Function usb_read

FluxEngine.cydsn/main.c:206–219  ·  view source on GitHub ↗

buffer must be big enough for a frame */

Source from the content-addressed store, hash-verified

204
205/* buffer must be big enough for a frame */
206static 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
221static void cmd_get_version(struct any_frame* f)
222{

Callers 3

cmd_bulk_read_testFunction · 0.85
cmd_writeFunction · 0.85
handle_commandFunction · 0.85

Calls 1

wait_until_readableFunction · 0.85

Tested by

no test coverage detected