Skip to content

Commit

Permalink
fix fmt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TuEmb committed Jan 23, 2025
1 parent 9dfe5d7 commit e33f58d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
7 changes: 6 additions & 1 deletion esp-mbedtls/src/esp_hal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ use esp_hal::sha::Sha;

use crate::{Tls, TlsError};

#[cfg(any(feature = "esp32c3", feature = "esp32c6", feature = "esp32s2", feature = "esp32s3"))]
#[cfg(any(
feature = "esp32c3",
feature = "esp32c6",
feature = "esp32s2",
feature = "esp32s3"
))]
mod bignum;
#[cfg(not(feature = "esp32"))]
mod sha;
Expand Down
6 changes: 3 additions & 3 deletions esp-mbedtls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ pub mod io {

#[cfg(feature = "esp32c6")]
#[no_mangle]
unsafe extern "C" fn memchr(ptr: *const u8, ch: u8, count: usize) -> *const u8{
unsafe extern "C" fn memchr(ptr: *const u8, ch: u8, count: usize) -> *const u8 {
for i in 0..count {
if ptr.add(i).read() == ch {
return ptr.add(i);
}
}
}

return core::ptr::null()
return core::ptr::null();
}

unsafe fn aligned_calloc(_align: usize, size: usize) -> *const c_void {
Expand Down
4 changes: 3 additions & 1 deletion examples/async_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.capabilities());
#[cfg(feature = "esp32c6")]
controller.set_power_saving(esp_wifi::config::PowerSaveMode::None).unwrap();
controller
.set_power_saving(esp_wifi::config::PowerSaveMode::None)
.unwrap();
loop {
if matches!(esp_wifi::wifi::wifi_state(), WifiState::StaConnected) {
// wait until we're no longer connected
Expand Down
4 changes: 3 additions & 1 deletion examples/async_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.capabilities());
#[cfg(feature = "esp32c6")]
controller.set_power_saving(esp_wifi::config::PowerSaveMode::None).unwrap();
controller
.set_power_saving(esp_wifi::config::PowerSaveMode::None)
.unwrap();
loop {
if matches!(esp_wifi::wifi::wifi_state(), WifiState::StaConnected) {
// wait until we're no longer connected
Expand Down
4 changes: 3 additions & 1 deletion examples/edge_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.capabilities());
#[cfg(feature = "esp32c6")]
controller.set_power_saving(esp_wifi::config::PowerSaveMode::None).unwrap();
controller
.set_power_saving(esp_wifi::config::PowerSaveMode::None)
.unwrap();
loop {
if matches!(esp_wifi::wifi::wifi_state(), WifiState::StaConnected) {
// wait until we're no longer connected
Expand Down
4 changes: 3 additions & 1 deletion examples/sync_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ fn main() -> ! {
..Default::default()
});
#[cfg(feature = "esp32c6")]
controller.set_power_saving(esp_wifi::config::PowerSaveMode::None).unwrap();
controller
.set_power_saving(esp_wifi::config::PowerSaveMode::None)
.unwrap();
controller.set_configuration(&client_config).unwrap();
controller.start().unwrap();
controller.connect().unwrap();
Expand Down
4 changes: 3 additions & 1 deletion examples/sync_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ fn main() -> ! {
..Default::default()
});
#[cfg(feature = "esp32c6")]
controller.set_power_saving(esp_wifi::config::PowerSaveMode::None).unwrap();
controller
.set_power_saving(esp_wifi::config::PowerSaveMode::None)
.unwrap();
controller.set_configuration(&client_config).unwrap();
controller.start().unwrap();
controller.connect().unwrap();
Expand Down

0 comments on commit e33f58d

Please sign in to comment.