Petr Ledvina

Results 362 comments of Petr Ledvina

Do you wait for each reply to finish before sending new request? Is it deterministic? = is number of replies constant when requesting constant packet?

in0put buffer oveflow/interraction is one possible mode of failure. Try slowing down request first

So the problem is likely in CRSF receive/buffer handling. It isn't too much code. Does it happen when MSP packet fits in single CRSF frame? For request/reply?

This is IMO over-optimization. - space for improvement is small - VDIV.F32 and VSQRT.F32 have 14 cycle latency and other instructions can run in parallel. - approximation is not smooth....

@Quick-Flash : In this PR, sin/cos can be replaced with functions specifying input range (for example sin_mp2_p2 for -pi/2 to pi2; 0_2p for 0..2pi). These functions will still use sin/cos...

https://www.ti.com/lit/an/sprad27a/sprad27a.pdf?ts=1755445807243 pretty low-order polynomial is enough for almost machine precission, mainly with pi/4..pi/4

@Quick-Flash : I mean something like this code. Coefficients need to be optimized (and adjusted so that octant boundary is jump-less), but generated code looks OK https://godbolt.org/z/c11jeoz4G ```C // Fast...

Here is updated version. The coefficients are still only approximation, I need to run some Remez optimization myself to get optimal values. It is not tested directly yet, only python...

My approx assumes that x is already multiplied by 2/pi - it uses remainder from quadrant decoding directly. X shoud be - .5 .. .5

> @ledvinap would be nice to use a version where we can skip the range checks like during the biquad filter updates as that can really help speedup some hot...