summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-22 14:06:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-22 14:06:47 +0000
commitb3da63f487b2ccc69afd9610e0a6082d8482df56 (patch)
treec56449217153b2e4274169aacbcd5d0a3d6b552f
parent23bb449f09e8044736e257cde80e07473216a30e (diff)
downloadpx4-nuttx-b3da63f487b2ccc69afd9610e0a6082d8482df56.tar.gz
px4-nuttx-b3da63f487b2ccc69afd9610e0a6082d8482df56.tar.bz2
px4-nuttx-b3da63f487b2ccc69afd9610e0a6082d8482df56.zip
Correct Shenzhou LED controls
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5174 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/configs/shenzhou/README.txt6
-rw-r--r--nuttx/configs/shenzhou/nsh/defconfig119
-rw-r--r--nuttx/configs/shenzhou/scripts/ld.script12
-rw-r--r--nuttx/configs/shenzhou/scripts/ld.script.dfu12
-rw-r--r--nuttx/configs/shenzhou/src/shenzhou-internal.h8
-rw-r--r--nuttx/configs/shenzhou/src/up_autoleds.c20
6 files changed, 101 insertions, 76 deletions
diff --git a/nuttx/configs/shenzhou/README.txt b/nuttx/configs/shenzhou/README.txt
index 9ee77ea06..e68bd7bf9 100644
--- a/nuttx/configs/shenzhou/README.txt
+++ b/nuttx/configs/shenzhou/README.txt
@@ -381,12 +381,12 @@ events as follows:
* If LED1, LED2, LED3 are statically on, then NuttX probably failed to boot
and these LEDs will give you some indication of where the failure was
- ** The normal state is LED3 ON and LED1 faintly glowing. This faint glow
+ ** The normal state is LED1 ON and LED1 faintly glowing. This faint glow
is because of timer interupts that result in the LED being illuminated
on a small proportion of the time.
*** LED2 may also flicker normally if signals are processed.
-**** LED4 may not be available if RS-485 is also used it will then indicate
- the RS-485 direction.
+**** LED4 may not be available if RS-485 is also used. For RS-485, it will
+ then indicate the RS-485 direction.
Shenzhou-specific Configuration Options
============================================
diff --git a/nuttx/configs/shenzhou/nsh/defconfig b/nuttx/configs/shenzhou/nsh/defconfig
index 0c18b129f..70d9540db 100644
--- a/nuttx/configs/shenzhou/nsh/defconfig
+++ b/nuttx/configs/shenzhou/nsh/defconfig
@@ -175,6 +175,7 @@ CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG=y
CONFIG_STM32_PHYADDR=1
CONFIG_STM32_MII=y
CONFIG_STM32_MII_MCO=y
+# CONFIG_STM32_MII_EXTCLK is not set
CONFIG_STM32_AUTONEG=y
CONFIG_STM32_PHYSR=16
CONFIG_STM32_PHYSR_SPEED=0x0002
@@ -200,7 +201,7 @@ CONFIG_ARCH_STACKDUMP=y
CONFIG_DRAM_START=0x20000000
CONFIG_DRAM_SIZE=65536
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
-# CONFIG_ARCH_INTERRUPTSTACK is not set
+CONFIG_ARCH_INTERRUPTSTACK=0
#
# Boot options
@@ -307,6 +308,7 @@ CONFIG_DEV_NULL=y
# CONFIG_CAN is not set
# CONFIG_PWM is not set
# CONFIG_I2C is not set
+CONFIG_ARCH_HAVE_I2CRESET=y
CONFIG_SPI=y
# CONFIG_SPI_OWNBUS is not set
CONFIG_SPI_EXCHANGE=y
@@ -468,142 +470,142 @@ CONFIG_NAMEDAPP=y
#
#
-# ADC example
+# ADC Example
#
# CONFIG_EXAMPLES_ADC is not set
#
-# Buttons example
+# Buttons Example
#
# CONFIG_EXAMPLES_BUTTONS is not set
#
-# CAN example
+# CAN Example
#
# CONFIG_EXAMPLES_CAN is not set
#
-# USB CDC/ACM class driver example
+# USB CDC/ACM Class Driver Example
#
# CONFIG_EXAMPLES_CDCACM is not set
#
-# USB composite class driver example
+# USB composite Class Driver Example
#
# CONFIG_EXAMPLES_COMPOSITE is not set
#
-# DHCP server example
+# DHCP Server Example
#
# CONFIG_EXAMPLES_DHCPD is not set
#
-# FTP client example
+# FTP Client Example
#
# CONFIG_EXAMPLES_FTPC is not set
#
-# FTP server example
+# FTP Server Example
#
# CONFIG_EXAMPLES_FTPD is not set
#
-# "Hello, World!" example
+# "Hello, World!" Example
#
# CONFIG_EXAMPLES_HELLO is not set
#
-# "Hello, World!" C++ example
+# "Hello, World!" C++ Example
#
# CONFIG_EXAMPLES_HELLOXX is not set
#
-# USB HID keyboard example
+# USB HID Keyboard Example
#
# CONFIG_EXAMPLES_HIDKBD is not set
#
-# IGMP example
+# IGMP Example
#
# CONFIG_EXAMPLES_IGMP is not set
#
-# LCD read/write example
+# LCD Read/Write Example
#
# CONFIG_EXAMPLES_LCDRW is not set
#
-# Memory management example
+# Memory Management Example
#
# CONFIG_EXAMPLES_MM is not set
#
-# File system mount example
+# File System Mount Example
#
# CONFIG_EXAMPLES_MOUNT is not set
#
-# FreeModBus example
+# FreeModBus Example
#
# CONFIG_EXAMPLES_MODBUS is not set
#
-# Network test example
+# Network Test Example
#
# CONFIG_EXAMPLES_NETTEST is not set
#
-# NuttShell (NSH) example
+# NuttShell (NSH) Example
#
CONFIG_EXAMPLES_NSH=y
#
-# NULL example
+# NULL Example
#
# CONFIG_EXAMPLES_NULL is not set
#
-# NX graphics example
+# NX Graphics Example
#
# CONFIG_EXAMPLES_NX is not set
#
-# NxConsole example
+# NxConsole Example
#
# CONFIG_EXAMPLES_NXCONSOLE is not set
#
-# NXFFS file system example
+# NXFFS File System Example
#
# CONFIG_EXAMPLES_NXFFS is not set
#
-# NXFLAT example
+# NXFLAT Example
#
# CONFIG_EXAMPLES_NXFLAT is not set
#
-# NX graphics "Hello, World!" example
+# NX Graphics "Hello, World!" Example
#
# CONFIG_EXAMPLES_NXHELLO is not set
#
-# NX graphics image example
+# NX Graphics image Example
#
# CONFIG_EXAMPLES_NXIMAGE is not set
#
-# NX graphics lines example
+# NX Graphics lines Example
#
# CONFIG_EXAMPLES_NXLINES is not set
#
-# NX graphics text example
+# NX Graphics Text Example
#
# CONFIG_EXAMPLES_NXTEXT is not set
#
-# OS test example
+# OS Test Example
#
# CONFIG_EXAMPLES_OSTEST is not set
@@ -613,105 +615,114 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_PASHELLO is not set
#
-# Pipe example
+# Pipe Example
#
# CONFIG_EXAMPLES_PIPE is not set
#
-# Poll example
+# Poll Example
#
# CONFIG_EXAMPLES_POLL is not set
#
-# Pulse width modulation (PWM) example
+# Pulse Width Modulation (PWM) Example
#
#
-# Quadrature encoder example
+# Quadrature Encoder Example
#
# CONFIG_EXAMPLES_QENCODER is not set
#
-# RGMP example
+# RGMP Example
#
# CONFIG_EXAMPLES_RGMP is not set
#
-# ROMFS example
+# ROMFS Example
#
# CONFIG_EXAMPLES_ROMFS is not set
#
-# sendmail example
+# sendmail Example
#
# CONFIG_EXAMPLES_SENDMAIL is not set
#
-# Serial loopback example
+# Serial Loopback Example
#
# CONFIG_EXAMPLES_SERLOOP is not set
#
-# Telnet daemon example
+# Telnet Daemon Example
#
# CONFIG_EXAMPLES_TELNETD is not set
#
-# THTTPD web server example
+# THTTPD Web Server Example
#
# CONFIG_EXAMPLES_THTTPD is not set
#
-# TIFF generation example
+# TIFF Generation Example
#
# CONFIG_EXAMPLES_TIFF is not set
#
-# Touchscreen example
+# Touchscreen Example
#
# CONFIG_EXAMPLES_TOUCHSCREEN is not set
#
-# UDP example
+# UDP Example
#
# CONFIG_EXAMPLES_UDP is not set
#
-# uIP web server example
+# UDP Discovery Daemon Example
+#
+# CONFIG_EXAMPLE_DISCOVER is not set
+
+#
+# uIP Web Server Example
#
# CONFIG_EXAMPLES_UIP is not set
#
-# USB serial test example
+# USB Serial Test Example
#
# CONFIG_EXAMPLES_USBSERIAL is not set
#
-# USB mass storage class example
+# USB Mass Storage Class Example
#
# CONFIG_EXAMPLES_USBMSC is not set
#
-# USB serial terminal example
+# USB Serial Terminal Example
#
# CONFIG_EXAMPLES_USBTERM is not set
#
-# Watchdog timer example
+# Watchdog timer Example
#
# CONFIG_EXAMPLES_WATCHDOG is not set
#
-# wget example
+# wget Example
#
# CONFIG_EXAMPLES_WGET is not set
#
-# WLAN example
+# WLAN Example
#
# CONFIG_EXAMPLES_WLAN is not set
#
+# XML RPC Example
+#
+
+#
# Interpreters
#
@@ -791,6 +802,16 @@ CONFIG_NETUTILS_WEBCLIENT=y
# CONFIG_NETUTILS_WEBSERVER is not set
#
+# UDP Discovery Utility
+#
+# CONFIG_NETUTILS_DISCOVER is not set
+
+#
+# XML-RPC library
+#
+# CONFIG_NETUTILS_XMLRPC is not set
+
+#
# ModBus
#
diff --git a/nuttx/configs/shenzhou/scripts/ld.script b/nuttx/configs/shenzhou/scripts/ld.script
index 14f924bae..f07d4432d 100644
--- a/nuttx/configs/shenzhou/scripts/ld.script
+++ b/nuttx/configs/shenzhou/scripts/ld.script
@@ -63,6 +63,12 @@ SECTIONS
_etext = ABSOLUTE(.);
} > flash
+ __exidx_start = ABSOLUTE(.);
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >flash
+ __exidx_end = ABSOLUTE(.);
+
_eronly = ABSOLUTE(.);
/* The STM32F107VC has 64Kb of SRAM beginning at the following address */
@@ -79,12 +85,6 @@ SECTIONS
*(.ARM.extab*)
} >sram
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
.bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
diff --git a/nuttx/configs/shenzhou/scripts/ld.script.dfu b/nuttx/configs/shenzhou/scripts/ld.script.dfu
index 53e3ee4fc..b9d94c7a0 100644
--- a/nuttx/configs/shenzhou/scripts/ld.script.dfu
+++ b/nuttx/configs/shenzhou/scripts/ld.script.dfu
@@ -65,6 +65,12 @@ SECTIONS
_etext = ABSOLUTE(.);
} > flash
+ __exidx_start = ABSOLUTE(.);
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >flash
+ __exidx_end = ABSOLUTE(.);
+
_eronly = ABSOLUTE(.);
/* The STM32F107VC has 64Kb of SRAM beginning at the following address */
@@ -81,12 +87,6 @@ SECTIONS
*(.ARM.extab*)
} >sram
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } >sram
- __exidx_end = ABSOLUTE(.);
-
.bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
diff --git a/nuttx/configs/shenzhou/src/shenzhou-internal.h b/nuttx/configs/shenzhou/src/shenzhou-internal.h
index 19460bc99..48b06e7b0 100644
--- a/nuttx/configs/shenzhou/src/shenzhou-internal.h
+++ b/nuttx/configs/shenzhou/src/shenzhou-internal.h
@@ -113,13 +113,13 @@
*/
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\
- GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN2)
+ GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN2)
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\
- GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN3)
+ GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN3)
#define GPIO_LED3 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\
- GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN4)
+ GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN4)
#define GPIO_LED4 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\
- GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN5)
+ GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN7)
/* TFT LCD
*
diff --git a/nuttx/configs/shenzhou/src/up_autoleds.c b/nuttx/configs/shenzhou/src/up_autoleds.c
index 996836c79..3c467c8ad 100644
--- a/nuttx/configs/shenzhou/src/up_autoleds.c
+++ b/nuttx/configs/shenzhou/src/up_autoleds.c
@@ -203,24 +203,26 @@ static struct pm_callback_s g_ledscb =
static inline void led_clrbits(unsigned int clrbits)
{
+ /* All LEDs are pulled up and, hence, active low */
+
if ((clrbits & SHENZHOU_LED1) != 0)
{
- stm32_gpiowrite(GPIO_LED1, false);
+ stm32_gpiowrite(GPIO_LED1, true);
}
if ((clrbits & SHENZHOU_LED2) != 0)
{
- stm32_gpiowrite(GPIO_LED2, false);
+ stm32_gpiowrite(GPIO_LED2, true);
}
if ((clrbits & SHENZHOU_LED3) != 0)
{
- stm32_gpiowrite(GPIO_LED3, false);
+ stm32_gpiowrite(GPIO_LED3, true);
}
if ((clrbits & SHENZHOU_LED4) != 0)
{
- stm32_gpiowrite(GPIO_LED4, false);
+ stm32_gpiowrite(GPIO_LED4, true);
}
}
@@ -234,24 +236,26 @@ static inline void led_clrbits(unsigned int clrbits)
static inline void led_setbits(unsigned int setbits)
{
+ /* All LEDs are pulled up and, hence, active low */
+
if ((setbits & SHENZHOU_LED1) != 0)
{
- stm32_gpiowrite(GPIO_LED1, true);
+ stm32_gpiowrite(GPIO_LED1, false);
}
if ((setbits & SHENZHOU_LED2) != 0)
{
- stm32_gpiowrite(GPIO_LED2, true);
+ stm32_gpiowrite(GPIO_LED2, false);
}
if ((setbits & SHENZHOU_LED3) != 0)
{
- stm32_gpiowrite(GPIO_LED3, true);
+ stm32_gpiowrite(GPIO_LED3, false);
}
if ((setbits & SHENZHOU_LED4) != 0)
{
- stm32_gpiowrite(GPIO_LED4, true);
+ stm32_gpiowrite(GPIO_LED4, false);
}
}