diff --git a/include/industry/foc/foc_log.h b/include/industry/foc/foc_log.h index 0634d4924..bc8b1c43f 100644 --- a/include/industry/foc/foc_log.h +++ b/include/industry/foc/foc_log.h @@ -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 */ diff --git a/industry/foc/Kconfig b/industry/foc/Kconfig index c22356cec..9031c751e 100644 --- a/industry/foc/Kconfig +++ b/industry/foc/Kconfig @@ -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