Skip to content

blinky_timer_irq example broken ? #332

Open
@timbod7

Description

@timbod7

examples/blinky_timer_irq.rs doesn't work for me. I know how to fix it, but I don't understand why my fix works.

My test repo:

https://github.com/timbod7/stm32f1xx-hal-testing

demonstrates the problem using a blue pill board.

The first commit has src/main.rs as example/blinky.rs. It works as expected.

The second commit replace src/main.rs with example//blinky_timer_irq.rs.rs. This doesn't work. If I look at PC13 with an oscilloscope I can see that it pulses low for only 10us.

The third commit reorders the actions in the interrupt handler, and fixes the issue, with the LED flashing with a 2 second period as expected.

Any suggestions as to what is going on here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions