v4 board impl

This commit is contained in:
2025-06-14 00:40:47 +02:00
parent 6499b18ada
commit 05400c7c4a
21 changed files with 471 additions and 116 deletions

View File

@@ -216,6 +216,7 @@ fn set_config(
) -> Result<Option<std::string::String>, anyhow::Error> {
let all = read_up_to_bytes_from_request(request, Some(3072))?;
let config: PlantControllerConfig = serde_json::from_slice(&all)?;
let mut board = BOARD_ACCESS.lock().unwrap();
board.esp.set_config(&config)?;
@@ -525,7 +526,7 @@ pub fn httpd(reboot_now: Arc<AtomicBool>) -> Box<EspHttpServer<'static>> {
server
.fn_handler("/file", Method::Post, move |mut request| {
let filename = query_param(request.uri(), "filename").unwrap();
let lock = BOARD_ACCESS.lock().unwrap();
let mut lock = BOARD_ACCESS.lock().unwrap();
let file_handle = lock.esp.get_file_handle(&filename, true);
match file_handle {
//TODO get free filesystem size, check against during write if not to large