diff --git a/Cargo.toml b/Cargo.toml index 1453647..d813729 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,6 @@ [package] # TODO fix `authors` and `name` if you didn't use `cargo-generate` -authors = ["{{authors}}"] -name = "{{project-name}}" +name = "test-app" edition = "2021" version = "0.1.0" diff --git a/README.md b/README.md index a460e18..e70ef25 100644 --- a/README.md +++ b/README.md @@ -25,28 +25,15 @@ $ # make sure to install v0.2.0 or later $ cargo install probe-run ``` -#### 3. [`cargo-generate`]: - -``` console -$ cargo install cargo-generate -``` - -[`cargo-generate`]: https://crates.io/crates/cargo-generate - -> *Note:* You can also just clone this repository instead of using `cargo-generate`, but this involves additional manual adjustments. - ## Setup -#### 1. Initialize the project template +#### 1. Clone the project template ``` console -$ cargo generate \ - --git https://github.com/rtic-rs/app-template \ - --branch main \ - --name my-app +$ git clone https://github.com/rtic-rs/app-template test-app ``` -If you look into your new `my-app` folder, you'll find that there are a few `TODO`s in the files marking the properties you need to set. +If you look into your new `test-app` folder, you'll find that there are a few `TODO`s in the files marking the properties you need to set. Let's walk through them together now. diff --git a/cargo-generate.toml b/cargo-generate.toml deleted file mode 100644 index 0cd15b6..0000000 --- a/cargo-generate.toml +++ /dev/null @@ -1,2 +0,0 @@ -[template] -ignore = ["README.md", "run-steps.sh"] diff --git a/run-steps.sh b/run-steps.sh index 1fd8ae7..7e077bf 100755 --- a/run-steps.sh +++ b/run-steps.sh @@ -4,14 +4,27 @@ set -ex project="test-app" +cleanup() { + echo "Cleaning up" + mv Cargo.toml.tmp Cargo.toml + mv .cargo/config.toml.tmp .cargo/config.toml +} + +if [ "$1" = "cleanup" ]; then + cleanup + exit 1 +fi + echo "Installing necessary tools" -cargo install flip-link cargo-generate sd +cargo install flip-link sd echo "Cleaning up old project" rm -rf "$project" echo "Creating new project" -cargo generate -p . --name "$project" +# cargo generate -p . --name "$project" +mkdir -p "$project" +cp -r Cargo.toml LICENSE-* src/ rust-toolchain.toml .cargo/ "$project" echo "Storing current config so that the child project will compile." mv Cargo.toml Cargo.toml.tmp @@ -32,6 +45,4 @@ sd -s 'FreeInterrupt1, ...' 'SWI0_EGU0' src/bin/minimal.rs cargo bbr minimal cd .. -echo "Cleaning up" -mv Cargo.toml.tmp Cargo.toml -mv .cargo/config.toml.tmp .cargo/config.toml \ No newline at end of file +cleanup \ No newline at end of file diff --git a/src/bin/minimal.rs b/src/bin/minimal.rs index 364d2b0..6ca39b0 100644 --- a/src/bin/minimal.rs +++ b/src/bin/minimal.rs @@ -2,7 +2,7 @@ #![no_std] #![feature(type_alias_impl_trait)] -use {{crate_name}} as _; // global logger + panicking-behavior + memory layout +use test_app as _; // global logger + panicking-behavior + memory layout #[rtic::app( device = some_hal::pac, // TODO: Replace `some_hal::pac` with the path to the PAC