gandrewstone / LIN

The LIN protocol implemented over Arduino APIs (Serial and Digital IO)
119 stars 46 forks source link

timeout period is longer than necessary #12

Open philwmcdonald opened 3 years ago

philwmcdonald commented 3 years ago

Calculated TBit is 1/10 the real value due to a missing zero. For 19200 baud TBit is 52ms not 5ms. and 52 vs 50 isn't 40% different it's 4%. so the *14 to recover the missing resolution goes too far.

Probably shouldn't wait 2 frames for a response either.

A better timeout value would be: timeout = (34+90)*1000000UL/serialSpd;