Update core.c

Best Battery Optimization - ported from Rev3nt3ch