file up & download and delete
This commit is contained in:
@@ -31,8 +31,6 @@ use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_sync::mutex::{Mutex, MutexGuard};
|
||||
use embassy_sync::once_lock::OnceLock;
|
||||
use embassy_time::Timer;
|
||||
use esp_alloc::heap_allocator;
|
||||
use esp_bootloader_esp_idf::ota::OtaImageState;
|
||||
use esp_hal::rom::ets_delay_us;
|
||||
use esp_hal::system::software_reset;
|
||||
use esp_println::{logger, println};
|
||||
@@ -317,8 +315,7 @@ async fn safe_main(spawner: Spawner) -> anyhow::Result<()> {
|
||||
info!("executing config mode override");
|
||||
//config upload will trigger reboot!
|
||||
let reboot_now = Arc::new(AtomicBool::new(false));
|
||||
//TODO
|
||||
//let _webserver = httpd(reboot_now.clone());
|
||||
//spawner.spawn(httpd(reboot_now.clone(), stack))?;
|
||||
let board = BOARD_ACCESS.get().await.lock().await;
|
||||
wait_infinity(board, WaitType::ConfigButton, reboot_now.clone()).await;
|
||||
} else {
|
||||
@@ -667,7 +664,8 @@ pub async fn do_secure_pump(
|
||||
current_ma as u32,
|
||||
plant_config.max_pump_current_ma.to_string().as_str(),
|
||||
step.to_string().as_str(),
|
||||
);
|
||||
)
|
||||
.await;
|
||||
board.board_hal.general_fault(true).await;
|
||||
board.board_hal.fault(plant_id, true).await?;
|
||||
if !plant_config.ignore_current_error {
|
||||
@@ -686,7 +684,8 @@ pub async fn do_secure_pump(
|
||||
current_ma as u32,
|
||||
plant_config.min_pump_current_ma.to_string().as_str(),
|
||||
step.to_string().as_str(),
|
||||
);
|
||||
)
|
||||
.await;
|
||||
board.board_hal.general_fault(true).await;
|
||||
board.board_hal.fault(plant_id, true).await?;
|
||||
if !plant_config.ignore_current_error {
|
||||
@@ -706,7 +705,8 @@ pub async fn do_secure_pump(
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
);
|
||||
)
|
||||
.await;
|
||||
error = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -840,7 +840,7 @@ async fn update_charge_indicator(board: &mut MutexGuard<'_, CriticalSectionRawMu
|
||||
// }
|
||||
|
||||
async fn publish_firmware_info(
|
||||
mut board: &mut MutexGuard<'_, CriticalSectionRawMutex, HAL<'static>>,
|
||||
board: &mut MutexGuard<'_, CriticalSectionRawMutex, HAL<'static>>,
|
||||
version: VersionInfo,
|
||||
ip_address: &String,
|
||||
timezone_time: &String,
|
||||
@@ -867,17 +867,6 @@ async fn publish_firmware_info(
|
||||
let _ = esp.mqtt_publish("/state", "online".as_bytes()).await;
|
||||
}
|
||||
|
||||
fn state_to_string(state: OtaImageState) -> &'static str {
|
||||
match state {
|
||||
OtaImageState::New => "New",
|
||||
OtaImageState::PendingVerify => "PendingVerify",
|
||||
OtaImageState::Valid => "Valid",
|
||||
OtaImageState::Invalid => "Invalid",
|
||||
OtaImageState::Aborted => "Aborted",
|
||||
OtaImageState::Undefined => "Undefined",
|
||||
}
|
||||
}
|
||||
|
||||
async fn try_connect_wifi_sntp_mqtt() -> NetworkMode {
|
||||
let board = &mut BOARD_ACCESS.get().await.lock().await;
|
||||
let nw_conf = &board.board_hal.get_config().network.clone();
|
||||
|
||||
Reference in New Issue
Block a user