rewrite wifi crate
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use crate::card::model::RawCard;
|
||||
use crate::peripherals::Mutex;
|
||||
use crate::peripherals::storage::Nvs;
|
||||
use alloc::sync::Arc;
|
||||
use alloc::vec::Vec;
|
||||
use binary_serde::{BinarySerde, DeserializeError, Endianness};
|
||||
use core::error::Error;
|
||||
@@ -67,11 +68,11 @@ impl CardStoreMetaData {
|
||||
}
|
||||
|
||||
pub struct CardStore {
|
||||
nvs: Mutex<Nvs>,
|
||||
nvs: Arc<Mutex<Nvs>>,
|
||||
}
|
||||
|
||||
impl CardStore {
|
||||
pub async fn new(nvs: Mutex<Nvs>) -> Result<Self, CardStoreError> {
|
||||
pub async fn new(nvs: Arc<Mutex<Nvs>>) -> Result<Self, CardStoreError> {
|
||||
if !Self::is_initialized(&nvs).await? {
|
||||
log::info!("CardStore has not been initialized");
|
||||
Self::initialize(&nvs).await?;
|
||||
|
||||
Reference in New Issue
Block a user