diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 875c3f39d1..8205d63a4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: # Run cargo fmt --check, includes macros/ style: name: style - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -41,7 +41,7 @@ jobs: # Compilation check check: name: check - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: target: @@ -77,7 +77,7 @@ jobs: # Clippy clippy: name: Cargo clippy - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -104,7 +104,7 @@ jobs: # Verify all examples, checks checkexamples: name: checkexamples - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: target: @@ -137,7 +137,7 @@ jobs: # Verify the example output with run-pass tests testexamples: name: testexamples - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: target: @@ -182,7 +182,7 @@ jobs: # Check the correctness of macros/ crate checkmacros: name: checkmacros - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: target: @@ -216,7 +216,7 @@ jobs: # Run the macros test-suite testmacros: name: testmacros - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -244,7 +244,7 @@ jobs: # Run test suite tests: name: tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -271,7 +271,7 @@ jobs: # Build documentation, check links docs: name: docs - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -318,7 +318,7 @@ jobs: # Build the books mdbook: name: mdbook - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -367,7 +367,7 @@ jobs: # This needs to run before book is built mergetostablebranch: name: If CI passes, merge master branch into release/vX - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: - style - check @@ -408,7 +408,7 @@ jobs: # If all tests pass, then deploy stage is run deploy: name: deploy - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: mergetostablebranch @@ -561,7 +561,7 @@ jobs: - tests - docs - mdbook - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Mark the job as a success run: exit 0 diff --git a/Cargo.toml b/Cargo.toml index 922385c943..61f8e56eb2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,3 +70,10 @@ overflow-checks = false [patch.crates-io] lm3s6965 = { git = "https://github.com/japaric/lm3s6965" } + +[features] +test-critical-section = ["cortex-m/critical-section-single-core"] + +[[example]] +name = "pool" +required-features = ["test-critical-section"] diff --git a/book/en/src/preface.md b/book/en/src/preface.md index f833213ed4..6041dfedea 100644 --- a/book/en/src/preface.md +++ b/book/en/src/preface.md @@ -21,6 +21,18 @@ This is the documentation of v1.0.x of RTIC; for the documentation of version * v0.5.x go [here](/0.5). * v0.4.x go [here](/0.4). +## Is RTIC an RTOS? + +A common question is whether RTIC is an RTOS or not, and depending on your background the +answer may vary. From RTIC's developers point of view; RTIC is a hardware accelerated +RTOS that utilizes the NVIC in Cortex-M MCUs to perform scheduling, rather than the more +classical software kernel. + +Another common view from the community is that RTIC is a concurrency framework as there +is no software kernel and that it relies on external HALs. + +--- + {{#include ../../../README.md:7:47}} {{#include ../../../README.md:48:}} diff --git a/macros/src/check.rs b/macros/src/check.rs index 374fcedd09..b0ad6f8715 100644 --- a/macros/src/check.rs +++ b/macros/src/check.rs @@ -53,7 +53,7 @@ pub fn app(app: &App, _analysis: &Analysis) -> parse::Result { // If not enough tasks and first still is None, may cause // "custom attribute panicked" due to unwrap on None - return Err(parse::Error::new(first.unwrap().span(), &s)); + return Err(parse::Error::new(first.unwrap().span(), s)); } // Check that all exceptions are valid; only exceptions with configurable priorities are diff --git a/macros/src/codegen/shared_resources.rs b/macros/src/codegen/shared_resources.rs index 4a75007075..b5dff09da1 100644 --- a/macros/src/codegen/shared_resources.rs +++ b/macros/src/codegen/shared_resources.rs @@ -147,6 +147,7 @@ pub fn codegen( None } })) { + #[allow(clippy::or_fun_call)] let v = prio_to_masks.entry(priority - 1).or_insert(Vec::new()); v.push(quote!(#device::Interrupt::#name as u32)); mask_ids.push(quote!(#device::Interrupt::#name as u32)); diff --git a/xtask/src/command.rs b/xtask/src/command.rs index 2f719bf5c9..100888c075 100644 --- a/xtask/src/command.rs +++ b/xtask/src/command.rs @@ -46,7 +46,15 @@ impl<'a> CargoCommand<'a> { features, mode, } => { - let mut args = vec![self.name(), "--example", example, "--target", target]; + let mut args = vec![ + self.name(), + "--example", + example, + "--target", + target, + "--features", + "test-critical-section", + ]; if let Some(feature_name) = features { args.extend_from_slice(&["--features", feature_name]);