MCPcopy Create free account
hub / github.com/ARMmbed/DAPLink / DAP_queue_execute_buf

Function DAP_queue_execute_buf

source/daplink/cmsis-dap/DAP_queue.c:75–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74
75BOOL DAP_queue_execute_buf(DAP_queue * queue, const uint8_t *reqbuf, int len, uint8_t ** retbuf)
76{
77 uint32_t rsize;
78 if (queue->free_count > 0) {
79 if (DAP_activity_blink(reqbuf)) {
80 main_blink_hid_led(MAIN_LED_FLASH);
81 }
82
83 if (len > DAP_PACKET_SIZE) {
84 len = DAP_PACKET_SIZE;
85 }
86 queue->free_count--;
87 memcpy(queue->USB_Request[queue->recv_idx], reqbuf, len);
88 rsize = DAP_ExecuteCommand(reqbuf, queue->USB_Request[queue->recv_idx]);
89 queue->resp_size[queue->recv_idx] = rsize & 0xFFFF; //get the response size
90 *retbuf = queue->USB_Request[queue->recv_idx];
91 queue->recv_idx = (queue->recv_idx + 1) % DAP_PACKET_COUNT;
92 queue->send_count++;
93 return (__TRUE);
94 }
95 return (__FALSE);
96}

Callers 2

usbd_hid_set_reportFunction · 0.85

Calls 3

DAP_activity_blinkFunction · 0.85
main_blink_hid_ledFunction · 0.85
DAP_ExecuteCommandFunction · 0.85

Tested by

no test coverage detected