First step to optimizing the battery monitoring.
Optimized loops. (http://www.atmel.com/images/doc8453.pdf)

Signed-off-by: Michel Verbraak <info@1st-setup.nl>