Fix a error the the STM32 I2C timeout logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3940 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
15b765c68c
commit
ab04444d75
@ -187,7 +187,7 @@ int arg_decimal(FAR char **arg, FAR long *value)
|
||||
{
|
||||
FAR char *string;
|
||||
int ret;
|
||||
|
||||
|
||||
ret = arg_string(arg, &string);
|
||||
*value = strtol(string, NULL, 10);
|
||||
return ret;
|
||||
|
@ -253,7 +253,7 @@ FAR char *i2c_argument(FAR struct i2ctool_s *i2ctool, int argc, char *argv[], in
|
||||
|
||||
int i2c_parse(FAR struct i2ctool_s *i2ctool, int argc, char *argv[])
|
||||
{
|
||||
FAR char *newargs[MAX_ARGUMENTS+1];
|
||||
FAR char *newargs[MAX_ARGUMENTS+2];
|
||||
FAR char *cmd;
|
||||
int nargs;
|
||||
int index;
|
||||
@ -278,7 +278,7 @@ int i2c_parse(FAR struct i2ctool_s *i2ctool, int argc, char *argv[])
|
||||
/* Parse all of the arguments following the command name. */
|
||||
|
||||
newargs[0] = cmd;
|
||||
for (nargs = 1; nargs < MAX_ARGUMENTS; nargs++)
|
||||
for (nargs = 1; nargs <= MAX_ARGUMENTS; nargs++)
|
||||
{
|
||||
newargs[nargs] = i2c_argument(i2ctool, argc, argv, &index);
|
||||
if (!newargs[nargs])
|
||||
|
@ -91,10 +91,11 @@
|
||||
#endif
|
||||
|
||||
/* This is the maximum number of arguments that will be accepted for a
|
||||
* command
|
||||
* command. The only real limit is in the OS configuration that limits
|
||||
* the number of parameters passed to a task.
|
||||
*/
|
||||
|
||||
#define MAX_ARGUMENTS 6
|
||||
#define MAX_ARGUMENTS (CONFIG_MAX_TASK_ARGS-1)
|
||||
|
||||
/* Maximum size of one command line */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user