Using a mutex to access spi from 3 tasks.

Cellie
Posts: 45
Joined: Sat Feb 27, 2016 9:47 pm

Using a mutex to access spi from 3 tasks.

Postby Cellie » Fri Jul 05, 2024 1:23 pm

Hello all.

I currently have working code that shares the spi bus between a vs1053 and a TFT on 2 different tasks.

Using a SemaphoreHandle_t and xSemaphoreCreateMutex() this works fine.

Now I want to access the spi bus for sdcard access from a third task .

Can I just use xSemaphoreTake(spiMutex, portMAX_DELAY) and xSemaphoreGive(spiMutex) to control the spi access of this third task together with the other tasks?

If so, are there any caveats?

Who is online

Users browsing this forum: No registered users and 104 guests