OpenSourceEBike / TSDZ2-Smart-EBike

Flexible OpenSource firmware for TongSheng TSDZ2 mid drive ebike motor
GNU General Public License v3.0
255 stars 131 forks source link

Serial changes #147

Closed 4var1 closed 3 years ago

4var1 commented 3 years ago

Apologies for the .gitignore!

Changes:

Improve speed of CRC16 by using temp ui16 rather than doing all operations in memory. Compared speed and asm and it's more compact and faster. Fix issue where a default packet size caused packets to be padded with zero. Change the way errors are counted when processing packets. If the CRC fails - count that as an error - but don't then count each byte that follows until a new packet header starts as additional errors.

casainho commented 3 years ago

Thanks!!