Skip to content
Snippets Groups Projects
Commit 7b351f59 authored by rahix's avatar rahix
Browse files

chore(bhi160): Make bhi160_fetch_fifo() return void


bhi160_fetch_fifo() doesn't actually return any meaningful error values
anymore.  Remove return-value checks and make the function return void
to express this clearly.

Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 19e42e6b
No related branches found
No related tags found
1 merge request!423BHI160 cleanup
......@@ -340,7 +340,7 @@ bhi160_handle_packet(bhy_data_type_t data_type, bhy_data_generic_t *sensor_data)
* Fetch all data available from BHI160's FIFO buffer and handle all packets
* contained in it.
*/
static int bhi160_fetch_fifo(void)
static void bhi160_fetch_fifo(void)
{
/*
* Warning: The code from the BHy1 docs has some issues. This
......@@ -398,7 +398,6 @@ static int bhi160_fetch_fifo(void)
hwlock_release(HWLOCK_I2C);
mutex_unlock(&bhi160_mutex);
return result;
}
/*
......@@ -512,13 +511,7 @@ void vBhi160Task(void *pvParameters)
/* ----------------------------------------- */
while (1) {
int ret = bhi160_fetch_fifo();
if (ret == -EBUSY) {
LOG_WARN("bhi160", "Could not acquire mutex for FIFO?");
continue;
} else if (ret < 0) {
LOG_ERR("bhi160", "Unknown error: %d", -ret);
}
bhi160_fetch_fifo();
/*
* Wait for interrupt. After two seconds, fetch FIFO anyway in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment