Current detection when battery is charging and discharging