From ddfe2cd61cbe39e0f8fc200b6ef21ab223c842ca Mon Sep 17 00:00:00 2001 From: wdfk-prog <1425075683@qq.com> Date: Thu, 13 Nov 2025 11:21:49 +0800 Subject: feat[spi]: enable interrupt-safe operations using spinlocks --- components/drivers/include/drivers/dev_spi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'components/drivers/include') diff --git a/components/drivers/include/drivers/dev_spi.h b/components/drivers/include/drivers/dev_spi.h index 195ba4b6ee..4a0ac92c88 100644 --- a/components/drivers/include/drivers/dev_spi.h +++ b/components/drivers/include/drivers/dev_spi.h @@ -8,6 +8,7 @@ * 2012-11-23 Bernard Add extern "C" * 2020-06-13 armink fix the 3 wires issue * 2022-09-01 liYony fix api rt_spi_sendrecv16 about MSB and LSB bug + * 2025-10-30 wdfk-prog enable interrupt-safe operations using spinlocks */ #ifndef __DEV_SPI_H__ @@ -181,6 +182,10 @@ struct rt_spi_bus #endif /* RT_USING_DM */ struct rt_mutex lock; +#ifdef RT_USING_SPI_ISR + rt_base_t _isr_lvl; + struct rt_spinlock _spinlock; +#endif /* RT_USING_SPI_ISR */ struct rt_spi_device *owner; }; -- cgit v1.3.1