forked from M-Labs/ionpak-thermostat
style
This commit is contained in:
parent
e126bc0fe1
commit
87de8b7859
@ -154,8 +154,7 @@ fn report(input: &[u8]) -> IResult<&[u8], Command> {
|
|||||||
preceded(
|
preceded(
|
||||||
whitespace,
|
whitespace,
|
||||||
// `report mode <on | off>` - Switch repoting mode
|
// `report mode <on | off>` - Switch repoting mode
|
||||||
map(off_on,
|
map(off_on, Command::Reporting)
|
||||||
|reporting| Command::Reporting(reporting))
|
|
||||||
),
|
),
|
||||||
// `report mode` - Show current reporting state
|
// `report mode` - Show current reporting state
|
||||||
value(Command::Show(ShowCommand::Reporting), end)
|
value(Command::Show(ShowCommand::Reporting), end)
|
||||||
@ -235,16 +234,14 @@ fn pid_parameter(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
|||||||
|
|
||||||
/// `pid` | pid_parameter
|
/// `pid` | pid_parameter
|
||||||
fn pid(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
fn pid(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
preceded(
|
let (input, _) = tag("pid")(input)?;
|
||||||
tag("pid"),
|
|
||||||
alt((
|
alt((
|
||||||
preceded(
|
preceded(
|
||||||
whitespace,
|
whitespace,
|
||||||
pid_parameter
|
pid_parameter
|
||||||
),
|
),
|
||||||
value(Ok(Command::Show(ShowCommand::Pid)), end)
|
value(Ok(Command::Show(ShowCommand::Pid)), end)
|
||||||
))
|
))(input)
|
||||||
)(input)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn command(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
fn command(input: &[u8]) -> IResult<&[u8], Result<Command, Error>> {
|
||||||
|
@ -138,7 +138,7 @@ fn main() -> ! {
|
|||||||
writeln!(stdout, "ADC id: {:04X}", id).unwrap();
|
writeln!(stdout, "ADC id: {:04X}", id).unwrap();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Ok(id) => {
|
Ok(_id) => {
|
||||||
// This always happens on the first attempt. So retry silently
|
// This always happens on the first attempt. So retry silently
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user