aboutsummaryrefslogtreecommitdiff
path: root/ui/local-err.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2021-07-09 11:00:11 +0000
committerGravatar GitHub <noreply@github.com> 2021-07-09 11:00:11 +0000
commite1a4d001f8e724596cd9de3e90698ce7de473b3f (patch)
treef7aac5eae4cc2e19cc06bfd6fa8dab843dcfb276 /ui/local-err.rs
parent13dc3992e616d817e38c167c4b47db816855f18b (diff)
parentf3d9fd9b638a25b497e1ca02e7ce5de86c9fc1c9 (diff)
downloadrtic-e1a4d001f8e724596cd9de3e90698ce7de473b3f.tar.gz
rtic-e1a4d001f8e724596cd9de3e90698ce7de473b3f.tar.zst
rtic-e1a4d001f8e724596cd9de3e90698ce7de473b3f.zip
Merge #494
494: Resoures take 2 r=korken89 a=korken89 Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'ui/local-err.rs')
-rw-r--r--ui/local-err.rs83
1 files changed, 0 insertions, 83 deletions
diff --git a/ui/local-err.rs b/ui/local-err.rs
deleted file mode 100644
index 7ebfc069..00000000
--- a/ui/local-err.rs
+++ /dev/null
@@ -1,83 +0,0 @@
-//! examples/local_err.rs
-
-#![deny(unsafe_code)]
-#![deny(warnings)]
-#![no_main]
-#![no_std]
-
-// errors here, since we cannot bail compilation or generate stubs
-// run cargo expand, then you see the root of the problem...
-use cortex_m_semihosting::{debug, hprintln};
-use lm3s6965::Interrupt;
-use panic_semihosting as _;
-
-#[rtic::app(device = lm3s6965)]
-mod app {
- #[resources]
- struct Resources {
- // An early resource
- #[init(0)]
- shared: u32,
-
- // A local (move), early resource
- #[task_local]
- #[init(1)]
- l1: u32,
-
- // An exclusive, early resource
- #[lock_free]
- #[init(1)]
- e1: u32,
-
- // A local (move), late resource
- #[task_local]
- l2: u32,
-
- // An exclusive, late resource
- #[lock_free]
- e2: u32,
- }
-
- #[init]
- fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
- rtic::pend(Interrupt::UART0);
- rtic::pend(Interrupt::UART1);
- (init::LateResources { e2: 2, l2: 2 }, init::Monotonics())
- }
-
- // `shared` cannot be accessed from this context
- // l1 ok
- // l2 rejeceted (not task_local)
- // e2 ok
- #[idle(resources =[l1, l2, e2])]
- fn idle(cx: idle::Context) -> ! {
- hprintln!("IDLE:l1 = {}", cx.resources.l1).unwrap();
- hprintln!("IDLE:e2 = {}", cx.resources.e2).unwrap();
- debug::exit(debug::EXIT_SUCCESS);
- loop {}
- }
-
- // `shared` can be accessed from this context
- // l2 rejected (not task_local)
- // e1 rejected (not lock_free)
- #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])]
- fn uart0(cx: uart0::Context) {
- let shared: &mut u32 = cx.resources.shared;
- *shared += 1;
- *cx.resources.e1 += 10;
- hprintln!("UART0: shared = {}", shared).unwrap();
- hprintln!("UART0:l2 = {}", cx.resources.l2).unwrap();
- hprintln!("UART0:e1 = {}", cx.resources.e1).unwrap();
- }
-
- // l2 rejected (not task_local)
- #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])]
- fn uart1(cx: uart1::Context) {
- let shared: &mut u32 = cx.resources.shared;
- *shared += 1;
-
- hprintln!("UART1: shared = {}", shared).unwrap();
- hprintln!("UART1:l2 = {}", cx.resources.l2).unwrap();
- hprintln!("UART1:e1 = {}", cx.resources.e1).unwrap();
- }
-}
e='fryuni/test-route-setup-hook'>fryuni/test-route-setup-hook Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/packages/astro/test/fixtures/ssr-partytown (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-06-28Fix Tailwind integration Typescript warning (#3732)Gravatar Victor 2-1/+6
2022-06-27[ci] formatGravatar bholmesdev 2-3/+3
2022-06-27Refactor: remove Deno shim to esbuild "banner" (#3734)Gravatar Ben Holmes 7-15/+22
2022-06-27[ci] formatGravatar FredKSchott 9-23/+25
2022-06-27update telemetry to support more anonymized project id (#3713)Gravatar Fred K. Schott 20-351/+311
2022-06-27SImplify "astro add" by removing confusing multi-select (#3715)Gravatar Fred K. Schott 13-258/+157