rewrite wifi crate

This commit is contained in:
2026-09-02 20:11:40 +02:00
parent 0aa1370a2b
commit 240e2b081d
7 changed files with 110 additions and 150 deletions
+3 -2
View File
@@ -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?;