nucleo-f334r8: Use new COMP driver

This commit is contained in:
raiden00pl 2017-03-25 16:59:20 +01:00
parent a806aedb13
commit 645a11ce65
1 changed files with 16 additions and 7 deletions

View File

@ -44,7 +44,7 @@
#include <debug.h>
#include <nuttx/board.h>
/* #include <nuttx/analog/comp.h> */
#include <nuttx/analog/comp.h>
#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;
}