Skip to content
Snippets Groups Projects
Commit 546093f5 authored by rahix's avatar rahix
Browse files

chore(bhi160): Move FIFO statics into function body


These two static variables aren't (and shouldn't!) be used anywhere
outside of bhi160_fetch_fifo() so let's move them into the function.

Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 7b351f59
No related branches found
No related tags found
1 merge request!423BHI160 cleanup
......@@ -44,10 +44,6 @@ static float bhi160_sic_array[3 * 3] = { 1.0, 0.0, 0.0,
0.0, 0.0, 1.0 };
/* clang-format on */
/* BHI160 Fifo */
static uint8_t bhi160_fifo[BHI160_FIFO_SIZE];
static size_t start_index = 0;
/* BHI160 Task ID */
static TaskHandle_t bhi160_task_id = NULL;
......@@ -348,6 +344,13 @@ static void bhi160_fetch_fifo(void)
* You'll probably be best of leaving it as it is ...
*/
/*
* FIFO buffer. Access to this static variable is safe because this
* function is guarded by the bhi160_mutex.
*/
static uint8_t bhi160_fifo[BHI160_FIFO_SIZE];
static size_t start_index = 0;
int result = 0;
/* Number of bytes left in BHI160's FIFO buffer */
uint16_t bytes_left_in_fifo = 1;
......
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