fix(sdio_slave): fix minor issues like return value of send function, output arg, etc.

This commit is contained in:
michael 2018-07-06 16:02:32 +08:00
parent d8a1080bdf
commit 5019ff3345
2 changed files with 6 additions and 4 deletions

View file

@ -197,12 +197,12 @@ uint8_t* sdio_slave_recv_get_buf( sdio_slave_buf_handle_t handle, size_t *len_o)
esp_err_t sdio_slave_send_queue(uint8_t* addr, size_t len, void* arg, TickType_t wait);
/** Return the ownership of a finished transaction.
* @param arg_o Argument of the finished transaction.
* @param out_arg Argument of the finished transaction. Set to NULL if unused.
* @param wait Time to wait if there's no finished sending transaction.
*
* @return ESP_ERR_TIMEOUT if no transaction finished, or ESP_OK if succeed.
*/
esp_err_t sdio_slave_send_get_finished(void** arg_o, TickType_t wait);
esp_err_t sdio_slave_send_get_finished(void** out_arg, TickType_t wait);
/** Start a new sending transfer, and wait for it (blocked) to be finished.
*

View file

@ -952,9 +952,11 @@ esp_err_t sdio_slave_send_queue(uint8_t* addr, size_t len, void* arg, TickType_t
return ESP_OK;
}
esp_err_t sdio_slave_send_get_finished(void** arg, TickType_t wait)
esp_err_t sdio_slave_send_get_finished(void** out_arg, TickType_t wait)
{
portBASE_TYPE err = xQueueReceive( context.ret_queue, arg, wait );
void* arg = NULL;
portBASE_TYPE err = xQueueReceive(context.ret_queue, &arg, wait);
if (out_arg) *out_arg = arg;
if ( err != pdTRUE ) return ESP_ERR_TIMEOUT;
return ESP_OK;
}