From 9d5ecc29d01db1dc17fe4b04a6aa159e5134a326 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Tue, 7 Jan 2025 22:05:01 +0800 Subject: [PATCH] Revert "SEGGER_RTT_Conf.h: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h" This reverts commit 5e7c640976f7fdd77c2230909bf24eafcff26d12. Signed-off-by: hujun5 --- drivers/segger/config/SEGGER_RTT_Conf.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/segger/config/SEGGER_RTT_Conf.h b/drivers/segger/config/SEGGER_RTT_Conf.h index 19c77700e2..bfab44081f 100644 --- a/drivers/segger/config/SEGGER_RTT_Conf.h +++ b/drivers/segger/config/SEGGER_RTT_Conf.h @@ -77,6 +77,16 @@ #define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0 +/* RTT lock configuration */ + +/* Lock RTT (nestable) (i.e. disable interrupts) */ + +#define SEGGER_RTT_LOCK() irqstate_t __flags = spin_lock_irqsave(NULL) + +/* Unlock RTT (nestable) (i.e. enable previous interrupt lock state) */ + +#define SEGGER_RTT_UNLOCK() spin_unlock_irqrestore(NULL, __flags) + /* Disable RTT SEGGER_RTT_WriteSkipNoLock */ #define RTT_USE_ASM 0