Open dcarosone opened 6 years ago
Pursued this a little further this evening; got past the declaration of peripherals as resources and some of the other general updates. Currently stuck looking for the right -hal implementation for the Serial (etc) traits for stm32f103xx
I should have known to look at your repos rather than crates.io.. found https://github.com/japaric/stm32f103xx-hal
That was helpful and broke my initial logjam. Bashing away at the pile of compiler errors; now down to about 25 which is good progress. Next thing to tackle is the new DMA model and adjust the buffer accordingly.
One question (for now) relating to setting up the timers. hal::timer seems to have tim2+ but not tim1:
// where is Timer::tim1 for TIM1?
let timer1 = Timer::tim1(p.device.TIM1, LATCH_DELAY, clocks, &mut rcc.apb1);
let timer3 = Timer::tim3(p.device.TIM3, LOG_FREQUENCY, clocks, &mut rcc.apb1);
Ok, I'm at the point where all remaining errors are repetitious, and fall into one of two categories:
I'm thinking that the start-stop timer stuff that's there now, and the comments about getting the cpu to do something while dma is banging bits out to the LEDs, get replaced by a couple of ringbuffers: one for serial data, one for dma data, and a task (or idle loop activity) that does the translation from one to the other.
That needs more thought and attention than I have just at the moment, but comments and hints are welcome. I'm also interested to learn what would be the more minimal/direct translation of the current design, with single buffers and passing the timers around to start/stop them.
Regardless I've learned a lot already, so yay!
Progress! Down to 9 errors (which includes several repetitions :)
Worked around the either
issue by just defining a local copy of the enum
Current blockers:
tim1
/ TIM1
seems to be missing from the timer hal impl (see linked issue above)set_duties()
seems to be missing from the pwm hal implset_duties()
to pass it to.
Disclaimer preamble: this is waaay low priority compared to all the other things going on, but this is a useful blinky project to demo RTFM.
I tried updating Cargo.toml to use RTFM 0.3, as a way of seeing what changed, and whether I understood enough to do whatever adaptation was required.
I didn't even know macros could panic :roll_eyes: