Correct day bounds

pull/8/head
James Munns 2021-02-21 22:47:59 +01:00 committed by Diego Barrios Romero
parent a28b7c76fc
commit b8ab37f57a
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ where
}
fn set_day(&mut self, day: u8) -> Result<(), Self::Error> {
if day < 1 || day > 7 {
if day < 1 || day > 31 {
return Err(Error::InvalidInputData);
}
self.iface.write_register(Register::DOM, day)

View File

@ -157,7 +157,7 @@ mod day {
use super::*;
get_param_test!(get, get_day, DOM, 1, 1);
set_param_test!(set, set_day, DOM, 1, 1);
set_invalid_param_range_test!(invalid, set_day, 0, 8);
set_invalid_param_range_test!(invalid, set_day, 0, 32);
}
mod month {