Trivial changes from review of last PR.

This commit is contained in:
Gregory Nutt 2017-09-14 14:55:50 -06:00
parent e4f089ea79
commit 0f04816b37
3 changed files with 32 additions and 21 deletions

View File

@ -28,16 +28,16 @@ config STM32F4DISCO_QETIMER
depends on QENCODER
config STM32F4DISCO_LIS3DSH
bool "Enable LIS3DSH driver for the IMU on STM32F4Discovery (rev. MB997C)"
default n
depends on SPI
depends on LIS3DSH
default n
---help---
Select to create a LIS3DSH driver instance for the builtin accelerometer of
STM32F4Discovery. Provides /dev/acc0 device file.
Also see apps/examples/lis3dsh_reader.
The LIS3DSH is available on the STM32F4Discovery rev. MB997C (see the board manual).
bool "Enable LIS3DSH driver for the IMU on STM32F4Discovery (rev. MB997C)"
default n
depends on SPI
depends on LIS3DSH
default n
---help---
Select to create a LIS3DSH driver instance for the builtin accelerometer of
STM32F4Discovery. Provides /dev/acc0 device file.
Also see apps/examples/lis3dsh_reader.
The LIS3DSH is available on the STM32F4Discovery rev. MB997C (see the board manual).
config PM_BUTTONS
bool "PM button support"

View File

@ -1,7 +1,7 @@
/****************************************************************************
* config/stm32f4discovery/src/stm32_bringup.c
*
* Copyright (C) 2012, 2014-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2014-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -77,10 +77,6 @@
# include "stm32_rtc.h"
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@ -266,10 +262,18 @@ int stm32_bringup(void)
#ifdef CONFIG_SENSORS_MAX31855
ret = stm32_max31855initialize("/dev/temp0");
if (ret < 0)
{
serr("ERROR: stm32_max31855initialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_SENSORS_MAX6675
ret = stm32_max6675initialize("/dev/temp0");
if (ret < 0)
{
serr("ERROR: stm32_max6675initialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_FS_PROCFS
@ -285,9 +289,12 @@ int stm32_bringup(void)
#ifdef CONFIG_SENSORS_XEN1210
ret = xen1210_archinitialize(0);
if (ret < 0)
{
serr("ERROR: xen1210_archinitialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_STM32F4DISCO_LIS3DSH
/* Create a lis3dsh driver instance fitting the chip built into stm32f4discovery */
@ -298,6 +305,5 @@ int stm32_bringup(void)
}
#endif
return ret;
}

View File

@ -62,9 +62,9 @@
struct lis3dsh_sensor_data_s
{
int16_t x_acc; /* Measurement result for x axis */
int16_t y_acc; /* Measurement result for y axis */
int16_t z_acc; /* Measurement result for z axis */
int16_t x_acc; /* Measurement result for x axis */
int16_t y_acc; /* Measurement result for y axis */
int16_t z_acc; /* Measurement result for z axis */
};
struct lis3dsh_dev_s
@ -310,7 +310,12 @@ static int lis3dsh_interrupt_handler(int irq, FAR void *context)
/* Find out which device caused the interrupt */
for (priv = g_lis3dsh_list; priv && priv->config->irq != irq; priv = priv->flink);
for (priv = g_lis3dsh_list;
priv && priv->config->irq != irq;
priv = priv->flink);
{
}
DEBUGASSERT(priv != NULL);
/* Task the worker with retrieving the latest sensor data. We should not do