Skip to content

Commit

Permalink
Log driver initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
zargony committed Aug 10, 2024
1 parent 09dedce commit 2d47bba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions firmware/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use embedded_graphics::pixelcolor::BinaryColor;
use embedded_graphics::prelude::*;
use embedded_graphics::text::{Alignment, Baseline, Text, TextStyleBuilder};
use embedded_hal::i2c::I2c;
use log::info;
use ssd1306::mode::{BufferedGraphicsMode, DisplayConfig};
use ssd1306::prelude::I2CInterface;
use ssd1306::rotation::DisplayRotation;
Expand Down Expand Up @@ -38,6 +39,8 @@ impl<I2C: I2c> Display<I2C> {
driver.clear(BinaryColor::Off)?;
driver.flush()?;

info!("Display: SSD1306 initialized");

Ok(Display { driver })
}

Expand Down
3 changes: 3 additions & 0 deletions firmware/src/keypad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use embassy_futures::select::select_array;
use embassy_time::{Duration, Timer};
use embedded_hal::digital::{InputPin, OutputPin};
use embedded_hal_async::digital::Wait;
use log::info;

const DEBOUNCE_TIME: Duration = Duration::from_millis(10);

Expand Down Expand Up @@ -71,6 +72,8 @@ where
{
/// Create matrix keypad from given input columns and output rows
pub fn new(cols: [IN; COLS], rows: [OUT; ROWS]) -> Self {
info!("Keypad: {}x{} matrix initialized", ROWS, COLS);

Self { cols, rows }
}

Expand Down
6 changes: 4 additions & 2 deletions firmware/src/wifi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ impl<'d> Wifi<'d> {
let init = esp_wifi::initialize(EspWifiInitFor::Wifi, timer, rng, radio_clocks, clocks)?;

let (device, mut controller) = wifi::new_with_mode(&init, wifi, WifiStaDevice)?;
debug!("Static Wifi configuration: {:?}", esp_wifi::CONFIG);
debug!("Wifi static configuration: {:?}", esp_wifi::CONFIG);
debug!("Wifi configuration: {:?}", controller.get_configuration());
debug!("Wifi capabilities: {:?}", controller.get_capabilities());
debug!("Wifi state: {:?}", wifi::get_wifi_state());

info!("Starting Wifi controller...");
debug!("Wifi: Starting controller...");
controller.start().await?;

info!("Wifi: Controller initialized");
debug!("Wifi state: {:?}", wifi::get_wifi_state());

Ok(Wifi {
Expand Down

0 comments on commit 2d47bba

Please sign in to comment.