chore: beautify MutexLock, add example code and prevent wrong usage (#6756)

This commit is contained in:
Malte Langermann
2025-11-03 20:21:41 +10:00
committed by GitHub
parent 1931514140
commit 89be172cfb
2 changed files with 62 additions and 2 deletions
@@ -55,7 +55,7 @@ static I2C_HandleTypeDef* i2c_get_handle(uint8_t bus)
}
#if !defined(BOOT)
#define I2CMutex(bus) MutexLock mutexLock(&i2c_get_device(bus)->mutex)
#define I2CMutex(bus) MutexLock mutexLock = MutexLock::MakeInstance(&i2c_get_device(bus)->mutex)
#else
#define I2CMutex(bus)
#endif