ITIS-Enrico-Fermi / cansat_firmware

Cansat firmware - sCANSATi Team 2021
1 stars 0 forks source link

Mutex for I2C operations #12

Closed giuliocorradini closed 3 years ago

giuliocorradini commented 3 years ago

i2c_init creates a FreeRTOS mutex object for i2c reads and writes on controller #0. Basic read and write (and their single byte counterpart) are thread-safely implemented, by taking and releasing the mutex. Old functions that don't take advantage of the new API can become thread-safe by surrounding the call with I2C_MUTEX macro, defined in busmanager/i2c.h