refactor: consolidate logging and time handling, remove TIME_ACCESS and LOG_ACCESS

This commit is contained in:
2026-04-10 18:53:30 +02:00
parent 301298522b
commit bc25fef5ec
7 changed files with 232 additions and 302 deletions

View File

@@ -1,6 +1,6 @@
use crate::config::PlantControllerConfig;
use crate::fat_error::FatResult;
use crate::hal::{esp_set_time, Detection};
use crate::hal::Detection;
use crate::webserver::read_up_to_bytes_from_request;
use crate::{do_secure_pump, BOARD_ACCESS};
use alloc::string::{String, ToString};
@@ -109,7 +109,8 @@ where
let actual_data = read_up_to_bytes_from_request(request, None).await?;
let time: SetTime = serde_json::from_slice(&actual_data)?;
let parsed = DateTime::parse_from_rfc3339(time.time)?;
esp_set_time(parsed).await?;
let mut board = BOARD_ACCESS.get().await.lock().await;
board.board_hal.set_time(&parsed).await?;
Ok(None)
}