Skip to content

"uno-timer" example no longer works #499

@gregoryholder

Description

@gregoryholder

I can't quite tell where the break is happening, but the uno-timer example no longer seems to work. It seems to be due to a combination of Pin<Output, Dynamic>, calling the toggle method and using MaybeUninit.

If I change the pin declaration to a static pin Pin<Output, PB7> and remove the.downgrade(), the example works again.

I've also tried moving the interrupt code into a main loop, but again it only works with a static pin or with separate set_high/set_low calls.

This works:

// in main()
loop {
    let state = unsafe {
        &mut *INTERRUPT_STATE.as_mut_ptr()
    };

    state.blinker.set_high();
    delay_ms(100);
    state.blinker.set_low();
    delay_ms(100);
}

But this doesn't:

// in main()
loop {
    let state = unsafe {
        &mut *INTERRUPT_STATE.as_mut_ptr()
    };

    state.blinker.toggle();
    delay_ms(100);
}

I'm still new to low level Rust, so I'd appreciate any (raw)pointers with regard to diagnosing this kind of issue. It might be related to #286.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions