]> www.fi.muni.cz Git - bike-lights.git/commitdiff
adc.c: sub-LSB resolution of PWM
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 2 Jul 2013 10:06:26 +0000 (12:06 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 2 Jul 2013 10:06:26 +0000 (12:06 +0200)
Simulate a sub-LSB resolution inside the ADC IRQ handler. We do multiple
measurements of PWMLED resistor anyway, so it makes sense to modify the
PWM value after each reading. And indeed, experiments show less flicker
of PWM LEDs with this patch.

It is probably an overkill, and can be called only when measuring the
PWMLED output (and not ambient light sensor, for example). But it works
and it is simple enough.


No differences found