RTIC. multilock in clycle


#[idle(shared = [bq1, bq2]])]
fn idle(mut cx: idle::Context) -> ! {
	let mut bq = (cx.shared.bq1, cx.shared.bq2);

        loop {
            (bq.0, bq.1)
                .lock(|bq1, bq2| {

In this case i have got error:

|             (bq.0, bq.1)
|              ^^^^ value moved here, in previous iteration of loop
note: move occurs because `bq.0` has type `bq1_that_needs_to_be_locked<'_>`, which does not implement the `Copy` trait

Is it able to use multi-lock in the cycle?

try (&mut bq.0, &mut bq.1).lock()

or maybe simply bq.lock() might work, too, while being even shorter?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.