Skip to content

Commit

Permalink
writeln! -> println!
Browse files Browse the repository at this point in the history
  • Loading branch information
playfulFence committed Nov 22, 2024
1 parent 3dee2df commit 1a43162
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 79 deletions.
12 changes: 2 additions & 10 deletions esp-hal/src/rom/md5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,24 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::rom::md5;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//! # let mut uart0 = Uart::new(peripherals.UART0, peripherals.GPIO1, peripherals.GPIO2).unwrap();
//! # let data = "Dummy";
//! let d: md5::Digest = md5::compute(&data);
//! writeln!(uart0, "{}", d);
//! println!("{}", d);
//! # }
//! ```
//!
//! ### Compute a Digest Over Multiple Buffers
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::rom::md5;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//! # let mut uart0 = Uart::new(peripherals.UART0, peripherals.GPIO1, peripherals.GPIO2).unwrap();
//! # let data0 = "Dummy";
//! # let data1 = "Dummy";
//! #
//! let mut ctx = md5::Context::new();
//! ctx.consume(&data0);
//! ctx.consume(&data1);
//! let d: md5::Digest = ctx.compute();
//! writeln!(uart0, "{}", d);
//! println!("{}", d);
//! # }
//! ```
//!
Expand Down
22 changes: 7 additions & 15 deletions esp-hal/src/soc/esp32/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,10 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::efuse::Efuse;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//!
//! let mut serial_tx =
//! Uart::new(peripherals.UART0, peripherals.GPIO4,
//! peripherals.GPIO5).unwrap();
//!
//! let mac_address = Efuse::read_base_mac_address();
//!
//! writeln!(
//! serial_tx,
//! println!(
//! "MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
//! mac_address[0],
//! mac_address[1],
Expand All @@ -45,12 +37,12 @@
//! mac_address[5]
//! );
//!
//! writeln!(serial_tx, "MAC address {:02x?}", Efuse::mac_address());
//! writeln!(serial_tx, "Flash Encryption {:?}", Efuse::flash_encryption());
//! writeln!(serial_tx, "Core Count {}", Efuse::core_count());
//! writeln!(serial_tx, "Bluetooth enabled {}", Efuse::is_bluetooth_enabled());
//! writeln!(serial_tx, "Chip type {:?}", Efuse::chip_type());
//! writeln!(serial_tx, "Max CPU clock {:?}", Efuse::max_cpu_frequency());
//! println!("MAC address {:02x?}", Efuse::mac_address());
//! println!("Flash Encryption {:?}", Efuse::flash_encryption());
//! println!("Core Count {}", Efuse::core_count());
//! println!("Bluetooth enabled {}", Efuse::is_bluetooth_enabled());
//! println!("Chip type {:?}", Efuse::chip_type());
//! println!("Max CPU clock {:?}", Efuse::max_cpu_frequency());
//! # }
//! ```

Expand Down
14 changes: 5 additions & 9 deletions esp-hal/src/soc/esp32c2/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::efuse::Efuse;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//!
//! let mut serial_tx = Uart::new(peripherals.UART0, peripherals.GPIO4,
//! peripherals.GPIO5).unwrap(); let mac_address =
//! Efuse::read_base_mac_address(); writeln!(
//! serial_tx,
//! let mac_address = Efuse::read_base_mac_address();
//!
//! println!(
//! "MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
//! mac_address[0],
//! mac_address[1],
Expand All @@ -38,8 +34,8 @@
//! mac_address[5]
//! );
//!
//! writeln!(serial_tx, "MAC address {:02x?}", Efuse::mac_address());
//! writeln!(serial_tx, "Flash Encryption {:?}", Efuse::flash_encryption());
//! println!("MAC address {:02x?}", Efuse::mac_address());
//! println!("Flash Encryption {:?}", Efuse::flash_encryption());
//! # }
//! ```

Expand Down
14 changes: 5 additions & 9 deletions esp-hal/src/soc/esp32c3/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::efuse::Efuse;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//!
//! let mut serial_tx = Uart::new(peripherals.UART0, peripherals.GPIO4,
//! peripherals.GPIO5).unwrap(); let mac_address =
//! Efuse::read_base_mac_address(); writeln!(
//! serial_tx,
//! let mac_address = Efuse::read_base_mac_address();
//!
//! println!(
//! "MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
//! mac_address[0],
//! mac_address[1],
Expand All @@ -39,8 +35,8 @@
//! mac_address[5]
//! );
//!
//! writeln!(serial_tx, "MAC address {:02x?}", Efuse::mac_address());
//! writeln!(serial_tx, "Flash Encryption {:?}", Efuse::flash_encryption());
//! println!("MAC address {:02x?}", Efuse::mac_address());
//! println!("Flash Encryption {:?}", Efuse::flash_encryption());
//! # }
//! ```

