diff --git a/configs/nucleo-f334r8/src/stm32_comp.c b/configs/nucleo-f334r8/src/stm32_comp.c index 0f775e1f3d..7b45b385a4 100644 --- a/configs/nucleo-f334r8/src/stm32_comp.c +++ b/configs/nucleo-f334r8/src/stm32_comp.c @@ -44,7 +44,7 @@ #include #include -/* #include */ +#include #include "stm32.h" @@ -52,6 +52,20 @@ defined(CONFIG_STM32_COMP4) || \ defined(CONFIG_STM32_COMP6)) +#ifdef CONFIG_STM32_COMP2 +# if defined(CONFIG_STM32_COMP4) || defined(CONFIG_STM32_COMP6) +# error "Currently only one COMP device supported" +# endif +#elif CONFIG_STM32_COMP4 +# if defined(CONFIG_STM32_COMP2) || defined(CONFIG_STM32_COMP6) +# error "Currently only one COMP device supported" +# endif +#elif CONFIG_STM32_COMP6 +# if defined(CONFIG_STM32_COMP2) || defined(CONFIG_STM32_COMP4) +# error "Currently only one COMP device supported" +# endif +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -67,9 +81,8 @@ int stm32_comp_setup(void) { static bool initialized = false; - struct stm32_comp_s* comp = NULL; + struct comp_dev_s* comp = NULL; int ret; - UNUSED(ret); if (!initialized) { @@ -100,16 +113,12 @@ int stm32_comp_setup(void) } #endif -#if 0 - /* COMP driver not implemented yet */ - ret = comp_register("/dev/comp0", comp); if (ret < 0) { aerr("ERROR: comp_register failed: %d\n", ret); return ret; } -#endif initialized = true; }