crust-firmware / crust

SCP (power management) firmware for sunxi SoCs
Other
150 stars 34 forks source link

drivers: cir: fix rc6 margins #186

Closed jernejsk closed 3 years ago

jernejsk commented 3 years ago

Purpose

Now that time constants are calculated more precisely, rc6 decoding is not reliable as before. Mostly it fails in trailer states (4 and 5).

It turns out that epsilon is too big in those states. Consider transition from RC6_TRAILER_N to RC6_DATA_P. Current epsilon calculation makes epsilon in RC6_TRAILER_N the same size as the duration of pulse in RC6_DATA_N. Obviously this means that RC6_TRAILER_N pulse may be eaten and decoding fails.

Fix that by making idle state epsilon a bit larger, but keep epsilon at half of time unit for all other states.

Tested on A64 (OrangePi Win) and H6 (OrangePi 3), with IR on osc24m and osc32k.

Signed-off-by: Jernej Skrabec jernej.skrabec@siol.net

Closes #

smaeul commented 3 years ago

Fixed up the formatting (see the failing check) and merged as 2abb49c37b0302399b98498b9a51f5ed30454aea.

smaeul commented 3 years ago

Thanks! This works quite reliably for me on both A64 and H6.