1#![doc = include_str!("../README.md")]
2#![no_std]
3#![warn(missing_docs)]
4#![allow(async_fn_in_trait)]
5#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))]
6
7extern crate alloc;
8
9mod fmt;
10
11pub mod config_storage;
12
13#[cfg(feature = "portal")]
14pub mod portal;
15#[cfg(feature = "portal")]
16mod run_http;
17
18#[cfg(all(feature = "portal", feature = "debug-server"))]
19pub use run_http::run_http_debug_loop;
20#[cfg(feature = "portal")]
21pub use run_http::{ConfigUiOptions, run_http_config_loop};
22
23#[doc(hidden)]
26#[derive(Clone, Copy, Debug)]
27pub struct ConfigStorageParams {
28 pub magic: u32,
30 pub format_version: u32,
32}
33
34pub struct ConfigHandle<C: 'static> {
38 config: &'static embassy_sync::mutex::Mutex<
39 embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex,
40 C,
41 >,
42}
43
44impl<C: 'static> ConfigHandle<C> {
45 pub fn new(
47 config: &'static embassy_sync::mutex::Mutex<
48 embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex,
49 C,
50 >,
51 ) -> Self {
52 Self { config }
53 }
54
55 pub fn config(
57 &self,
58 ) -> &'static embassy_sync::mutex::Mutex<
59 embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex,
60 C,
61 > {
62 self.config
63 }
64}