diff --git a/firmware/src/command_parser.rs b/firmware/src/command_parser.rs index 49c00c4..c5e202b 100644 --- a/firmware/src/command_parser.rs +++ b/firmware/src/command_parser.rs @@ -193,6 +193,7 @@ fn pwm(input: &[u8]) -> IResult<&[u8], Result> { ))(input) } +/// `pid ` fn pid_parameter(input: &[u8]) -> IResult<&[u8], Result> { let (input, parameter) = alt((value(PidParameter::Target, tag("target")), @@ -212,18 +213,18 @@ fn pid_parameter(input: &[u8]) -> IResult<&[u8], Result> { Ok((input, result)) } -/// `pid ` +/// `pid` | pid_parameter fn pid(input: &[u8]) -> IResult<&[u8], Result> { - let (input, _) = tag("pid")(input)?; - let (input, _) = whitespace(input)?; - - alt(( - preceded( - whitespace, - pid_parameter - ), - value(Ok(Command::Show(ShowCommand::Pid)), end) - ))(input) + preceded( + tag("pid"), + alt(( + preceded( + whitespace, + pid_parameter + ), + value(Ok(Command::Show(ShowCommand::Pid)), end) + )) + )(input) } fn command(input: &[u8]) -> IResult<&[u8], Result> {