fix rtc storage

This commit is contained in:
2024-02-15 23:00:05 +01:00
parent 060a1cc32d
commit 680d1c3aaf
12 changed files with 8891 additions and 7909 deletions

View File

@@ -2,8 +2,9 @@
use core::cell::RefCell;
use core::mem::{self, MaybeUninit};
use std::convert::Infallible;
use crate::hal::digital::v2::OutputPin;
use hal::digital::OutputPin;
trait ShiftRegisterInternal {
fn update(&self, index: usize, command: bool) -> Result<(), ()>;
@@ -24,16 +25,18 @@ impl<'a> ShiftRegisterPin<'a> {
}
}
impl OutputPin for ShiftRegisterPin<'_> {
type Error = ();
impl embedded_hal::digital::ErrorType for ShiftRegisterPin<'_> {
type Error = Infallible;
}
fn set_low(&mut self) -> Result<(), Self::Error> {
self.shift_register.update(self.index, false)?;
impl OutputPin for ShiftRegisterPin<'_> {
fn set_low(&mut self) -> Result<(), Infallible> {
self.shift_register.update(self.index, false).unwrap();
Ok(())
}
fn set_high(&mut self) -> Result<(), Self::Error> {
self.shift_register.update(self.index, true)?;
fn set_high(&mut self) -> Result<(), Infallible> {
self.shift_register.update(self.index, true).unwrap();
Ok(())
}
}