Closed jhillyerd closed 3 years ago
Just tried a sample rate of 100_000: resolved the crash, but seems clunky.
I'd also expect your bluepill interrupt example to crash similarly: https://github.com/jkristell/infrared-examples/blob/master/stm32f103-bluepill/examples/receiver_exti.rs#L63
Hi
I noticed this as well some time ago when I was trying to use the library with higher timer resolutions.
I have a local branch with some cleanups to this area of the code, just need to find some time to finish it and write some tests. I could probably find some time during the weekend. The main difference from your branch is that I use a loop in the infra_range
to find a suitable denominator.
Cool, no urgency on my part, dividing by 10 seems to work well enough for the time being.
If you have the time, you could try the branch in this pull request: https://github.com/jkristell/infrared/pull/69
The tests pass, but I have not tested it on real hardware.
It looks like https://github.com/jkristell/infrared/blob/v0.11.0/src/protocols/utils.rs#L79 overflows with a microsecond sample rate:
is panicking on a blackpill stm32f411 board.