This commit is contained in:
Empire 2024-05-01 21:00:49 +02:00
parent dd91973f9b
commit e2d00bc939
3 changed files with 7 additions and 15 deletions

View File

@ -4,18 +4,11 @@ target = "riscv32imac-esp-espidf"
[target.riscv32imac-esp-espidf]
linker = "ldproxy"
#runner = "espflash flash --monitor --partition-table partitions.csv" # Select this runner for espflash v2.x.x
# runner = "espflash flash --monitor --partition-table partitions.csv -b no-reset" # Select this runner for espflash v2.x.x
runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv -b no-reset" # Select this runner for espflash v2.x.x
# runner = espflash erase-parts otadata
runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv" # Select this runner for espflash v2.x.x
# runner = "cargo runner"
rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110
[target.xtensa-esp32-espidf]
linker = "ldproxy"
#runner = "espflash flash --monitor --partition-table partitions.csv" # Select this runner for espflash v2.x.x
# runner = espflash erase-parts otadata
runner = "espflash flash --monitor --baud 921600 --partition-table partitions.csv" # Select this runner for espflash v2.x.x
#runner = "cargo runner"
# runner = "cargo runner"
rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110
[unstable]

View File

@ -386,7 +386,10 @@ fn safe_main() -> anyhow::Result<()> {
&mut board,
);
if STAY_ALIVE.load(std::sync::atomic::Ordering::Relaxed) {
let stay_alive = STAY_ALIVE.load(std::sync::atomic::Ordering::Relaxed);
println!("Check stay alive, current state is {}", stay_alive);
if stay_alive {
drop(board);
let reboot_now = Arc::new(AtomicBool::new(false));
let _webserver = httpd(reboot_now.clone());

View File

@ -651,7 +651,6 @@ impl PlantCtrlBoardInteraction for PlantCtrlBoard<'_> {
let mut client =
EspMqttClient::new_cb(&config.mqtt_url, &mqtt_client_config, move |event| {
let payload = event.payload();
println!("received mqtt event {:?}", payload);
match payload {
embedded_svc::mqtt::client::EventPayload::Received {
id: _,
@ -968,9 +967,6 @@ impl CreatePlantHal<'_> for PlantHal {
esp!(unsafe { esp_idf_sys::i2c_get_timeout(i2c_port, &mut timeout)}).unwrap();
println!("init i2c timeout is {}", timeout);
loop {
unsafe { vTaskDelay(1) }
}
//esp!(unsafe { esp_idf_sys::i2c_set_timeout(i2c_port, 22)}).unwrap();
let mut battery_driver: Bq34z100g1Driver<I2cDriver, Delay> = Bq34z100g1Driver {