summaryrefslogtreecommitdiff
path: root/nuttx/configs/stm32f4discovery
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-29 18:30:48 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-29 18:30:48 +0000
commit30e683a37f8fa682bfda61a7089eca84356eead6 (patch)
treecbdb5c1080982d7ba1ef48411a51b061f3e7571e /nuttx/configs/stm32f4discovery
parentc28168e6888089662f84f65e848797a2d3f73eed (diff)
downloadpx4-nuttx-30e683a37f8fa682bfda61a7089eca84356eead6.tar.gz
px4-nuttx-30e683a37f8fa682bfda61a7089eca84356eead6.tar.bz2
px4-nuttx-30e683a37f8fa682bfda61a7089eca84356eead6.zip
Review and update some board configurations
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4991 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/stm32f4discovery')
-rw-r--r--nuttx/configs/stm32f4discovery/Kconfig56
-rwxr-xr-xnuttx/configs/stm32f4discovery/README.txt6
-rw-r--r--nuttx/configs/stm32f4discovery/nsh/defconfig5
-rw-r--r--nuttx/configs/stm32f4discovery/nxlines/defconfig5
-rw-r--r--nuttx/configs/stm32f4discovery/ostest/defconfig5
-rw-r--r--nuttx/configs/stm32f4discovery/pm/defconfig5
-rwxr-xr-xnuttx/configs/stm32f4discovery/src/up_pmbuttons.c63
7 files changed, 61 insertions, 84 deletions
diff --git a/nuttx/configs/stm32f4discovery/Kconfig b/nuttx/configs/stm32f4discovery/Kconfig
index 808103f2e..2843352b4 100644
--- a/nuttx/configs/stm32f4discovery/Kconfig
+++ b/nuttx/configs/stm32f4discovery/Kconfig
@@ -16,4 +16,60 @@ config ARCH_BUTTONS
---help---
"Support interfaces to use buttons provided by the board."
+config ARCH_IRQBUTTONS
+ bool "Button interrupt support"
+ default n
+ depends on ARCH_BUTTONS
+ ---help---
+ "Support EXTI interrupts on button presses and releases."
+
+config PM_BUTTONS
+ bool "PM Button support"
+ default n
+ depends on PM && ARCH_IRQBUTTONS
+ ---help---
+ Enable PM button EXTI interrupts to support PM testing
+
+config PM_BUTTON_ACTIVITY
+ int "Button PM activity weight"
+ default 10
+ depends on PM_BUTTONS
+ ---help---
+ The activity weight to report to the power management subsystem when a button is pressed.
+
+config PM_ALARM_SEC
+ int "PM_STANDBY delay (seconds)"
+ default 15
+ depends on PM && RTC_ALARM
+ --help---
+ Number of seconds to wait in PM_STANDBY before going to PM_STANDBY mode.
+
+config PM_ALARM_NSEC
+ int "PM_STANDBY delay (nanoseconds)"
+ default 0
+ depends on PM && RTC_ALARM
+ --help---
+ Number of additional nanoseconds to wait in PM_STANDBY before going to PM_STANDBY mode.
+
+config PM_SLEEP_WAKEUP
+ bool "PM_SLEEP wake-up alarm"
+ default n
+ depends on PM && RTC_ALARM
+ --help---
+ Wake-up of PM_SLEEP mode after a delay and resume normal operation.
+
+config PM_SLEEP_WAKEUP_SEC
+ int "PM_SLEEP delay (seconds)"
+ default 10
+ depends on PM && RTC_ALARM
+ --help---
+ Number of seconds to wait in PM_SLEEP before going to PM_STANDBY mode.
+
+config PM_SLEEP_WAKEUP_NSEC
+ int "PM_SLEEP delay (nanoseconds)"
+ default 0
+ depends on PM && RTC_ALARM
+ --help---
+ Number of additional nanoseconds to wait in PM_SLEEP before going to PM_STANDBY mode.
+
endif
diff --git a/nuttx/configs/stm32f4discovery/README.txt b/nuttx/configs/stm32f4discovery/README.txt
index dddee0817..387a76431 100755
--- a/nuttx/configs/stm32f4discovery/README.txt
+++ b/nuttx/configs/stm32f4discovery/README.txt
@@ -807,12 +807,6 @@ STM32F4Discovery-specific Configuration Options
CONFIG_STM32_TIM10
CONFIG_STM32_TIM11
- Timer and I2C devices may need to the following to force power to be applied
- unconditionally at power up. (Otherwise, the device is powered when it is
- initialized).
-
- CONFIG_STM32_FORCEPOWER
-
Timer devices may be used for different purposes. One special purpose is
to generate modulated outputs for such things as motor control. If CONFIG_STM32_TIMn
is defined (as above) then the following may also be defined to indicate that
diff --git a/nuttx/configs/stm32f4discovery/nsh/defconfig b/nuttx/configs/stm32f4discovery/nsh/defconfig
index 7ef051e0f..2280bbf9a 100644
--- a/nuttx/configs/stm32f4discovery/nsh/defconfig
+++ b/nuttx/configs/stm32f4discovery/nsh/defconfig
@@ -181,11 +181,6 @@ CONFIG_STM32_TIM10=n
CONFIG_STM32_TIM11=n
#
-# Timer and I2C devices may need to the following to force power to be applied:
-#
-#CONFIG_STM32_FORCEPOWER=y
-
-#
# STM32F40xxx specific serial device driver settings
#
# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the
diff --git a/nuttx/configs/stm32f4discovery/nxlines/defconfig b/nuttx/configs/stm32f4discovery/nxlines/defconfig
index 12b2919bd..c5515c426 100644
--- a/nuttx/configs/stm32f4discovery/nxlines/defconfig
+++ b/nuttx/configs/stm32f4discovery/nxlines/defconfig
@@ -181,11 +181,6 @@ CONFIG_STM32_TIM10=n
CONFIG_STM32_TIM11=n
#
-# Timer and I2C devices may need to the following to force power to be applied:
-#
-#CONFIG_STM32_FORCEPOWER=y
-
-#
# STM32F40xxx specific serial device driver settings
#
# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the
diff --git a/nuttx/configs/stm32f4discovery/ostest/defconfig b/nuttx/configs/stm32f4discovery/ostest/defconfig
index c26bcb52c..a984d26a1 100644
--- a/nuttx/configs/stm32f4discovery/ostest/defconfig
+++ b/nuttx/configs/stm32f4discovery/ostest/defconfig
@@ -181,11 +181,6 @@ CONFIG_STM32_TIM10=n
CONFIG_STM32_TIM11=n
#
-# Timer and I2C devices may need to the following to force power to be applied:
-#
-#CONFIG_STM32_FORCEPOWER=y
-
-#
# STM32F4Discovery specific serial device driver settings
#
# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the
diff --git a/nuttx/configs/stm32f4discovery/pm/defconfig b/nuttx/configs/stm32f4discovery/pm/defconfig
index 94136efb7..dce39ecec 100644
--- a/nuttx/configs/stm32f4discovery/pm/defconfig
+++ b/nuttx/configs/stm32f4discovery/pm/defconfig
@@ -182,11 +182,6 @@ CONFIG_STM32_TIM10=n
CONFIG_STM32_TIM11=n
#
-# Timer and I2C devices may need to the following to force power to be applied:
-#
-#CONFIG_STM32_FORCEPOWER=y
-
-#
# STM32F40xxx specific serial device driver settings
#
# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the
diff --git a/nuttx/configs/stm32f4discovery/src/up_pmbuttons.c b/nuttx/configs/stm32f4discovery/src/up_pmbuttons.c
index 619eaa91c..aa72e3da1 100755
--- a/nuttx/configs/stm32f4discovery/src/up_pmbuttons.c
+++ b/nuttx/configs/stm32f4discovery/src/up_pmbuttons.c
@@ -64,12 +64,8 @@
# error "CONFIG_ARCH_BUTTONS is not defined in the configuration"
#endif
-#ifndef CONFIG_PM_BUTTONS_NAME0
-# define CONFIG_PM_BUTTONS_NAME0 "BUTTON0"
-#endif
-
-#ifndef CONFIG_PM_IRQBUTTON
-# define CONFIG_PM_IRQBUTTON 0
+#ifndef CONFIG_ARCH_IRQBUTTONS
+# warning "CONFIG_ARCH_IRQBUTTONS is not defined in the configuration"
#endif
#ifndef CONFIG_PM_BUTTON_ACTIVITY
@@ -80,61 +76,18 @@
* Private Types
****************************************************************************/
-struct button_info_s
-{
- FAR const char *name; /* Name for the button */
-#ifdef CONFIG_ARCH_IRQBUTTONS
- xcpt_t handler; /* Button interrupt handler */
-#endif
-};
-
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS
-static void button_handler(int id, int irq);
-
-#if MIN_BUTTON < 1
-static int button0_handler(int irq, FAR void *context);
-#endif
-#if MIN_BUTTON < 2 && MAX_BUTTON > 0
-static int button1_handler(int irq, FAR void *context);
-#endif
-#if MIN_BUTTON < 3 && MAX_BUTTON > 1
-static int button2_handler(int irq, FAR void *context);
-#endif
-#if MIN_BUTTON < 4 && MAX_BUTTON > 2
-static int button3_handler(int irq, FAR void *context);
-#endif
-#if MIN_BUTTON < 5 && MAX_BUTTON > 3
-static int button4_handler(int irq, FAR void *context);
-#endif
-#if MIN_BUTTON < 6 && MAX_BUTTON > 4
-static int button5_handler(int irq, FAR void *context);
-#endif
-#if MIN_BUTTON < 7 && MAX_BUTTON > 5
-static int button6_handler(int irq, FAR void *context);
-#endif
-#if MAX_BUTTON > 6
-static int button7_handler(int irq, FAR void *context);
-#endif
+static int button_handler(int irq, FAR void *context);
#endif /* CONFIG_ARCH_IRQBUTTONS */
/****************************************************************************
* Private Data
****************************************************************************/
-/* Button Names */
-
-static const struct button_info_s g_buttoninfo =
-{
- CONFIG_PM_BUTTONS_NAME0,
-#ifdef CONFIG_ARCH_IRQBUTTONS
- button0_handler,
-#endif
-};
-
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -148,7 +101,7 @@ static const struct button_info_s g_buttoninfo =
****************************************************************************/
#ifdef CONFIG_ARCH_IRQBUTTONS
-static void button_handler(int id, int irq)
+static int button_handler(int irq, FAR void *context)
{
/* At this point the MCU should have already awakened. The state
* change will be handled in the IDLE loop when the system is re-awakened
@@ -158,14 +111,8 @@ static void button_handler(int id, int irq)
*/
pm_activity(CONFIG_PM_BUTTON_ACTIVITY);
-}
-
-static int button0_handler(int irq, FAR void *context)
-{
- button_handler(0, irq);
return OK;
}
-
#endif /* CONFIG_ARCH_IRQBUTTONS */
/****************************************************************************
@@ -188,7 +135,7 @@ void up_pmbuttons(void)
up_buttoninit();
#ifdef CONFIG_ARCH_IRQBUTTONS
- xcpt_t oldhandler = up_irqbutton(0, g_buttoninfo.handler);
+ xcpt_t oldhandler = up_irqbutton(0, button_handler);
if (oldhandler != NULL)
{