diff --git a/libraries/AP_Notify/Display_SH1106_I2C.cpp b/libraries/AP_Notify/Display_SH1106_I2C.cpp index 906c6bea6f..0c5f36e427 100644 --- a/libraries/AP_Notify/Display_SH1106_I2C.cpp +++ b/libraries/AP_Notify/Display_SH1106_I2C.cpp @@ -68,9 +68,10 @@ bool Display_SH1106_I2C::hw_init() memset(_displaybuffer, 0, SH1106_COLUMNS * SH1106_ROWS_PER_PAGE); // take i2c bus semaphore - if (!_dev || !_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { + if (!_dev) { return false; } + _dev->get_semaphore()->take_blocking(); // init display bool success = _dev->transfer((uint8_t *)&init_seq, sizeof(init_seq), nullptr, 0); diff --git a/libraries/AP_Notify/Display_SSD1306_I2C.cpp b/libraries/AP_Notify/Display_SSD1306_I2C.cpp index c67af8c493..f292fbb321 100644 --- a/libraries/AP_Notify/Display_SSD1306_I2C.cpp +++ b/libraries/AP_Notify/Display_SSD1306_I2C.cpp @@ -76,9 +76,10 @@ bool Display_SSD1306_I2C::hw_init() memset(_displaybuffer, 0, SSD1306_COLUMNS * SSD1306_ROWS_PER_PAGE); // take i2c bus semaphore - if (!_dev || !_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { + if (!_dev) { return false; } + _dev->get_semaphore()->take_blocking(); // init display bool success = _dev->transfer((uint8_t *)&init_seq, sizeof(init_seq), nullptr, 0);