Correct Shenzhou LED controls

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5174 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-09-22 14:06:47 +00:00
parent 0b6459cb28
commit 61fb767d91
6 changed files with 101 additions and 76 deletions

View File

@ -381,12 +381,12 @@ events as follows:
* If LED1, LED2, LED3 are statically on, then NuttX probably failed to boot * 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 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 is because of timer interupts that result in the LED being illuminated
on a small proportion of the time. on a small proportion of the time.
*** LED2 may also flicker normally if signals are processed. *** LED2 may also flicker normally if signals are processed.
**** LED4 may not be available if RS-485 is also used it will then indicate **** LED4 may not be available if RS-485 is also used. For RS-485, it will
the RS-485 direction. then indicate the RS-485 direction.
Shenzhou-specific Configuration Options Shenzhou-specific Configuration Options
============================================ ============================================

View File

@ -175,6 +175,7 @@ CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG=y
CONFIG_STM32_PHYADDR=1 CONFIG_STM32_PHYADDR=1
CONFIG_STM32_MII=y CONFIG_STM32_MII=y
CONFIG_STM32_MII_MCO=y CONFIG_STM32_MII_MCO=y
# CONFIG_STM32_MII_EXTCLK is not set
CONFIG_STM32_AUTONEG=y CONFIG_STM32_AUTONEG=y
CONFIG_STM32_PHYSR=16 CONFIG_STM32_PHYSR=16
CONFIG_STM32_PHYSR_SPEED=0x0002 CONFIG_STM32_PHYSR_SPEED=0x0002
@ -200,7 +201,7 @@ CONFIG_ARCH_STACKDUMP=y
CONFIG_DRAM_START=0x20000000 CONFIG_DRAM_START=0x20000000
CONFIG_DRAM_SIZE=65536 CONFIG_DRAM_SIZE=65536
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
# CONFIG_ARCH_INTERRUPTSTACK is not set CONFIG_ARCH_INTERRUPTSTACK=0
# #
# Boot options # Boot options
@ -307,6 +308,7 @@ CONFIG_DEV_NULL=y
# CONFIG_CAN is not set # CONFIG_CAN is not set
# CONFIG_PWM is not set # CONFIG_PWM is not set
# CONFIG_I2C is not set # CONFIG_I2C is not set
CONFIG_ARCH_HAVE_I2CRESET=y
CONFIG_SPI=y CONFIG_SPI=y
# CONFIG_SPI_OWNBUS is not set # CONFIG_SPI_OWNBUS is not set
CONFIG_SPI_EXCHANGE=y CONFIG_SPI_EXCHANGE=y
@ -468,142 +470,142 @@ CONFIG_NAMEDAPP=y
# #
# #
# ADC example # ADC Example
# #
# CONFIG_EXAMPLES_ADC is not set # CONFIG_EXAMPLES_ADC is not set
# #
# Buttons example # Buttons Example
# #
# CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_BUTTONS is not set
# #
# CAN example # CAN Example
# #
# CONFIG_EXAMPLES_CAN is not set # CONFIG_EXAMPLES_CAN is not set
# #
# USB CDC/ACM class driver example # USB CDC/ACM Class Driver Example
# #
# CONFIG_EXAMPLES_CDCACM is not set # CONFIG_EXAMPLES_CDCACM is not set
# #
# USB composite class driver example # USB composite Class Driver Example
# #
# CONFIG_EXAMPLES_COMPOSITE is not set # CONFIG_EXAMPLES_COMPOSITE is not set
# #
# DHCP server example # DHCP Server Example
# #
# CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_DHCPD is not set
# #
# FTP client example # FTP Client Example
# #
# CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPC is not set
# #
# FTP server example # FTP Server Example
# #
# CONFIG_EXAMPLES_FTPD is not set # CONFIG_EXAMPLES_FTPD is not set
# #
# "Hello, World!" example # "Hello, World!" Example
# #
# CONFIG_EXAMPLES_HELLO is not set # CONFIG_EXAMPLES_HELLO is not set
# #
# "Hello, World!" C++ example # "Hello, World!" C++ Example
# #
# CONFIG_EXAMPLES_HELLOXX is not set # CONFIG_EXAMPLES_HELLOXX is not set
# #
# USB HID keyboard example # USB HID Keyboard Example
# #
# CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_HIDKBD is not set
# #
# IGMP example # IGMP Example
# #
# CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_IGMP is not set
# #
# LCD read/write example # LCD Read/Write Example
# #
# CONFIG_EXAMPLES_LCDRW is not set # CONFIG_EXAMPLES_LCDRW is not set
# #
# Memory management example # Memory Management Example
# #
# CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MM is not set
# #
# File system mount example # File System Mount Example
# #
# CONFIG_EXAMPLES_MOUNT is not set # CONFIG_EXAMPLES_MOUNT is not set
# #
# FreeModBus example # FreeModBus Example
# #
# CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MODBUS is not set
# #
# Network test example # Network Test Example
# #
# CONFIG_EXAMPLES_NETTEST is not set # CONFIG_EXAMPLES_NETTEST is not set
# #
# NuttShell (NSH) example # NuttShell (NSH) Example
# #
CONFIG_EXAMPLES_NSH=y CONFIG_EXAMPLES_NSH=y
# #
# NULL example # NULL Example
# #
# CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NULL is not set
# #
# NX graphics example # NX Graphics Example
# #
# CONFIG_EXAMPLES_NX is not set # CONFIG_EXAMPLES_NX is not set
# #
# NxConsole example # NxConsole Example
# #
# CONFIG_EXAMPLES_NXCONSOLE is not set # CONFIG_EXAMPLES_NXCONSOLE is not set
# #
# NXFFS file system example # NXFFS File System Example
# #
# CONFIG_EXAMPLES_NXFFS is not set # CONFIG_EXAMPLES_NXFFS is not set
# #
# NXFLAT example # NXFLAT Example
# #
# CONFIG_EXAMPLES_NXFLAT is not set # CONFIG_EXAMPLES_NXFLAT is not set
# #
# NX graphics "Hello, World!" example # NX Graphics "Hello, World!" Example
# #
# CONFIG_EXAMPLES_NXHELLO is not set # CONFIG_EXAMPLES_NXHELLO is not set
# #
# NX graphics image example # NX Graphics image Example
# #
# CONFIG_EXAMPLES_NXIMAGE is not set # CONFIG_EXAMPLES_NXIMAGE is not set
# #
# NX graphics lines example # NX Graphics lines Example
# #
# CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXLINES is not set
# #
# NX graphics text example # NX Graphics Text Example
# #
# CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_NXTEXT is not set
# #
# OS test example # OS Test Example
# #
# CONFIG_EXAMPLES_OSTEST is not set # CONFIG_EXAMPLES_OSTEST is not set
@ -613,104 +615,113 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_PASHELLO is not set # CONFIG_EXAMPLES_PASHELLO is not set
# #
# Pipe example # Pipe Example
# #
# CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_PIPE is not set
# #
# Poll example # Poll Example
# #
# CONFIG_EXAMPLES_POLL is not set # 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 # CONFIG_EXAMPLES_QENCODER is not set
# #
# RGMP example # RGMP Example
# #
# CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_RGMP is not set
# #
# ROMFS example # ROMFS Example
# #
# CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_ROMFS is not set
# #
# sendmail example # sendmail Example
# #
# CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SENDMAIL is not set
# #
# Serial loopback example # Serial Loopback Example
# #
# CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SERLOOP is not set
# #
# Telnet daemon example # Telnet Daemon Example
# #
# CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TELNETD is not set
# #
# THTTPD web server example # THTTPD Web Server Example
# #
# CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_THTTPD is not set
# #
# TIFF generation example # TIFF Generation Example
# #
# CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TIFF is not set
# #
# Touchscreen example # Touchscreen Example
# #
# CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set
# #
# UDP example # UDP Example
# #
# CONFIG_EXAMPLES_UDP is not set # 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 # CONFIG_EXAMPLES_UIP is not set
# #
# USB serial test example # USB Serial Test Example
# #
# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBSERIAL is not set
# #
# USB mass storage class example # USB Mass Storage Class Example
# #
# CONFIG_EXAMPLES_USBMSC is not set # CONFIG_EXAMPLES_USBMSC is not set
# #
# USB serial terminal example # USB Serial Terminal Example
# #
# CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_USBTERM is not set
# #
# Watchdog timer example # Watchdog timer Example
# #
# CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WATCHDOG is not set
# #
# wget example # wget Example
# #
# CONFIG_EXAMPLES_WGET is not set # CONFIG_EXAMPLES_WGET is not set
# #
# WLAN example # WLAN Example
# #
# CONFIG_EXAMPLES_WLAN is not set # CONFIG_EXAMPLES_WLAN is not set
#
# XML RPC Example
#
# #
# Interpreters # Interpreters
# #
@ -790,6 +801,16 @@ CONFIG_NETUTILS_WEBCLIENT=y
# #
# CONFIG_NETUTILS_WEBSERVER is not set # 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 # ModBus
# #

