current sensor support added

also optimized the vbat code a bit