diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-04-11 18:12:03 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-04-11 18:12:03 +0000 |
commit | f1c5ee72b9ceb7066a12b3e92f46f02d83a522cc (patch) | |
tree | c6ed698ba446d8c202e564579ce0802d34a61979 | |
parent | 0c9433d03263676a6c9142b195f86b0065bfe856 (diff) | |
download | px4-firmware-f1c5ee72b9ceb7066a12b3e92f46f02d83a522cc.tar.gz px4-firmware-f1c5ee72b9ceb7066a12b3e92f46f02d83a522cc.tar.bz2 px4-firmware-f1c5ee72b9ceb7066a12b3e92f46f02d83a522cc.zip |
Correction to the ZLP fix for the STM32 F4 OTG FS driver
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4591 7fd9a85b-ad96-42d3-883c-3090e2eb8679
-rw-r--r-- | apps/system/Kconfig | 16 | ||||
-rw-r--r-- | apps/system/i2c/Kconfig | 46 | ||||
-rw-r--r-- | apps/system/readline/Kconfig | 27 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/stm32/stm32_otgfsdev.c | 18 |
4 files changed, 106 insertions, 1 deletions
diff --git a/apps/system/Kconfig b/apps/system/Kconfig index ae2bf3130..44bf5a2e6 100644 --- a/apps/system/Kconfig +++ b/apps/system/Kconfig @@ -2,3 +2,19 @@ # For a description of the syntax of this configuration file, # see misc/tools/kconfig-language.txt. # + +menu "Custom free memory command" +source "$APPSDIR/system/free/Kconfig" +endmenu + +menu "I2C tool" +source "$APPSDIR/system/i2c/Kconfig" +endmenu + +menu "FLASH Program Installation" +source "$APPSDIR/system/install/Kconfig" +endmenu + +menu "readline() support" +source "$APPSDIR/system/readline/Kconfig" +endmenu diff --git a/apps/system/i2c/Kconfig b/apps/system/i2c/Kconfig index ae2bf3130..8573720b8 100644 --- a/apps/system/i2c/Kconfig +++ b/apps/system/i2c/Kconfig @@ -2,3 +2,49 @@ # For a description of the syntax of this configuration file, # see misc/tools/kconfig-language.txt. # + +#if I2C +config I2CTOOL_BUILTIN + int "NSH built-in command" + default y + depends on NSH_BUILTIN_APPS + ---help--- + Build the tools as an NSH built-in command + +config I2CTOOL_MINBUS + int "Minimum bus number" + default 0 + ---help--- + Smallest bus index supported by the hardware (default 0). + +config I2CTOOL_MAXBUS + int "Maximum bus number" + default 3 + ---help--- + Largest bus index supported by the hardware (default 3) + +config I2CTOOL_MINADDR + int "Minimum I2C address" + default 0x03 + ---help--- + Minium 7-bit device address (default: 0x03) + +config I2CTOOL_MAXADDR + int "Maximum I2C address" + default 0x77 + ---help--- + Largest 7-bit device address (default: 0x77) + +config I2CTOOL_MAXREGADDR + int "Maximum I2C register address" + default 0xff + ---help--- + Largest I2C register address (default: 0xff) + +config I2CTOOL_DEFFREQ + int "Default I2C frequency" + default 4000000 + ---help--- + Default I2C frequency (default: 4000000) + +#endif
\ No newline at end of file diff --git a/apps/system/readline/Kconfig b/apps/system/readline/Kconfig index ae2bf3130..11aedf0c3 100644 --- a/apps/system/readline/Kconfig +++ b/apps/system/readline/Kconfig @@ -2,3 +2,30 @@ # For a description of the syntax of this configuration file, # see misc/tools/kconfig-language.txt. # + +config READLINE_ECHO + bool "Echo character input" + default y + ---help--- + Echo received character input back via stdout. This is normal + behavior and should be selected unless the source of stdin input + already has local echo support or you need to suppress the back-channel + responses for any other reason. + +choice + prompt "Newline Options" + default EOL_IS_EITHER_CRLF + +config EOL_IS_CR + bool "EOL is CR" + +config EOL_IS_LF + bool "EOL is LF" + +config EOL_IS_BOTH_CRLF + bool "EOL is CR and LF" + +config EOL_IS_EITHER_CRLF + bool "EOL is CR or LF" + +endchoice diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c index 2f297d09f..948ee4510 100755 --- a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c @@ -1027,6 +1027,11 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv, if (privreq->req.len == 0) { + /* The ZLP flag is set TRUE whenever we want to force the driver to + * send a zero-length-packet on the next pass through the loop (below). + * The flag is cleared whenever a packet is sent in the loop below. + */ + privep->zlp = true; } @@ -1043,6 +1048,10 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv, bytesleft = privreq->req.len - privreq->req.xfrd; nbytes = bytesleft; + /* Assume no zero-length-packet on the next pass through this loop */ + + privep->zlp = false; + /* Limit the size of the transfer to one full packet and handle * zero-length packets (ZLPs). */ @@ -1053,7 +1062,6 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv, * the request. */ - privep->zlp = false; if (nbytes >= privep->ep.maxpacket) { nbytes = privep->ep.maxpacket; @@ -1066,6 +1074,14 @@ static void stm32_epin_request(FAR struct stm32_usbdev_s *priv, if (bytesleft == privep->ep.maxpacket && (privreq->req.flags & USBDEV_REQFLAGS_NULLPKT) != 0) { + /* The ZLP flag is set TRUE whenever we want to force + * the driver to send a zero-length-packet on the next + * pass through this loop. The flag is cleared (above) + * whenever we are committed to sending any packet and + * set here when we want to force one more pass through + * the loop. + */ + privep->zlp = true; } } |