updated battery code for overcharge condition

added code to handle overcharged battery state