Using Instant::now() would schedual the next task from the point the task starts excecuting (after being blocked) and this would push the excection of the next task iteration further and further each time it executes.
Using cx.scheduled would schedual the next iteration from the time the task was last scheduled. This will not push the exection of the next iteration.
*/
//
//
// Explain in your own words why we use the latter
// Explain in your own words why we use the latter
// in order to generate a periodic task.
// in order to generate a periodic task.
//
//
// [Your answer here]
// [Your answer here]
/*
See above, but tldr;
The first one would push the arrivaltime of the task each time it is scheduled, while the later will give use the same inter_arrival time every time.
*/
//
//
// Hint, look at https://rtic.rs/0.5/book/en/by-example/timer-queue.html
// Hint, look at https://rtic.rs/0.5/book/en/by-example/timer-queue.html
//
//
...
@@ -217,6 +230,9 @@ const APP: () = {
...
@@ -217,6 +230,9 @@ const APP: () = {
// Explain why this is needed (there is a good reason for it).
// Explain why this is needed (there is a good reason for it).
//
//
// [Your answer here]
// [Your answer here]
/*
Because multiple tasks can access these variables, rust can't ensure that the read is safe to do.