diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html index 98c878a2964..f867fb3782a 100644 --- a/Documentation/NuttXCCodingStandard.html +++ b/Documentation/NuttXCCodingStandard.html @@ -12,7 +12,7 @@
Last Updated: April 17, 2017
+Last Updated: April 18, 2017
@@ -1292,13 +1292,18 @@ typedef int myinteger_t; No un-named structures. All structures must be named, even if they are part of a type definition. That is, a structure name must follow the reserved wordstruct in all structure definitions.
- The exception to this rule is for structures that are defined within another union or structure. In those cases, the structure name should always be omitted.
+ The exception to this rule is for structures that are defined within another union or structure (discouraged). In those cases, the structure name should always be omitted.
+
+ Correct
-+
+ Correct +
+
struct xyz_info_s
{
...
@@ -1423,10 +1433,20 @@ struct xyz_info_s
...
};
-+ +++ Discouraged +
+typedef struct xyz_info_s xzy_info_t;-(The use of typedef'ed structures is acceptable but discouraged)
++ The use of typedef'ed structures is acceptable but discouraged. +
+
+ Correct +
struct xyz_info_s
{
@@ -1436,7 +1456,12 @@ struct xyz_info_s
uint8_t bitc : 1, /* Bit C */
...
};
-
+
+
++ Discouraged +
+
struct abc_s
{
...
@@ -1448,6 +1473,26 @@ struct abc_s
} abc;
...
};
+
++ The use of structures defined within other structures is acceptable provided that they define named fields. + The general practice of defining a structure within the scope of another structure, however, is still but discouraged in any case. + The following is preferred: +
+ ++ Preferred +
+
+struct abc_s
+{
+ ...
+ int a; /* Value A */
+ int b; /* Value B */
+ int c; /* Value C */
+ ...
+};
+
typedef union xyz_union_u xzy_union_t;-
(The use of typedef'ed unions is acceptable but discouraged)
+The use of typedef'ed unions is acceptable but discouraged.
struct xyz_info_s
{
@@ -1489,6 +1534,7 @@ struct xyz_info_s
} u; /* All union fields must be named */
...
};
+
diff --git a/arch/arm/src/kinetis/kinetis_serial.c b/arch/arm/src/kinetis/kinetis_serial.c
index 63873ecab5f..79f0030b78d 100644
--- a/arch/arm/src/kinetis/kinetis_serial.c
+++ b/arch/arm/src/kinetis/kinetis_serial.c
@@ -592,6 +592,7 @@ static void up_restoreuartint(struct up_dev_s *priv, uint8_t ie)
* Name: up_disableuartint
****************************************************************************/
+#ifdef HAVE_UART_CONSOLE
static void up_disableuartint(struct up_dev_s *priv, uint8_t *ie)
{
irqstate_t flags;
@@ -605,6 +606,7 @@ static void up_disableuartint(struct up_dev_s *priv, uint8_t *ie)
up_restoreuartint(priv, 0);
leave_critical_section(flags);
}
+#endif
/****************************************************************************
* Name: up_setup
diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c
index a6a2d07b51b..6b6161f0ce4 100644
--- a/arch/arm/src/stm32/stm32_serial.c
+++ b/arch/arm/src/stm32/stm32_serial.c
@@ -2250,7 +2250,9 @@ static bool up_rxflowcontrol(struct uart_dev_s *dev,
unsigned int nbuffered, bool upper)
{
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
+#if !(defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && defined(CONFIG_STM32_FLOWCONTROL_BROKEN))
uint16_t ie;
+#endif
#if defined(CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS) && defined(CONFIG_STM32_FLOWCONTROL_BROKEN)
if (priv->iflow && (priv->rts_gpio != 0))
diff --git a/configs/nucleo-f072rb/README.txt b/configs/nucleo-f072rb/README.txt
index fb35cac2d37..033b7b75609 100644
--- a/configs/nucleo-f072rb/README.txt
+++ b/configs/nucleo-f072rb/README.txt
@@ -267,18 +267,55 @@ Configurations
NOTES:
- 1. Support for NSH built-in applications is provided:
+ 1. This initial release of this configuration was very minimal, but
+ also very small:
- Binary Formats:
- CONFIG_BUILTIN=y : Enable support for built-in programs
+ $ size nuttx
+ text data bss dec hex filename
+ 32000 92 1172 33264 81f0 nuttx
- Application Configuration:
- CONFIG_NSH_BUILTIN_APPS=y : Enable starting apps from NSH command line
+ The current version, additional features have been enabled: board
+ bring-up initialization, button support, the procfs file system,
+ and NSH built-in application support. The size increased as follows:
- No built applications are enabled in the base configuration, however.
+ $ size nuttx
+ text data bss dec hex filename
+ 40231 92 1208 41531 a23b nuttx
- 2. C++ support for applications is enabled:
+ Those additional features cost about 8KiB FLASH. I believe that is a
+ good use of the STM32F072RB's FLASH, but if you interested in the
+ more minimal configuration, here is what was changed:
- CONFIG_HAVE_CXX=y
- CONFIG_HAVE_CXXINITIALIZE=y
- CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
+ Removed
+
+ CONFIG_BINFMT_DISABLE=y
+ CONFIG_DISABLE_MOUNTPOINT=y
+ CONFIG_NSH_DISABLE_CD=y
+
+ Added:
+
+ CONFIG_ARCH_BUTTONS=y
+ CONFIG_ARCH_IRQBUTTONS=y
+
+ CONFIG_BUILTIN=y
+ CONFIG_BUILTIN_PROXY_STACKSIZE=1024
+
+ CONFIG_FS_PROCFS=y
+ CONFIG_NSH_PROC_MOUNTPOINT="/proc"
+
+ CONFIG_LIB_BOARDCTL=y
+ CONFIG_NSH_ARCHINIT=y
+ CONFIG_NSH_BUILTIN_APPS=y
+
+ Support for NSH built-in applications is enabled for future use.
+ However, no built applications are enabled in this base configuration.
+
+ 2. C++ support for applications is NOT enabled. That could be enabled
+ with the following configuration changes:
+
+ CONFIG_HAVE_CXX=y
+ CONFIG_HAVE_CXXINITIALIZE=y
+ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
+
+ And also support fo C++ constructors under
+ apps/platform/nucleo-stm32f072rb.
diff --git a/configs/nucleo-f072rb/include/board.h b/configs/nucleo-f072rb/include/board.h
index 50493e09da3..1b45a24a51e 100644
--- a/configs/nucleo-f072rb/include/board.h
+++ b/configs/nucleo-f072rb/include/board.h
@@ -218,8 +218,8 @@
/* Button definitions ***************************************************************/
/* Buttons
*
- * B1 USER: the user button is connected to the I/O PC13 (pin 2) of the STM32
- * microcontroller.
+ * B1 USER: the user button is connected to the I/O PC13 (pin 2) of the STM32
+ * microcontroller.
*/
#define BUTTON_USER 0
diff --git a/configs/nucleo-f072rb/nsh/defconfig b/configs/nucleo-f072rb/nsh/defconfig
index 48868af1246..946a2edad25 100644
--- a/configs/nucleo-f072rb/nsh/defconfig
+++ b/configs/nucleo-f072rb/nsh/defconfig
@@ -407,14 +407,20 @@ CONFIG_ARCH_BOARD="nucleo-f072rb"
CONFIG_ARCH_HAVE_LEDS=y
CONFIG_ARCH_LEDS=y
CONFIG_ARCH_HAVE_BUTTONS=y
-# CONFIG_ARCH_BUTTONS is not set
+CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_HAVE_IRQBUTTONS=y
+CONFIG_ARCH_IRQBUTTONS=y
#
# Board-Specific Options
#
# CONFIG_BOARD_CRASHDUMP is not set
-# CONFIG_LIB_BOARDCTL is not set
+CONFIG_LIB_BOARDCTL=y
+# CONFIG_BOARDCTL_RESET is not set
+# CONFIG_BOARDCTL_UNIQUEID is not set
+# CONFIG_BOARDCTL_TSCTEST is not set
+# CONFIG_BOARDCTL_GRAPHICS is not set
+# CONFIG_BOARDCTL_IOCTL is not set
#
# RTOS Features
@@ -448,6 +454,7 @@ CONFIG_PREALLOC_TIMERS=0
# CONFIG_SPINLOCK is not set
# CONFIG_INIT_NONE is not set
CONFIG_INIT_ENTRYPOINT=y
+# CONFIG_INIT_FILEPATH is not set
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_RR_INTERVAL=200
# CONFIG_SCHED_SPORADIC is not set
@@ -675,13 +682,28 @@ CONFIG_SYSLOG_CONSOLE=y
#
# File system configuration
#
-CONFIG_DISABLE_MOUNTPOINT=y
+# CONFIG_DISABLE_MOUNTPOINT is not set
+# CONFIG_FS_AUTOMOUNTER is not set
CONFIG_DISABLE_PSEUDOFS_OPERATIONS=y
-# CONFIG_FS_READABLE is not set
+CONFIG_FS_READABLE=y
# CONFIG_FS_WRITABLE is not set
# CONFIG_FS_NAMED_SEMAPHORES is not set
# CONFIG_FS_RAMMAP is not set
-# CONFIG_FS_PROCFS is not set
+# CONFIG_FS_FAT is not set
+# CONFIG_FS_NXFFS is not set
+# CONFIG_FS_ROMFS is not set
+# CONFIG_FS_TMPFS is not set
+# CONFIG_FS_SMARTFS is not set
+# CONFIG_FS_BINFS is not set
+CONFIG_FS_PROCFS=y
+# CONFIG_FS_PROCFS_REGISTER is not set
+
+#
+# Exclude individual procfs entries
+#
+# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set
+# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set
+# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set
# CONFIG_FS_UNIONFS is not set
#
@@ -709,7 +731,10 @@ CONFIG_MM_REGIONS=1
#
# Binary Loader
#
-CONFIG_BINFMT_DISABLE=y
+# CONFIG_BINFMT_DISABLE is not set
+# CONFIG_NXFLAT is not set
+# CONFIG_ELF is not set
+CONFIG_BUILTIN=y
# CONFIG_PIC is not set
# CONFIG_SYMTAB_ORDEREDBYNAME is not set
@@ -762,6 +787,7 @@ CONFIG_LIB_RAND_ORDER=1
#
# Program Execution Options
#
+# CONFIG_LIBC_EXECFUNCS is not set
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=1536
@@ -801,6 +827,7 @@ CONFIG_ARCH_HAVE_TLS=y
#
# NETDB Support
#
+# CONFIG_NETDB_HOSTFILE is not set
# CONFIG_LIBC_IOCTL_VARIADIC is not set
CONFIG_LIB_SENDFILE_BUFSIZE=512
@@ -822,6 +849,11 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512
# Application Configuration
#
+#
+# Built-In Applications
+#
+CONFIG_BUILTIN_PROXY_STACKSIZE=1024
+
#
# CAN Utilities
#
@@ -867,12 +899,14 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_SERLOOP is not set
# CONFIG_EXAMPLES_SLCD is not set
# CONFIG_EXAMPLES_SMART is not set
+# CONFIG_EXAMPLES_SMART_TEST is not set
# CONFIG_EXAMPLES_SMP is not set
# CONFIG_EXAMPLES_STAT is not set
# CONFIG_EXAMPLES_TCPECHO is not set
# CONFIG_EXAMPLES_TELNETD is not set
# CONFIG_EXAMPLES_TIFF is not set
# CONFIG_EXAMPLES_TOUCHSCREEN is not set
+# CONFIG_EXAMPLES_USBSERIAL is not set
# CONFIG_EXAMPLES_WATCHDOG is not set
# CONFIG_EXAMPLES_WEBSERVER is not set
# CONFIG_EXAMPLES_XBC_TEST is not set
@@ -881,6 +915,7 @@ CONFIG_EXAMPLES_NSH=y
# File System Utilities
#
# CONFIG_FSUTILS_INIFILE is not set
+# CONFIG_FSUTILS_PASSWD is not set
#
# GPS Utilities
@@ -896,6 +931,7 @@ CONFIG_EXAMPLES_NSH=y
#
# Interpreters
#
+# CONFIG_INTERPRETERS_BAS is not set
# CONFIG_INTERPRETERS_FICL is not set
# CONFIG_INTERPRETERS_MICROPYTHON is not set
# CONFIG_INTERPRETERS_MINIBASIC is not set
@@ -928,10 +964,12 @@ CONFIG_NSH_READLINE=y
# CONFIG_NSH_CLE is not set
CONFIG_NSH_LINELEN=64
CONFIG_NSH_DISABLE_SEMICOLON=y
+# CONFIG_NSH_CMDPARMS is not set
CONFIG_NSH_MAXARGUMENTS=6
# CONFIG_NSH_ARGCAT is not set
CONFIG_NSH_NESTDEPTH=3
# CONFIG_NSH_DISABLEBG is not set
+CONFIG_NSH_BUILTIN_APPS=y
#
# Disable Individual commands
@@ -939,7 +977,7 @@ CONFIG_NSH_NESTDEPTH=3
CONFIG_NSH_DISABLE_ADDROUTE=y
CONFIG_NSH_DISABLE_BASENAME=y
# CONFIG_NSH_DISABLE_CAT is not set
-CONFIG_NSH_DISABLE_CD=y
+# CONFIG_NSH_DISABLE_CD is not set
CONFIG_NSH_DISABLE_CP=y
CONFIG_NSH_DISABLE_CMP=y
CONFIG_NSH_DISABLE_DATE=y
@@ -991,6 +1029,7 @@ CONFIG_NSH_MMCSDMINOR=0
#
CONFIG_NSH_CODECS_BUFSIZE=128
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
+CONFIG_NSH_PROC_MOUNTPOINT="/proc"
CONFIG_NSH_FILEIOSIZE=64
#
@@ -1003,7 +1042,7 @@ CONFIG_NSH_DISABLESCRIPT=y
#
CONFIG_NSH_CONSOLE=y
# CONFIG_NSH_ALTCONDEV is not set
-# CONFIG_NSH_ARCHINIT is not set
+CONFIG_NSH_ARCHINIT=y
# CONFIG_NSH_LOGIN is not set
# CONFIG_NSH_CONSOLE_LOGIN is not set
diff --git a/configs/nucleo-f072rb/src/stm32_bringup.c b/configs/nucleo-f072rb/src/stm32_bringup.c
index 0c9c7f89dfe..137e458e782 100644
--- a/configs/nucleo-f072rb/src/stm32_bringup.c
+++ b/configs/nucleo-f072rb/src/stm32_bringup.c
@@ -41,6 +41,7 @@
#include