From 042acf7cfb0ed94e1532d7d52735b50a4f378994 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 16 Jul 2011 15:52:15 +0000 Subject: [PATCH] Make NX and NXTEXT built-ins; extend stm3210e-eval/nsh2 config to run the NX example from the NX command line git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3791 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- apps/ChangeLog.txt | 3 + apps/Makefile | 4 +- apps/examples/Makefile | 7 + apps/examples/README.txt | 4 + apps/examples/nx/Makefile | 16 +- apps/examples/nx/nx_main.c | 6 +- apps/examples/nxtext/Makefile | 16 +- apps/examples/nxtext/nxtext_main.c | 6 +- apps/nshlib/README.txt | 5 + nuttx/ChangeLog | 6 + nuttx/Documentation/NuttShell.html | 8 + .../ez80f910200zco/dhcpd/dhcpd.zdsproj | 4 +- .../ez80f910200zco/httpd/httpd.zdsproj | 4 +- .../ez80f910200zco/nettest/nettest.zdsproj | 4 +- nuttx/configs/ez80f910200zco/nsh/nsh.zdsproj | 4 +- .../ez80f910200zco/ostest/ostest.zdsproj | 4 +- .../configs/ez80f910200zco/poll/poll.zdsproj | 4 +- nuttx/configs/stm3210e-eval/README.txt | 9 +- nuttx/configs/stm3210e-eval/nsh/defconfig | 18 +- nuttx/configs/stm3210e-eval/nsh2/appconfig | 7 + nuttx/configs/stm3210e-eval/nsh2/defconfig | 187 +++++++++++++++++- nuttx/configs/stm3210e-eval/nx/defconfig | 9 +- nuttx/configs/stm3210e-eval/nxtext/defconfig | 8 +- nuttx/fs/fat/fs_fat32dirent.c | 2 +- 24 files changed, 312 insertions(+), 33 deletions(-) diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index cd6cc3071..85da11502 100755 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -72,3 +72,6 @@ 6.7 2011-xx-xx Gregory Nutt + * apps/examples/nx and nxtext: These examples can now be built as NSH + "built-in" commands. + diff --git a/apps/Makefile b/apps/Makefile index c11829f15..d4a6b2e73 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -2,8 +2,8 @@ # apps/Makefile # # Copyright (C) 2011 Uros Platise. All rights reserved. -# Author: Uros Platise -# Gregory Nutt +# Authors: Uros Platise +# Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/apps/examples/Makefile b/apps/examples/Makefile index b19dff483..f79a366ef 100644 --- a/apps/examples/Makefile +++ b/apps/examples/Makefile @@ -41,12 +41,19 @@ SUBDIRS = buttons dhcpd ftpc hello helloxx hidkbd igmp mm mount nettest \ nsh null nx nxffs nxflat nxtext ostest pashello pipe poll rgmp romfs \ sendmail serloop thttpd udp uip usbserial usbstorage wget wlan +# Sub-directories that might need context setup + +CNTXTDIRS = nx nxtext + all: nothing .PHONY: nothing context depend clean distclean nothing: context: + @for dir in $(CNTXTDIRS) ; do \ + $(MAKE) -C $$dir context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \ + done depend: @for dir in $(SUBDIRS) ; do \ diff --git a/apps/examples/README.txt b/apps/examples/README.txt index 07d92a76d..6c1c1e55d 100644 --- a/apps/examples/README.txt +++ b/apps/examples/README.txt @@ -237,6 +237,8 @@ examples/nx defined in include/nuttx/nx.h. The following configuration options can be selected: + CONFIG_EXAMPLES_NX_BUILTIN -- Build the NX example as a "built-in" + that can be executed from the NSH command line CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame- buffer driver for use in the test. Default: 0 CONFIG_EXAMPLES_NX_DEVNO - The LCD device to select from the LCD @@ -322,6 +324,8 @@ examples/nxtest The following configuration options can be selected: + CONFIG_EXAMPLES_NXTEXT_BUILTIN -- Build the NXTEXT example as a "built-in" + that can be executed from the NSH command line CONFIG_EXAMPLES_NXTEXT_VPLANE -- The plane to select from the frame- buffer driver for use in the test. Default: 0 CONFIG_EXAMPLES_NXTEXT_DEVNO - The LCD device to select from the LCD diff --git a/apps/examples/nx/Makefile b/apps/examples/nx/Makefile index 326edd118..bdeb57e22 100644 --- a/apps/examples/nx/Makefile +++ b/apps/examples/nx/Makefile @@ -59,12 +59,18 @@ endif ROOTDEPPATH = --dep-path . +# NX built-in application info + +APPNAME = nx +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + # Common build VPATH = all: .built -.PHONY: clean depend distclean +.PHONY: context clean depend distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -78,7 +84,13 @@ $(COBJS): %$(OBJEXT): %.c done ; ) @touch .built -context: +.context: +ifeq ($(CONFIG_EXAMPLES_NX_BUILTIN),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ +endif + +context: .context .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/nx/nx_main.c b/apps/examples/nx/nx_main.c index 3f0578e3f..d8b1eaba0 100644 --- a/apps/examples/nx/nx_main.c +++ b/apps/examples/nx/nx_main.c @@ -610,10 +610,14 @@ static int nxeg_initialize(void) ****************************************************************************/ /**************************************************************************** - * Name: user_start + * Name: user_start/nx_main ****************************************************************************/ +#ifdef CONFIG_EXAMPLES_NX_BUILTIN +int nx_main(int argc, char **argv) +#else int user_start(int argc, char *argv[]) +#endif { NXEGWINDOW hwnd1; NXEGWINDOW hwnd2; diff --git a/apps/examples/nxtext/Makefile b/apps/examples/nxtext/Makefile index 4451c9faf..75e489943 100644 --- a/apps/examples/nxtext/Makefile +++ b/apps/examples/nxtext/Makefile @@ -60,12 +60,18 @@ endif ROOTDEPPATH = --dep-path . +# NXTEXT built-in application info + +APPNAME = nxtext +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + # Common build VPATH = all: .built -.PHONY: clean depend distclean +.PHONY: context clean depend distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -79,7 +85,13 @@ $(COBJS): %$(OBJEXT): %.c done ; ) @touch .built -context: +.context: +ifeq ($(CONFIG_EXAMPLES_NXTEXT_BUILTIN),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ +endif + +context: .context .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/nxtext/nxtext_main.c b/apps/examples/nxtext/nxtext_main.c index a3027165d..6a53f9d2c 100644 --- a/apps/examples/nxtext/nxtext_main.c +++ b/apps/examples/nxtext/nxtext_main.c @@ -339,10 +339,14 @@ static int nxtext_initialize(void) ****************************************************************************/ /**************************************************************************** - * Name: user_start + * Name: user_start/nxtext_main ****************************************************************************/ +#ifdef CONFIG_EXAMPLES_NXTEXT_BUILTIN +int nxtext_main(int argc, char **argv) +#else int user_start(int argc, char *argv[]) +#endif { FAR struct nxtext_state_s *bgstate; NXWINDOW hwnd = NULL; diff --git a/apps/nshlib/README.txt b/apps/nshlib/README.txt index a678824e3..8435f6317 100644 --- a/apps/nshlib/README.txt +++ b/apps/nshlib/README.txt @@ -841,6 +841,11 @@ NSH-Specific Configuration Settings The behavior of NSH can be modified with the following settings in the configs//defconfig file: + * CONFIG_NSH_BUILTIN_APPS + Support external registered, "named" applications that can be + executed from the NSH command line (see apps/README.txt for + more information). + * CONFIG_NSH_FILEIOSIZE Size of a static I/O buffer used for file access (ignored if there is no filesystem). Default is 1024. diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 900292bbb..1e72a039a 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -1917,3 +1917,9 @@ may be all upper or all lower case (but not mixed). If CONFIG_FAT_LCNAMES is not selected, all filenames are strictly upper case. + * configs/stm3210e-eval/nsh2: Console is back on UART1; Added + examplex/nx as an NSH "built-in" command as a demonstration. + * fs/fat/fs_fat32dirent.c: Fix an important bug in the directory + allocation (fat_allocatedirentry()). I looks like it could be + initializing the wrong sectors! NOTE: This function was in + fs_fat32utils.c in earlier releases. diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html index 4ee51a48c..56dcfdde2 100644 --- a/nuttx/Documentation/NuttShell.html +++ b/nuttx/Documentation/NuttShell.html @@ -2065,6 +2065,14 @@ nsh> Configuration Description + + CONFIG_NSH_BUILTIN_APPS + + Support external registered, "named" applications that can be + executed from the NSH command line (see apps/README.txt for + more information). + + CONFIG_NSH_FILEIOSIZE diff --git a/nuttx/configs/ez80f910200zco/dhcpd/dhcpd.zdsproj b/nuttx/configs/ez80f910200zco/dhcpd/dhcpd.zdsproj index 15c121a25..731826088 100755 --- a/nuttx/configs/ez80f910200zco/dhcpd/dhcpd.zdsproj +++ b/nuttx/configs/ez80f910200zco/dhcpd/dhcpd.zdsproj @@ -106,7 +106,7 @@ - + @@ -244,4 +244,4 @@ - \ No newline at end of file + diff --git a/nuttx/configs/ez80f910200zco/httpd/httpd.zdsproj b/nuttx/configs/ez80f910200zco/httpd/httpd.zdsproj index 3c826277d..8b15962b3 100755 --- a/nuttx/configs/ez80f910200zco/httpd/httpd.zdsproj +++ b/nuttx/configs/ez80f910200zco/httpd/httpd.zdsproj @@ -106,7 +106,7 @@ - + @@ -244,4 +244,4 @@ - \ No newline at end of file + diff --git a/nuttx/configs/ez80f910200zco/nettest/nettest.zdsproj b/nuttx/configs/ez80f910200zco/nettest/nettest.zdsproj index 7bb28b9cd..3758b7aad 100755 --- a/nuttx/configs/ez80f910200zco/nettest/nettest.zdsproj +++ b/nuttx/configs/ez80f910200zco/nettest/nettest.zdsproj @@ -106,7 +106,7 @@ - + @@ -244,4 +244,4 @@ - \ No newline at end of file + diff --git a/nuttx/configs/ez80f910200zco/nsh/nsh.zdsproj b/nuttx/configs/ez80f910200zco/nsh/nsh.zdsproj index 3f3608029..605c8a0fc 100755 --- a/nuttx/configs/ez80f910200zco/nsh/nsh.zdsproj +++ b/nuttx/configs/ez80f910200zco/nsh/nsh.zdsproj @@ -106,7 +106,7 @@ - + @@ -244,4 +244,4 @@ - \ No newline at end of file + diff --git a/nuttx/configs/ez80f910200zco/ostest/ostest.zdsproj b/nuttx/configs/ez80f910200zco/ostest/ostest.zdsproj index 157b434eb..71da9ab7a 100755 --- a/nuttx/configs/ez80f910200zco/ostest/ostest.zdsproj +++ b/nuttx/configs/ez80f910200zco/ostest/ostest.zdsproj @@ -106,7 +106,7 @@ - + @@ -244,4 +244,4 @@ - \ No newline at end of file + diff --git a/nuttx/configs/ez80f910200zco/poll/poll.zdsproj b/nuttx/configs/ez80f910200zco/poll/poll.zdsproj index b06b8ccd7..1e73bb9aa 100755 --- a/nuttx/configs/ez80f910200zco/poll/poll.zdsproj +++ b/nuttx/configs/ez80f910200zco/poll/poll.zdsproj @@ -106,7 +106,7 @@ - + @@ -244,4 +244,4 @@ - \ No newline at end of file + diff --git a/nuttx/configs/stm3210e-eval/README.txt b/nuttx/configs/stm3210e-eval/README.txt index 8dac8289f..969527aa1 100755 --- a/nuttx/configs/stm3210e-eval/README.txt +++ b/nuttx/configs/stm3210e-eval/README.txt @@ -461,9 +461,16 @@ Where is one of the following: Loader: DfuSe DfuSe ----------- ----------------------- -------------------------------- Serial Debug output: USART1 Debug output: USART1 - Console: NSH output: USART1 NSH output: USART2 *** + Console: NSH output: USART1 NSH output: USART1 *** ----------- ----------------------- -------------------------------- I2C1 Disabled Enabled + ----------- ----------------------- -------------------------------- + Support for No Yes + Built-in + Apps + ----------- ----------------------- -------------------------------- + Built-in None apps/examples/nx + AppS =========== ======================= ================================ * You will probably need to modify nsh/setenv.sh or nsh2/setenv.sh diff --git a/nuttx/configs/stm3210e-eval/nsh/defconfig b/nuttx/configs/stm3210e-eval/nsh/defconfig index e801892fa..908aff7f1 100755 --- a/nuttx/configs/stm3210e-eval/nsh/defconfig +++ b/nuttx/configs/stm3210e-eval/nsh/defconfig @@ -529,16 +529,24 @@ CONFIG_FS_READAHEAD=n CONFIG_FS_WRITEBUFFER=n # -# SDIO-based MMC/SD driver +# STM32 SDIO-based MMC/SD driver # -# CONFIG_SDIO_DMA -# SDIO driver supports DMA +# CONFIG_SDIO_DMA - Support DMA data transfers. Requires CONFIG_STM32_SDIO +# and CONFIG_STM32_DMA2. +# CONFIG_SDIO_PRI - Select SDIO interrupt prority. Default: 128 +# CONFIG_SDIO_DMAPRIO - Select SDIO DMA interrupt priority. +# Default: Medium +# CONFIG_SDIO_WIDTH_D1_ONLY - Select 1-bit transfer mode. Default: +# 4-bit transfer mode. # CONFIG_MMCSD_MMCSUPPORT # Enable support for MMC cards # CONFIG_MMCSD_HAVECARDDETECT # SDIO driver card detection is 100% accurate # CONFIG_SDIO_DMA=y +#CONFIG_SDIO_PRI=128 +#CONFIG_SDIO_DMAPRIO +#CONFIG_SDIO_WIDTH_D1_ONLY CONFIG_MMCSD_MMCSUPPORT=n CONFIG_MMCSD_HAVECARDDETECT=n @@ -726,6 +734,9 @@ CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 # # Settings for apps/nshlib # +# CONFIG_NSH_BUILTIN_APPS - Support external registered, +# "named" applications that can be executed from the NSH +# command line (see apps/README.txt for more information). # CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer # CONFIG_NSH_STRERROR - Use strerror(errno) # CONFIG_NSH_LINELEN - Maximum length of one command line @@ -757,6 +768,7 @@ CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 # CONFIG_NSH_FATNSECTORS - FAT FS number of sectors # CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint # +CONFIG_NSH_BUILTIN_APPS=n CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_STRERROR=n CONFIG_NSH_LINELEN=64 diff --git a/nuttx/configs/stm3210e-eval/nsh2/appconfig b/nuttx/configs/stm3210e-eval/nsh2/appconfig index acd4be7ff..62724fb96 100644 --- a/nuttx/configs/stm3210e-eval/nsh2/appconfig +++ b/nuttx/configs/stm3210e-eval/nsh2/appconfig @@ -37,5 +37,12 @@ CONFIGURED_APPS += examples/nsh +# The NSH applicatin library + CONFIGURED_APPS += nshlib +# The NX example configured as an NX built-in command + +CONFIGURED_APPS += examples/nx + + diff --git a/nuttx/configs/stm3210e-eval/nsh2/defconfig b/nuttx/configs/stm3210e-eval/nsh2/defconfig index 954e79fd7..04786888d 100644 --- a/nuttx/configs/stm3210e-eval/nsh2/defconfig +++ b/nuttx/configs/stm3210e-eval/nsh2/defconfig @@ -325,6 +325,8 @@ CONFIG_HAVE_LIBM=n #CONFIG_APPS_DIR= CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n +CONFIG_DEBUG_GRAPHICS=n +CONFIG_DEBUG_LCD=n CONFIG_DEBUG_SYMBOLS=n CONFIG_MM_REGIONS=1 CONFIG_ARCH_LOWPUTC=y @@ -466,6 +468,15 @@ CONFIG_MAX_WDOGPARMS=2 CONFIG_PREALLOC_WDOGS=4 CONFIG_PREALLOC_TIMERS=4 +# +# Framebuffer driver options +# +CONFIG_FB_CMAP=n +CONFIG_FB_HWCURSOR=n +CONFIG_FB_HWCURSORIMAGE=n +#CONFIG_FB_HWCURSORSIZE +#CONFIG_FB_TRANSPARENCY + # # Filesystem configuration # @@ -542,16 +553,24 @@ CONFIG_FS_READAHEAD=n CONFIG_FS_WRITEBUFFER=n # -# SDIO-based MMC/SD driver +# STM32 SDIO-based MMC/SD driver # -# CONFIG_SDIO_DMA -# SDIO driver supports DMA +# CONFIG_SDIO_DMA - Support DMA data transfers. Requires CONFIG_STM32_SDIO +# and CONFIG_STM32_DMA2. +# CONFIG_SDIO_PRI - Select SDIO interrupt prority. Default: 128 +# CONFIG_SDIO_DMAPRIO - Select SDIO DMA interrupt priority. +# Default: Medium +# CONFIG_SDIO_WIDTH_D1_ONLY - Select 1-bit transfer mode. Default: +# 4-bit transfer mode. # CONFIG_MMCSD_MMCSUPPORT # Enable support for MMC cards # CONFIG_MMCSD_HAVECARDDETECT # SDIO driver card detection is 100% accurate # CONFIG_SDIO_DMA=y +#CONFIG_SDIO_PRI=128 +#CONFIG_SDIO_DMAPRIO +#CONFIG_SDIO_WIDTH_D1_ONLY CONFIG_MMCSD_MMCSUPPORT=n CONFIG_MMCSD_HAVECARDDETECT=n @@ -711,6 +730,116 @@ CONFIG_USBSTRG_PRODUCTSTR="USBdev Storage" CONFIG_USBSTRG_VERSIONNO=0x0399 CONFIG_USBSTRG_REMOVABLE=y +# +# Graphics related configuration settings +# +# CONFIG_NX +# Enables overall support for graphics library and NX +# CONFIG_NX_MULTIUSER +# Configures NX in multi-user mode +# CONFIG_NX_NPLANES +# Some YUV color formats requires support for multiple planes, +# one for each color component. Unless you have such special +# hardware, this value should be undefined or set to 1 +# CONFIG_NX_DISABLE_1BPP, CONFIG_NX_DISABLE_2BPP, +# CONFIG_NX_DISABLE_4BPP, CONFIG_NX_DISABLE_8BPP, +# CONFIG_NX_DISABLE_16BPP, CONFIG_NX_DISABLE_24BPP, and +# CONFIG_NX_DISABLE_32BPP +# NX supports a variety of pixel depths. You can save some +# memory by disabling support for unused color depths. +# CONFIG_NX_PACKEDMSFIRST +# If a pixel depth of less than 8-bits is used, then NX needs +# to know if the pixels pack from the MS to LS or from LS to MS +# CONFIG_NX_LCDDRIVER +# By default, NX builds to use a framebuffer driver (see +# include/nuttx/fb.h). If this option is defined, NX will +# build to use an LCD driver (see include/nuttx/lcd/lcd.h). +# CONFIG_LCD_MAXPOWER - The full-on power setting for an LCD device. +# CONFIG_LCD_MAXCONTRAST - The maximum contrast value for an LCD device. +# CONFIG_NX_MOUSE +# Build in support for mouse input +# CONFIG_NX_KBD +# Build in support of keypad/keyboard input +# CONFIG_NXTK_BORDERWIDTH +# Specifies with with of the border (in pixels) used with +# framed windows. The default is 4. +# CONFIG_NXTK_BORDERCOLOR1 and CONFIG_NXTK_BORDERCOLOR2 +# Specify the colors of the border used with framed windows. +# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so +# is normally darker. The default is medium and dark grey, +# respectively +# CONFIG_NXTK_AUTORAISE +# If set, a window will be raised to the top if the mouse position +# is over a visible portion of the window. Default: A mouse +# button must be clicked over a visible portion of the window. +# CONFIG_NXFONTS_CHARBITS +# The number of bits in the character set. Current options are +# only 7 and 8. The default is 7. +# CONFIG_NXFONT_SANS +# At present, there is only one font. But if there were were more, +# then this option would select the sans serif font. +# +# NX Multi-user only options: +# +# CONFIG_NX_BLOCKING +# Open the client message queues in blocking mode. In this case, +# nx_eventhandler() will not return until a message is received and processed. +# CONFIG_NX_MXSERVERMSGS and CONFIG_NX_MXCLIENTMSGS +# Specifies the maximum number of messages that can fit in +# the message queues. No additional resources are allocated, but +# this can be set to prevent flooding of the client or server with +# too many messages (CONFIG_PREALLOC_MQ_MSGS controls how many +# messages are pre-allocated). +# +CONFIG_NX=y +CONFIG_NX_MULTIUSER=n +CONFIG_NX_NPLANES=1 +CONFIG_NX_DISABLE_1BPP=y +CONFIG_NX_DISABLE_2BPP=y +CONFIG_NX_DISABLE_4BPP=y +CONFIG_NX_DISABLE_8BPP=y +CONFIG_NX_DISABLE_16BPP=n +CONFIG_NX_DISABLE_24BPP=y +CONFIG_NX_DISABLE_32BPP=y +CONFIG_NX_PACKEDMSFIRST=n +CONFIG_NX_LCDDRIVER=y +CONFIG_LCD_MAXPOWER=1 +CONFIG_LCD_MAXCONTRAST=1 +CONFIG_NX_MOUSE=y +CONFIG_NX_KBD=y +#CONFIG_NXTK_BORDERWIDTH=4 +CONFIG_NXTK_BORDERCOLOR1=0xd69a +CONFIG_NXTK_BORDERCOLOR2=0xad55 +CONFIG_NXTK_AUTORAISE=n +CONFIG_NXFONT_SANS=y +CONFIG_NXFONTS_CHARBITS=7 +CONFIG_NX_BLOCKING=y +CONFIG_NX_MXSERVERMSGS=32 +CONFIG_NX_MXCLIENTMSGS=16 + +# +# STM3210E-EVAL LCD Hardware Configuration +# +# CONFIG_LCD_LANDSCAPE - Define for 320x240 display "landscape" +# support. Default is this 320x240 "landscape" orientation +# (this setting is informative only... not used). +# CONFIG_LCD_PORTRAIT - Define for 240x320 display "portrait" +# orientation support. In this orientation, the STM3210E-EVAL's +# LCD ribbon cable is at the bottom of the display. Default is +# 320x240 "landscape" orientation. +# CONFIG_LCD_RPORTRAIT - Define for 240x320 display "reverse +# portrait" orientation support. In this orientation, the +# STM3210E-EVAL's LCD ribbon cable is at the top of the display. +# Default is 320x240 "landscape" orientation. +# CONFIG_LCD_BACKLIGHT - Define to support an adjustable backlight +# using timer 1. The granularity of the settings is determined +# by CONFIG_LCD_MAXPOWER. Requires CONFIG_STM32_TIM1. +# +CONFIG_LCD_LANDSCAPE=n +CONFIG_LCD_PORTRAIT=n +CONFIG_LCD_RPORTRAIT=y +CONFIG_LCD_BACKLIGHT=n + # # Settings for examples/uip # @@ -739,6 +868,9 @@ CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 # # Settings for apps/nshlib # +# CONFIG_NSH_BUILTIN_APPS - Support external registered, +# "named" applications that can be executed from the NSH +# command line (see apps/README.txt for more information). # CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer # CONFIG_NSH_STRERROR - Use strerror(errno) # CONFIG_NSH_LINELEN - Maximum length of one command line @@ -772,6 +904,7 @@ CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 # CONFIG_NSH_FATNSECTORS - FAT FS number of sectors # CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint # +CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_STRERROR=n CONFIG_NSH_LINELEN=64 @@ -781,7 +914,7 @@ CONFIG_NSH_DISABLESCRIPT=n CONFIG_NSH_DISABLEBG=n CONFIG_NSH_ROMFSETC=n CONFIG_NSH_CONSOLE=y -CONFIG_NSH_CONDEV="/dev/ttyS1" +#CONFIG_NSH_CONDEV="/dev/ttyS1" CONFIG_NSH_TELNET=n CONFIG_NSH_ARCHINIT=y CONFIG_NSH_IOBUFFER_SIZE=512 @@ -829,6 +962,52 @@ CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS=n CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER=n CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n +# +# Settings for examples/nx +# +# CONFIG_EXAMPLES_NX_BUILTIN -- Build the NX example as a "built-in" +# that can be executed from the NSH command line +# CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame- +# buffer driver for use in the test. Default: 0 +# CONFIG_EXAMPLES_NX_DEVNO - The LCD device to select from the LCD +# driver for use in the test: Default: 0 +# CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default depends on +# CONFIG_EXAMPLES_NX_BPP. +# CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default depends on +# CONFIG_EXAMPLES_NX_BPP. +# CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default depends on +# CONFIG_EXAMPLES_NX_BPP. +# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on +# CONFIG_EXAMPLES_NX_BPP. +# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on +# CONFIG_EXAMPLES_NX_BPP. +# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options +# include 2, 4, 8, 16, 24, and 32. Default is 32. +# CONFIG_EXAMPLES_NX_RAWWINDOWS -- Use raw windows; Default is to +# use pretty, framed NXTK windows with toolbars. +# CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating +# the NX server. Default 2048 +# CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80 +# CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120 +# CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with +# nx_eventnotify(). Default: 4 +# +CONFIG_EXAMPLES_NX_BUILTIN=y +CONFIG_EXAMPLES_NX_VPLANE=0 +CONFIG_EXAMPLES_NX_DEVNO=0 +CONFIG_EXAMPLES_NX_BGCOLOR=0x0011 +CONFIG_EXAMPLES_NX_COLOR1=0xaedc +CONFIG_EXAMPLES_NX_COLOR2=0xe7ff +CONFIG_EXAMPLES_NX_TBCOLOR=0xd69a +CONFIG_EXAMPLES_NX_FONTCOLOR=0x0000 +CONFIG_EXAMPLES_NX_BPP=16 +CONFIG_EXAMPLES_NX_RAWWINDOWS=n +CONFIG_EXAMPLES_NX_STACKSIZE=2048 +CONFIG_EXAMPLES_NX_CLIENTPRIO=80 +CONFIG_EXAMPLES_NX_SERVERPRIO=120 +CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 +CONFIG_EXAMPLES_NX_EXTERNINIT=n + # # Stack and heap information # diff --git a/nuttx/configs/stm3210e-eval/nx/defconfig b/nuttx/configs/stm3210e-eval/nx/defconfig index e65bfe469..bf6e25e7a 100644 --- a/nuttx/configs/stm3210e-eval/nx/defconfig +++ b/nuttx/configs/stm3210e-eval/nx/defconfig @@ -457,8 +457,8 @@ CONFIG_ARCH_BZERO=n CONFIG_MAX_TASKS=16 CONFIG_MAX_TASK_ARGS=4 CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=12 -CONFIG_NFILE_STREAMS=12 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 CONFIG_NAME_MAX=32 CONFIG_STDIO_BUFFER_SIZE=256 CONFIG_NUNGET_CHARS=2 @@ -902,7 +902,7 @@ CONFIG_NSH_DISABLESCRIPT=n CONFIG_NSH_DISABLEBG=n CONFIG_NSH_ROMFSETC=n CONFIG_NSH_CONSOLE=y -CONFIG_NSH_CONDEV="/dev/ttyS1" +#CONFIG_NSH_CONDEV="/dev/ttyS1" CONFIG_NSH_TELNET=n CONFIG_NSH_ARCHINIT=y CONFIG_NSH_IOBUFFER_SIZE=512 @@ -953,6 +953,8 @@ CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n # # Settings for examples/nx # +# CONFIG_EXAMPLES_NX_BUILTIN -- Build the NX example as a "built-in" +# that can be executed from the NSH command line # CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame- # buffer driver for use in the test. Default: 0 # CONFIG_EXAMPLES_NX_DEVNO - The LCD device to select from the LCD @@ -978,6 +980,7 @@ CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n # CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with # nx_eventnotify(). Default: 4 # +CONFIG_EXAMPLES_NX_BUILTIN=n CONFIG_EXAMPLES_NX_VPLANE=0 CONFIG_EXAMPLES_NX_DEVNO=0 CONFIG_EXAMPLES_NX_BGCOLOR=0x0011 diff --git a/nuttx/configs/stm3210e-eval/nxtext/defconfig b/nuttx/configs/stm3210e-eval/nxtext/defconfig index c97285022..98efcf9a7 100644 --- a/nuttx/configs/stm3210e-eval/nxtext/defconfig +++ b/nuttx/configs/stm3210e-eval/nxtext/defconfig @@ -953,6 +953,8 @@ CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n # # Settings for examples/nx # +# CONFIG_EXAMPLES_NX_BUILTIN -- Build the NX example as a "built-in" +# that can be executed from the NSH command line # CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame- # buffer driver for use in the test. Default: 0 # CONFIG_EXAMPLES_NX_DEVNO - The LCD device to select from the LCD @@ -978,6 +980,7 @@ CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n # CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with # nx_eventnotify(). Default: 4 # +CONFIG_EXAMPLES_NX_BUILTIN=n CONFIG_EXAMPLES_NX_VPLANE=0 CONFIG_EXAMPLES_NX_DEVNO=0 CONFIG_EXAMPLES_NX_BGCOLOR=0x0011 @@ -996,6 +999,8 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=n # # Settings for examples/nxtext # +# CONFIG_EXAMPLES_NXTEXT_BUILTIN -- Build the NXTEXT example as a "built-in" +# that can be executed from the NSH command line # CONFIG_EXAMPLES_NXTEXT_VPLANE -- The plane to select from the frame- # buffer driver for use in the test. Default: 0 # CONFIG_EXAMPLES_NXTEXT_DEVNO - The LCD device to select from the LCD @@ -1028,7 +1033,8 @@ CONFIG_EXAMPLES_NX_EXTERNINIT=n # thread. Default 80. # CONFIG_EXAMPLES_NXTEXT_NOTIFYSIGNO -- The signal number to use with # nx_eventnotify(). Default: 4 - +# +CONFIG_EXAMPLES_NXTEXT_BUILTIN=n CONFIG_EXAMPLES_NXTEXT_VPLANE=0 CONFIG_EXAMPLES_NXTEXT_DEVNO=0 CONFIG_EXAMPLES_NXTEXT_BGCOLOR=0x0011 diff --git a/nuttx/fs/fat/fs_fat32dirent.c b/nuttx/fs/fat/fs_fat32dirent.c index 91eeb26b6..67366cab4 100644 --- a/nuttx/fs/fat/fs_fat32dirent.c +++ b/nuttx/fs/fat/fs_fat32dirent.c @@ -2258,7 +2258,7 @@ int fat_allocatedirentry(struct fat_mountpt_s *fs, struct fat_dirinfo_s *dirinfo fs->fs_currentsector = fat_cluster2sector(fs, cluster); memset(fs->fs_buffer, 0, fs->fs_hwsectorsize); - sector = sector; + sector = fs->fs_currentsector; for (i = fs->fs_fatsecperclus; i; i--) { ret = fat_hwwrite(fs, fs->fs_buffer, sector, 1);