View File

@ -63,6 +63,12 @@ SECTIONS
_etext = ABSOLUTE(.); _etext = ABSOLUTE(.);
} > flash } > flash
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} >flash
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.); _eronly = ABSOLUTE(.);
/* The STM32F107VC has 64Kb of SRAM beginning at the following address */ /* The STM32F107VC has 64Kb of SRAM beginning at the following address */
@ -79,12 +85,6 @@ SECTIONS
*(.ARM.extab*) *(.ARM.extab*)
} >sram } >sram
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} >sram
__exidx_end = ABSOLUTE(.);
.bss : { .bss : {
_sbss = ABSOLUTE(.); _sbss = ABSOLUTE(.);
*(.bss .bss.*) *(.bss .bss.*)

View File

@ -65,6 +65,12 @@ SECTIONS
_etext = ABSOLUTE(.); _etext = ABSOLUTE(.);
} > flash } > flash
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} >flash
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.); _eronly = ABSOLUTE(.);
/* The STM32F107VC has 64Kb of SRAM beginning at the following address */ /* The STM32F107VC has 64Kb of SRAM beginning at the following address */
@ -81,12 +87,6 @@ SECTIONS
*(.ARM.extab*) *(.ARM.extab*)
} >sram } >sram
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} >sram
__exidx_end = ABSOLUTE(.);
.bss : { .bss : {
_sbss = ABSOLUTE(.); _sbss = ABSOLUTE(.);
*(.bss .bss.*) *(.bss .bss.*)

View File

@ -113,13 +113,13 @@
*/ */
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ #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|\ #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|\ #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|\ #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 /* TFT LCD
* *

View File

@ -203,24 +203,26 @@ static struct pm_callback_s g_ledscb =
static inline void led_clrbits(unsigned int clrbits) static inline void led_clrbits(unsigned int clrbits)
{ {
/* All LEDs are pulled up and, hence, active low */
if ((clrbits & SHENZHOU_LED1) != 0) if ((clrbits & SHENZHOU_LED1) != 0)
{ {
stm32_gpiowrite(GPIO_LED1, false); stm32_gpiowrite(GPIO_LED1, true);
} }
if ((clrbits & SHENZHOU_LED2) != 0) if ((clrbits & SHENZHOU_LED2) != 0)
{ {
stm32_gpiowrite(GPIO_LED2, false); stm32_gpiowrite(GPIO_LED2, true);
} }
if ((clrbits & SHENZHOU_LED3) != 0) if ((clrbits & SHENZHOU_LED3) != 0)
{ {
stm32_gpiowrite(GPIO_LED3, false); stm32_gpiowrite(GPIO_LED3, true);
} }
if ((clrbits & SHENZHOU_LED4) != 0) 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) static inline void led_setbits(unsigned int setbits)
{ {
/* All LEDs are pulled up and, hence, active low */
if ((setbits & SHENZHOU_LED1) != 0) if ((setbits & SHENZHOU_LED1) != 0)
{ {
stm32_gpiowrite(GPIO_LED1, true); stm32_gpiowrite(GPIO_LED1, false);
} }
if ((setbits & SHENZHOU_LED2) != 0) if ((setbits & SHENZHOU_LED2) != 0)
{ {
stm32_gpiowrite(GPIO_LED2, true); stm32_gpiowrite(GPIO_LED2, false);
} }
if ((setbits & SHENZHOU_LED3) != 0) if ((setbits & SHENZHOU_LED3) != 0)
{ {
stm32_gpiowrite(GPIO_LED3, true); stm32_gpiowrite(GPIO_LED3, false);
} }
if ((setbits & SHENZHOU_LED4) != 0) if ((setbits & SHENZHOU_LED4) != 0)
{ {
stm32_gpiowrite(GPIO_LED4, true); stm32_gpiowrite(GPIO_LED4, false);
} }
} }