Skip to content

Commit

Permalink
segger: rm spin_lock_irqsave(NULL) in drivers/segger/config/SEGGER_RT…
Browse files Browse the repository at this point in the history
…T_Conf.h

Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Jan 9, 2025
1 parent bb4eb12 commit 528b09b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
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(&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(&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 @@ -162,6 +162,12 @@ static struct note_sysview_driver_s g_note_sysview_driver =
* Private Functions
****************************************************************************/

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

spinlock_t g_segger_lock = SP_UNLOCKED;

/****************************************************************************
* Name: note_sysview_send_taskinfo
****************************************************************************/
Expand Down

0 comments on commit 528b09b

Please sign in to comment.