Expand Down
14 changes: 5 additions & 9 deletions esp-hal/src/soc/esp32c6/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::efuse::Efuse;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//!
//! let mut serial_tx = Uart::new(peripherals.UART0, peripherals.GPIO4,
//! peripherals.GPIO5).unwrap(); let mac_address =
//! Efuse::read_base_mac_address(); writeln!(
//! serial_tx,
//! let mac_address = Efuse::read_base_mac_address();
//!
//! println!(
//! "MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
//! mac_address[0],
//! mac_address[1],
Expand All @@ -39,8 +35,8 @@
//! mac_address[5]
//! );
//!
//! writeln!(serial_tx, "MAC address {:02x?}", Efuse::mac_address());
//! writeln!(serial_tx, "Flash Encryption {:?}", Efuse::flash_encryption());
//! println!("MAC address {:02x?}", Efuse::mac_address());
//! println!("Flash Encryption {:?}", Efuse::flash_encryption());
//! # }
//! ```

Expand Down
14 changes: 5 additions & 9 deletions esp-hal/src/soc/esp32h2/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::efuse::Efuse;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//!
//! let mut serial_tx = Uart::new(peripherals.UART0, peripherals.GPIO4,
//! peripherals.GPIO5).unwrap(); let mac_address =
//! Efuse::read_base_mac_address(); writeln!(
//! serial_tx,
//! let mac_address = Efuse::read_base_mac_address();
//!
//! println!(
//! "MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
//! mac_address[0],
//! mac_address[1],
Expand All @@ -39,8 +35,8 @@
//! mac_address[5]
//! );
//!
//! writeln!(serial_tx, "MAC address {:02x?}", Efuse::mac_address());
//! writeln!(serial_tx, "Flash Encryption {:?}", Efuse::flash_encryption());
//! println!("MAC address {:02x?}", Efuse::mac_address());
//! println!("Flash Encryption {:?}", Efuse::flash_encryption());
//! # }
//! ```

Expand Down
14 changes: 5 additions & 9 deletions esp-hal/src/soc/esp32s2/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::efuse::Efuse;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//!
//! let mut serial_tx = Uart::new(peripherals.UART0, peripherals.GPIO4,
//! peripherals.GPIO5).unwrap(); let mac_address =
//! Efuse::read_base_mac_address(); writeln!(
//! serial_tx,
//! let mac_address = Efuse::read_base_mac_address();
//!
//! println!(
//! "MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
//! mac_address[0],
//! mac_address[1],
Expand All @@ -41,8 +37,8 @@
//! mac_address[5]
//! );
//!
//! writeln!(serial_tx, "MAC address {:02x?}", Efuse::mac_address());
//! writeln!(serial_tx, "Flash Encryption {:?}", Efuse::flash_encryption());
//! println!("MAC address {:02x?}", Efuse::mac_address());
//! println!("Flash Encryption {:?}", Efuse::flash_encryption());
//! # }
//! ```

Expand Down
14 changes: 5 additions & 9 deletions esp-hal/src/soc/esp32s3/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@
//! ```rust, no_run
#![doc = crate::before_snippet!()]
//! # use esp_hal::efuse::Efuse;
//! # use esp_hal::uart::Uart;
//! # use core::writeln;
//! # use core::fmt::Write;
//!
//! let mut serial_tx = Uart::new(peripherals.UART0, peripherals.GPIO4,
//! peripherals.GPIO5).unwrap(); let mac_address =
//! Efuse::read_base_mac_address(); writeln!(
//! serial_tx,
//! let mac_address = Efuse::read_base_mac_address();
//!
//! println!(
//! "MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
//! mac_address[0],
//! mac_address[1],
Expand All @@ -39,8 +35,8 @@
//! mac_address[5]
//! );
//!
//! writeln!(serial_tx, "MAC address {:02x?}", Efuse::mac_address());
//! writeln!(serial_tx, "Flash Encryption {:?}", Efuse::flash_encryption());
//! println!("MAC address {:02x?}", Efuse::mac_address());
//! println!("Flash Encryption {:?}", Efuse::flash_encryption());
//! # }
//! ```

Expand Down

0 comments on commit 1a43162

Please sign in to comment.