Add Storage and UpgradeStorage to Env

This commit is contained in:
Julien Cretin
2022-03-03 16:36:45 +01:00
parent d6e4c66562
commit c4a27bf935
21 changed files with 438 additions and 399 deletions

View File

@@ -24,19 +24,18 @@ use crate::ctap::CtapState;
use crate::env::Env;
use libtock_drivers::timer::ClockValue;
pub mod api;
// Implementation details must be public for testing (in particular fuzzing).
#[cfg(feature = "std")]
pub mod ctap;
#[cfg(not(feature = "std"))]
mod ctap;
// Store example binaries use the flash directly. Eventually, they should access it from env::tock.
pub mod embedded_flash;
pub mod env;
/// CTAP implementation parameterized by its environment.
pub struct Ctap<E: Env> {
env: E,
state: CtapState,
state: CtapState<E>,
hid: CtapHid,
}
@@ -50,7 +49,7 @@ impl<E: Env> Ctap<E> {
Ctap { env, state, hid }
}
pub fn state(&mut self) -> &mut CtapState {
pub fn state(&mut self) -> &mut CtapState<E> {
&mut self.state
}