Skip to content

Commit

Permalink
Configure burst size on async Device, allow 0 as no maximum (esp-rs#308)
Browse files Browse the repository at this point in the history
* Set burst size for async Driver

* Use 0 to indicate no max burst size
  • Loading branch information
bugadani authored and bjoernQ committed May 23, 2024
1 parent 29cc491 commit 27e24a6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions esp-wifi/src/wifi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,11 @@ impl Device for WifiDevice<'_> {
fn capabilities(&self) -> smoltcp::phy::DeviceCapabilities {
let mut caps = DeviceCapabilities::default();
caps.max_transmission_unit = MTU;
caps.max_burst_size = Some(crate::CONFIG.max_burst_size);
caps.max_burst_size = if crate::CONFIG.max_burst_size == 0 {
None
} else {
Some(crate::CONFIG.max_burst_size)
};
caps
}
}
Expand Down Expand Up @@ -1350,7 +1354,11 @@ pub(crate) mod embassy {
fn capabilities(&self) -> Capabilities {
let mut caps = Capabilities::default();
caps.max_transmission_unit = MTU;
caps.max_burst_size = Some(1);
caps.max_burst_size = if crate::CONFIG.max_burst_size == 0 {
None
} else {
Some(crate::CONFIG.max_burst_size)
};
caps
}

Expand Down

0 comments on commit 27e24a6

Please sign in to comment.