From 66d8fa1c605a28ccf54803d742b0b42f5fdf9401 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 28 Feb 2025 13:47:53 -0600 Subject: [PATCH] update code for style --- libraries/SPI/src/SPIHelper.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/SPI/src/SPIHelper.h b/libraries/SPI/src/SPIHelper.h index 7f8e903..014837a 100644 --- a/libraries/SPI/src/SPIHelper.h +++ b/libraries/SPI/src/SPIHelper.h @@ -108,7 +108,9 @@ public: @brief Disables any GPIO interrupts registered before an SPI transaction begins */ void maskInterrupts() { - if(_usingIRQs.empty()) { return; } + if (_usingIRQs.empty()) { + return; + } noInterrupts(); // Avoid possible race conditions if IRQ comes in while main app is in middle of this // Disable any IRQs that are being used for SPI io_bank0_irq_ctrl_hw_t *irq_ctrl_base = get_core_num() ? &iobank0_hw->proc1_irq_ctrl : &iobank0_hw->proc0_irq_ctrl; @@ -135,7 +137,9 @@ public: @brief Restores GPIO interrupts masks after an SPI transaction completes */ void unmaskInterrupts() { - if(_usingIRQs.empty()) { return; } + if (_usingIRQs.empty()) { + return; + } noInterrupts(); // Avoid race condition so the GPIO IRQs won't come back until all state is restored DEBUGSPI("SPI::endTransaction()\n"); // Re-enable IRQs