gab-k / RP2040-Decoder

Cost effective DIY DCC Decoder for model railroad locomotives
Other
74 stars 14 forks source link

Incorrect parameter passed #13

Closed RadarWizard closed 10 months ago

RadarWizard commented 11 months ago

I'm developing a STM32L151 based dcc decoder and was looking at your code as a possible starting point. Your project looks great and the pid control is a bit beyond my understanding. However, I did notice a slight error on the line below which you may like to correct.

https://github.com/gab-k/RP2040-Decoder/blob/10fbcb5815ce81fd1c1bedcceed3cfd5c92fd319/core1.c#L179

I believe it should have passed msr_delay_in_us not msr_total_iterations. It works at the moment because these two numbers have the same value of 100.

gab-k commented 11 months ago

You are correct that line is incorrect. Thanks for bringing it to my attention.