Add calibration routine from shell

This commit is contained in:
2020-02-15 17:53:15 +01:00
parent 5a00950589
commit c568b95cf2
8 changed files with 111 additions and 23 deletions

View File

@@ -81,11 +81,12 @@ int dma_ring_buffer_periph_to_mem_get_data(struct dma_ring_buffer_to_mem *buff,
*data_buff = &(((char *)buff->data_ptr)[buff->get_idx * buff->element_size]);
*len = buff->buffer_count - buff->get_idx;
buff->get_idx = 0;
ret_code = 1;
ret_code = 2;
} else if (put_idx > buff->get_idx) {
*data_buff = &(((char *)buff->data_ptr)[buff->get_idx * buff->element_size]);
*len = put_idx - buff->get_idx;
buff->get_idx += *len;
ret_code = 1;
} else {
/* No new data */
*len = 0;