You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2021/04/01 18:43:57 UTC
[incubator-nuttx] 01/02: debug: add motor related debug messsages
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 0f847c1514a5d8aa361c263524a363d6d6b41c06
Author: raiden00pl <ra...@railab.me>
AuthorDate: Thu Apr 1 08:56:42 2021 +0200
debug: add motor related debug messsages
---
Kconfig | 25 +++++++++++++++++++++++++
include/debug.h | 26 ++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
diff --git a/Kconfig b/Kconfig
index 56b30c6..7f5fa81 100644
--- a/Kconfig
+++ b/Kconfig
@@ -1709,6 +1709,31 @@ config DEBUG_WATCHDOG_INFO
Enable watchdog time informational output to SYSLOG.
endif # DEBUG_WATCHDOG
+
+if DEBUG_MOTOR
+
+config DEBUG_MOTOR_ERROR
+ bool "Motor Error Output"
+ default n
+ depends on DEBUG_ERROR
+ ---help---
+ Enable motor error output to SYSLOG.
+
+config DEBUG_MOTOR_WARN
+ bool "Motor Warnings Output"
+ default n
+ depends on DEBUG_WARN
+ ---help---
+ Enable motor warning output to SYSLOG.
+
+config DEBUG_MOTOR_INFO
+ bool "Motor Informational Output"
+ default n
+ depends on DEBUG_INFO
+ ---help---
+ Enable motor informational output to SYSLOG.
+
+endif # DEBUG_MOTOR
endif # DEBUG_FEATURES
config ARCH_HAVE_STACKCHECK
diff --git a/include/debug.h b/include/debug.h
index 9f2cb83..f75a1fa 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -731,6 +731,24 @@
# define wdinfo _none
#endif
+#ifdef CONFIG_DEBUG_MOTOR_ERROR
+# define mtrerr _err
+#else
+# define mtrerr _none
+#endif
+
+#ifdef CONFIG_DEBUG_MOTOR_WARN
+# define mtrwarn _warn
+#else
+# define mtrwarn _none
+#endif
+
+#ifdef CONFIG_DEBUG_MOTOR_INFO
+# define mtrinfo _info
+#else
+# define mtrinfo _none
+#endif
+
/* Buffer dumping macros do not depend on varargs */
#ifdef CONFIG_DEBUG_ERROR
@@ -995,6 +1013,14 @@
# define wdinfodumpbuffer(m,b,n)
#endif
+#ifdef CONFIG_DEBUG_MOTOR
+# define mtrerrdumpbuffer(m,b,n) errdumpbuffer(m,b,n)
+# define mtrinfodumpbuffer(m,b,n) infodumpbuffer(m,b,n)
+#else
+# define mtrerrdumpbuffer(m,b,n)
+# define mtrinfodumpbuffer(m,b,n)
+#endif
+
/****************************************************************************
* Public Function Prototypes
****************************************************************************/