Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segger: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RTT_Conf.h #15479

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions drivers/segger/config/SEGGER_RTT_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
# include <nuttx/spinlock.h>
#endif

/****************************************************************************
* Public Data
****************************************************************************/

#ifndef __ASSEMBLY__
extern spinlock_t g_segger_lock;
#endif

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
Expand Down Expand Up @@ -81,11 +89,11 @@

/* Lock RTT (nestable) (i.e. disable interrupts) */

#define SEGGER_RTT_LOCK() irqstate_t __flags = spin_lock_irqsave(NULL)
#define SEGGER_RTT_LOCK() irqstate_t __flags = spin_lock_irqsave_wo_note(&g_segger_lock)

/* Unlock RTT (nestable) (i.e. enable previous interrupt lock state) */

#define SEGGER_RTT_UNLOCK() spin_unlock_irqrestore(NULL, __flags)
#define SEGGER_RTT_UNLOCK() spin_unlock_irqrestore_wo_note(&g_segger_lock, __flags)

/* Disable RTT SEGGER_RTT_WriteSkipNoLock */

Expand Down
6 changes: 6 additions & 0 deletions drivers/segger/note_sysview.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ static struct note_sysview_driver_s g_note_sysview_driver =
}
};

/****************************************************************************
* Public Data
****************************************************************************/

spinlock_t g_segger_lock = SP_UNLOCKED;
xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved

/****************************************************************************
* Private Functions
****************************************************************************/
Expand Down
Loading