Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
Configuration/Tool: sim/segger
In file included from segger/SystemView/SEGGER/SEGGER_SYSVIEW.h:65,
                 from segger/SystemView/SEGGER/SEGGER_SYSVIEW_Int.h:64,
                 from segger/SystemView/SEGGER/SEGGER_SYSVIEW.c:146:
segger/SystemView/SEGGER/SEGGER_SYSVIEW.c: In function '_VPrintHost':
Error: segger/SystemView/SEGGER/SEGGER_SYSVIEW_ConfDefaults.h:557:51: error: implicit declaration of function 'SEGGER_RTT_LOCK'; did you mean 'SEGGER_RTT_Read'? [-Werror=implicit-function-declaration]
  557 |   #define SEGGER_SYSVIEW_LOCK()                   SEGGER_RTT_LOCK()
      |                                                   ^~~~~~~~~~~~~~~
segger/SystemView/SEGGER/SEGGER_SYSVIEW.c:387:35: note: in expansion of macro 'SEGGER_SYSVIEW_LOCK'
  387 | #define RECORD_START(PacketSize)  SEGGER_SYSVIEW_LOCK();                            \
      |                                   ^~~~~~~~~~~~~~~~~~~
segger/SystemView/SEGGER/SEGGER_SYSVIEW.c:1005:5: note: in expansion of macro 'RECORD_START'
 1005 |     RECORD_START(SEGGER_SYSVIEW_INFO_SIZE + SEGGER_SYSVIEW_MAX_STRING_LEN + 2 * SEGGER_SYSVIEW_QUANTA_U32 + SEGGER_SYSVIEW_MAX_ARGUMENTS * SEGGER_SYSVIEW_QUANTA_U32);
      |     ^~~~~~~~~~~~
Error: segger/SystemView/SEGGER/SEGGER_SYSVIEW_ConfDefaults.h:570:51: error: implicit declaration of function 'SEGGER_RTT_UNLOCK'; did you mean 'SEGGER_RTT_Init'? [-Werror=implicit-function-declaration]
  570 |   #define SEGGER_SYSVIEW_UNLOCK()                 SEGGER_RTT_UNLOCK()
      |                                                   ^~~~~~~~~~~~~~~~~
segger/SystemView/SEGGER/SEGGER_SYSVIEW.c:390:35: note: in expansion of macro 'SEGGER_SYSVIEW_UNLOCK'
  390 | #define RECORD_END()              SEGGER_SYSVIEW_UNLOCK()
      |                                   ^~~~~~~~~~~~~~~~~~~~~
segger/SystemView/SEGGER/SEGGER_SYSVIEW.c:1015:5: note: in expansion of macro 'RECORD_END'
 1015 |     RECORD_END();

Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Jan 7, 2025
1 parent 4bd2c04 commit e11cc4c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/segger/config/SEGGER_RTT_Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@

#define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0

/* RTT lock configuration */

extern spinlock_t g_segger_lock;

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

#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(&g_segger_lock, __flags)

/* Disable RTT SEGGER_RTT_WriteSkipNoLock */

#define RTT_USE_ASM 0
Expand Down
2 changes: 2 additions & 0 deletions drivers/segger/note_sysview.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ static void note_sysview_vprintf(FAR struct note_driver_s *drv, uintptr_t ip,
* Private Data
****************************************************************************/

spinlock_t g_segger_lock = SP_UNLOCKED;

static const struct note_driver_ops_s g_note_sysview_ops =
{
NULL, /* add */
Expand Down

0 comments on commit e11cc4c

Please sign in to comment.