Skip to content
Snippets Groups Projects
Select Git revision
  • ee21e7d66a2975aa358f9a69185defa9fa5e4e85
  • master default protected
  • itm
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.1.7
  • v0.2.12
  • v0.3.1
  • v0.3.0
  • v0.2.11
  • v0.2.10
  • v0.2.9
  • v0.2.8
  • v0.2.7
  • v0.2.6
  • v0.2.5
  • v0.2.4
  • v0.2.3
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.6
23 results

cortex-m-fork

user avatar
Jorge Aparicio authored
this prevents people from overlapping non-atomic write operations on the same stimulus port when
working with generators (cooperative tasks).

For example, with this change the following code won't compile

``` rust
let stim = &mut ITM.stim[0];
let a = || {
    loop {
        // ..
        for byte in b"Hello, world!".iter() {
            while !stim.is_fifo_ready() { yield }
            stim.write_u8(*byte);
        }
        // ..
    }
};

let b = || {
    loop {
        // ..
        for byte in b"The quick brown fox jumps over the lazy dog".iter() {
            while !stim.is_fifo_ready() { yield }
            stim.write_u8(*byte);
        }
        // ..
    }
};
```

A possible fix for the above code is to use different stimulus ports in each task (generator).
ee21e7d6
History
Name Last commit Last update