industrial/foc: add options to configure foclib logs

This commit is contained in:
raiden00pl 2023-10-31 18:43:33 +01:00 committed by Xiang Xiao
parent d6522be9b5
commit 57f98ee20e
2 changed files with 29 additions and 3 deletions

View File

@ -35,8 +35,22 @@
* Pre-processor Definitions
****************************************************************************/
#define FOCLIBLOG(format, ...) printf(format, ##__VA_ARGS__)
#define FOCLIBERR(format, ...) printf(format, ##__VA_ARGS__)
#define FOCLIBWARN(format, ...) printf(format, ##__VA_ARGS__)
#ifdef CONFIG_INDUSTRY_FOC_DEBUG
# define FOCLIBLOG(format, ...) printf(format, ##__VA_ARGS__)
#else
# define FOCLIBLOG(format, ...)
#endif
#ifdef CONFIG_INDUSTRY_FOC_ERROR
# define FOCLIBERR(format, ...) printf(format, ##__VA_ARGS__)
#else
# define FOCLIBERR(format, ...)
#endif
#ifdef CONFIG_INDUSTRY_FOC_WARN
# define FOCLIBWARN(format, ...) printf(format, ##__VA_ARGS__)
#else
# define FOCLIBWARN(format, ...)
#endif
#endif /* __APPS_INCLUDE_INDUSTRY_FOC_FOC_LOG_H */

View File

@ -12,6 +12,18 @@ config INDUSTRY_FOC
if INDUSTRY_FOC
config INDUSTRY_FOC_DEBUG
bool "Enable FOCLIB debug log"
default n
config INDUSTRY_FOC_ERROR
bool "Enable FOCLIB error log"
default n
config INDUSTRY_FOC_WARN
bool "Enable FOCLIB warn log"
default n
config INDUSTRY_FOC_CORDIC
bool "Enable CORDIC support"
default n