mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
drivers/segger: add note vprint support
Print note log to sysview terminal. See https://www.segger.com/products/development-tools/systemview/#logging-output Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -112,4 +112,6 @@
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT 1
|
||||
|
||||
#endif /* __DRIVERS_SEGGER_CONFIG_SEGGER_RTT_CONF_H */
|
||||
|
||||
@@ -84,6 +84,11 @@ static void note_sysview_wdog(FAR struct note_driver_s *drv, uint8_t event,
|
||||
FAR void *handler, FAR const void *arg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
|
||||
static void note_sysview_vprintf(FAR struct note_driver_s *drv, uintptr_t ip,
|
||||
FAR const char *fmt, va_list va);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@@ -129,6 +134,11 @@ static const struct note_driver_ops_s g_note_sysview_ops =
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_HEAP
|
||||
note_sysview_heap, /* heap */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
|
||||
NULL, /* event */
|
||||
note_sysview_vprintf, /* vprintf */
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct note_sysview_driver_s g_note_sysview_driver =
|
||||
@@ -408,6 +418,14 @@ static void note_sysview_wdog(FAR struct note_driver_s *drv, uint8_t event,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
|
||||
static void note_sysview_vprintf(FAR struct note_driver_s *drv, uintptr_t ip,
|
||||
FAR const char *fmt, va_list va)
|
||||
{
|
||||
SEGGER_SYSVIEW_VPrintfHost(fmt, &va);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user