From e40a9d38468298f27a6161c856df5f55fa0a05d4 Mon Sep 17 00:00:00 2001 From: dario Date: Thu, 12 Dec 2024 21:31:14 +0100 Subject: [PATCH] added macros to remove unnecessary acquire and release calls --- src/devices/stm32/bus/i2c.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/devices/stm32/bus/i2c.cpp b/src/devices/stm32/bus/i2c.cpp index 4c9deba..98e8e08 100644 --- a/src/devices/stm32/bus/i2c.cpp +++ b/src/devices/stm32/bus/i2c.cpp @@ -144,9 +144,11 @@ namespace sta /* The address is bit-shifted by one to work properly for the STM32 HAL. */ : I2CDevice(intf, address << 1, master, blocking) { +#ifdef STA_ASSERT_ENABLED intf->acquire(); STA_ASSERT(intf->hasAddress(address)); intf->release(); +#endif // STA_ASSERT_ENABLED } } // namespace sta