mirror of https://github.com/eldruin/ds323x-rs
Correct day bounds
parent
a28b7c76fc
commit
b8ab37f57a
|
@ -137,7 +137,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_day(&mut self, day: u8) -> Result<(), Self::Error> {
|
fn set_day(&mut self, day: u8) -> Result<(), Self::Error> {
|
||||||
if day < 1 || day > 7 {
|
if day < 1 || day > 31 {
|
||||||
return Err(Error::InvalidInputData);
|
return Err(Error::InvalidInputData);
|
||||||
}
|
}
|
||||||
self.iface.write_register(Register::DOM, day)
|
self.iface.write_register(Register::DOM, day)
|
||||||
|
|
|
@ -157,7 +157,7 @@ mod day {
|
||||||
use super::*;
|
use super::*;
|
||||||
get_param_test!(get, get_day, DOM, 1, 1);
|
get_param_test!(get, get_day, DOM, 1, 1);
|
||||||
set_param_test!(set, set_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 {
|
mod month {
|
||||||
|
|
Loading…
Reference in New Issue