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

Function cmd_bulk_read_test

FluxEngine.cydsn/main.c:360–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360static void cmd_bulk_read_test(struct any_frame* f)
361{
362 uint8_t buffer[64];
363
364 bool passed = true;
365 for (int x=0; x<64; x++)
366 {
367 CyWdtClear();
368 for (int y=0; y<256; y++)
369 {
370 usb_read(FLUXENGINE_DATA_OUT_EP_NUM, buffer);
371 for (unsigned z=0; z<sizeof(buffer); z++)
372 {
373 if (buffer[z] != (uint8)(x+y+z))
374 {
375 print("fail %d+%d+%d == %d, not %d", x, y, z, buffer[z], (uint8)(x+y+z));
376 passed = false;
377 }
378 }
379 }
380 }
381
382 print("passed=%d", passed);
383 if (passed)
384 {
385 DECLARE_REPLY_FRAME(struct any_frame, F_FRAME_BULK_READ_TEST_REPLY);
386 send_reply(&r);
387 }
388 else
389 send_error(F_ERROR_INVALID_VALUE);
390}
391
392static void deinit_dma(void)
393{

Callers 1

handle_commandFunction · 0.85

Calls 4

usb_readFunction · 0.85
printFunction · 0.85
send_replyFunction · 0.85
send_errorFunction · 0.85

Tested by

no test coverage detected