#![doc = include_str!("../README.md")]
#![no_std]
#![warn(missing_docs)]
#![allow(async_fn_in_trait)]
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))]
extern crate alloc;
mod fmt;
pub mod config_storage;
#[cfg(feature = "portal")]
pub mod portal;
#[cfg(feature = "portal")]
mod run_http;
#[cfg(all(feature = "portal", feature = "debug-server"))]
pub use run_http::run_http_debug_loop;
#[cfg(feature = "portal")]
pub use run_http::{ConfigUiOptions, run_http_config_loop};
#[doc(hidden)]
#[derive(Clone, Copy, Debug)]
pub struct ConfigStorageParams {
pub magic: u32,
pub format_version: u32,
}
pub struct ConfigHandle<C: 'static> {
config: &'static embassy_sync::mutex::Mutex<
embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex,
C,
>,
}
impl<C: 'static> ConfigHandle<C> {
pub fn new(
config: &'static embassy_sync::mutex::Mutex<
embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex,
C,
>,
) -> Self {
Self { config }
}
pub fn config(
&self,
) -> &'static embassy_sync::mutex::Mutex<
embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex,
C,
> {
self.config
}
}