Ultrawipf / OpenFFBoard

OpenFFBoard is a universal force feedback interface for DIY simulation devices
https://hackaday.io/project/163904-open-ffboard
MIT License
558 stars 117 forks source link

Modular analog source processing, optimized uart stability and more #73

Closed Ultrawipf closed 2 years ago

Ultrawipf commented 2 years ago

This adds a few fixes and features related to the command system (mainly uart), and a new analog processing class.

The analog processing class contains common functions to scale and filter analog values and can be reused by the ADS and local analog sources with common UI elements for the GUI as the commands will be the same. This includes filters, autoranging, getting values and if flash addresses are supplied also manual tuning options.

For SPI this may improve stability as the sampling point was moved further from the clock edge on 165 SRs and reducing the risk that it samples the first bit after it was already shifted.

Regarding the command parser system a ringbuffer is used instead of vectors and strings to prevent dynamic allocations inside the uart isr. This is more efficient and makes the uart system more stable but limits the total length a set of commands can have until they must be processed.