| 358 | } |
| 359 | |
| 360 | static 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 | |
| 392 | static void deinit_dma(void) |
| 393 | { |
no test coverage detected