Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Enable https://rust-lang.github.io/rust-clippy/master/index.html#large_stack_frames with a threshold of 1024 (#241)

### Changed

### Fixed
Expand Down
1 change: 1 addition & 0 deletions template/.clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stack-size-threshold = 1024
7 changes: 6 additions & 1 deletion template/src/bin/async_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
reason = "mem::forget is generally not safe to do with esp_hal types, especially those \
holding buffers for the duration of a data transfer."
)]
#![deny(clippy::large_stack_frames)]

use esp_hal::clock::CpuClock;
use esp_hal::timer::timg::TimerGroup;
Expand Down Expand Up @@ -57,6 +58,10 @@ const L2CAP_CHANNELS_MAX: usize = 1;
// For more information see: <https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/app_image_format.html#application-description>
esp_bootloader_esp_idf::esp_app_desc!();

#[allow(
clippy::large_stack_frames,
reason = "it's not unusual to allocate larger buffers etc. in main"
)]
#[esp_rtos::main]
async fn main(spawner: Spawner) -> ! {
//REPLACE generate-version generate-version
Expand Down Expand Up @@ -110,7 +115,7 @@ async fn main(spawner: Spawner) -> ! {
//IF option("ble-trouble")
// find more examples https://github.com/embassy-rs/trouble/tree/main/examples/esp32
let transport = BleConnector::new(&radio_init, peripherals.BT, Default::default()).unwrap();
let ble_controller = ExternalController::<_, 20>::new(transport);
let ble_controller = ExternalController::<_, 1>::new(transport);
let mut resources: HostResources<DefaultPacketPool, CONNECTIONS_MAX, L2CAP_CHANNELS_MAX> =
HostResources::new();
let _stack = trouble_host::new(ble_controller, &mut resources);
Expand Down
5 changes: 5 additions & 0 deletions template/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
reason = "mem::forget is generally not safe to do with esp_hal types, especially those \
holding buffers for the duration of a data transfer."
)]
#![deny(clippy::large_stack_frames)]

use esp_hal::{
clock::CpuClock,
Expand Down Expand Up @@ -49,6 +50,10 @@ extern crate alloc;
// For more information see: <https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/app_image_format.html#application-description>
esp_bootloader_esp_idf::esp_app_desc!();

#[allow(
clippy::large_stack_frames,
reason = "it's not unusual to allocate larger buffers etc. in main"
)]
#[main]
fn main() -> ! {
//REPLACE generate-version generate-version
Expand Down