From aacb0ed4afeb1a041460b0fe1f320a26d2df1f5b Mon Sep 17 00:00:00 2001 From: Robin Mueller <31589589+robamu@users.noreply.github.com> Date: Sun, 2 Jun 2024 03:56:26 +0200 Subject: [PATCH] fixed some smaller errors and warnings (#71) --- .cargo/{config => config.toml} | 2 +- freertos-rust-examples/build.rs | 8 +++++--- freertos-rust-examples/examples/linux/main.rs | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) rename .cargo/{config => config.toml} (94%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 94% rename from .cargo/config rename to .cargo/config.toml index 07b7550..bef8fc2 100644 --- a/.cargo/config +++ b/.cargo/config.toml @@ -20,4 +20,4 @@ rustflags = [ # target = "x86_64-pc-windows-gnu" # Windows GNU Toolchain # target = "x86_64-pc-windows-msvc" # Windows MSVC Toolchain (no debugging) # target = "thumbv7m-none-eabi" # Cortex-M3 -# target = "thumbv7em-none-eabihf" # Cortex-M4 \ No newline at end of file +# target = "thumbv7em-none-eabihf" # Cortex-M4 diff --git a/freertos-rust-examples/build.rs b/freertos-rust-examples/build.rs index 4513f44..0688c70 100644 --- a/freertos-rust-examples/build.rs +++ b/freertos-rust-examples/build.rs @@ -41,7 +41,8 @@ fn main() { copy( "examples/stm32-cortex-m3/memory.x", PathBuf::from(out_dir.as_str()).join("memory.x"), - ).unwrap(); + ) + .unwrap(); } if target == "thumbv7em-none-eabihf" { b.freertos_config("examples/stm32-cortex-m4-blackpill"); @@ -56,10 +57,11 @@ fn main() { copy( "examples/nrf9160/memory.x", PathBuf::from(out_dir.as_str()).join("memory.x"), - ).unwrap(); + ) + .unwrap(); } - b.compile().unwrap_or_else(|e| { panic!(e.to_string()) }); + b.compile().unwrap_or_else(|e| panic!("{}", e)); } /// Print relevant environment variables diff --git a/freertos-rust-examples/examples/linux/main.rs b/freertos-rust-examples/examples/linux/main.rs index a052656..5703d7e 100644 --- a/freertos-rust-examples/examples/linux/main.rs +++ b/freertos-rust-examples/examples/linux/main.rs @@ -29,6 +29,7 @@ fn main() { // println!("Free Memory: {}!", free); println!("Starting scheduler"); FreeRtosUtils::start_scheduler(); + #[allow(unreachable_code)] loop { println!("Loop forever!"); }