added macros to remove unnecessary acquire and release calls

This commit is contained in:
dario 2024-12-12 21:31:14 +01:00
parent 4b73783359
commit e40a9d3846

View File

@ -144,9 +144,11 @@ namespace sta
/* The address is bit-shifted by one to work properly for the STM32 HAL. */ /* The address is bit-shifted by one to work properly for the STM32 HAL. */
: I2CDevice(intf, address << 1, master, blocking) : I2CDevice(intf, address << 1, master, blocking)
{ {
#ifdef STA_ASSERT_ENABLED
intf->acquire(); intf->acquire();
STA_ASSERT(intf->hasAddress(address)); STA_ASSERT(intf->hasAddress(address));
intf->release(); intf->release();
#endif // STA_ASSERT_ENABLED
} }
} // namespace sta } // namespace sta