wifi: fix issue with initialization
tertiary display: implement feature flag to disable common: remove debug from cargo config, use ESP_LOG="creaturedex:debug"
This commit was merged in pull request #65.
This commit is contained in:
+14
-6
@@ -129,15 +129,24 @@ async fn main(spawner: Spawner) {
|
||||
.expect("failed to create nvs"),
|
||||
));
|
||||
|
||||
let wifi_store = WifiStore::new(nvs.clone()).await.expect("Could not initialize WiFi store");
|
||||
let init_credentials = Wifi::initialize_credentials(&wifi_store).await.expect("Could not get init WiFi credentials");
|
||||
let wifi = Wifi::new(esp_peripherals.WIFI, init_credentials).await.expect("Could not initialize WiFi");
|
||||
let wifi_store = WifiStore::new(nvs.clone())
|
||||
.await
|
||||
.expect("Could not initialize WiFi store");
|
||||
|
||||
let mut wifi = Wifi::new(esp_peripherals.WIFI).expect("Could not initialize WiFi");
|
||||
|
||||
wifi.connect_with_stored_credentials(&wifi_store)
|
||||
.await
|
||||
.expect("could not connect initially");
|
||||
|
||||
let card_store = CardStore::new(nvs.clone())
|
||||
.await
|
||||
.expect("Could not initialize Card Store");
|
||||
|
||||
let store = Store { card_store, wifi_store };
|
||||
let store = Store {
|
||||
card_store,
|
||||
wifi_store,
|
||||
};
|
||||
let rtc = Rtc::new(esp_peripherals.LPWR);
|
||||
|
||||
let peripherals = Box::leak(Box::new(Peripherals {
|
||||
@@ -191,8 +200,7 @@ async fn main(spawner: Spawner) {
|
||||
.expect("nfc scanner task failed"),
|
||||
);
|
||||
spawner.spawn(
|
||||
wait_for_wifi_credentials(outputs, peripherals)
|
||||
.expect("wifi credential task failed"),
|
||||
wait_for_wifi_credentials(outputs, peripherals).expect("wifi credential task failed"),
|
||||
);
|
||||
|
||||
core::future::pending::<()>().await
|
||||
|
||||
Reference in New Issue
Block a user