commit b4 removing discrete control to i2c slaves
Removed discrete control to i2c slaves

Improved reset with buttons
fixed I-limit register from 1.2A to 3A
profile switching sort of works now with some devices but the best one
doesn't seem to be applied at the end
added some todo's
Prevent SOC flicker when charging

locked out SOC clear when plugged in to prevent flicker.  could probably
be done more elegantly
Implemented SOC fade MSB
Bugfixes

fixed bug with unresponsive SOC button presses
fixed bug where current printing was only reading first 7 bits of 8
added watchdog kick of charger ic in do_best routine to prevent timeout
Implemented do_best with buttons

added interrupt routines to monitor long presses on buttons
added sequence for manually starting do_best on attached ports
Temperature sensor cal and function implemented

Finally got the Vdd dependent temperature calibration and reporting to
work right. UGGHH
added get_char timeout

cleaned up debug messages a bit
Fixed BATFET shutoff bug

updated calibration routines to use BATFET shutoff
added option to cutoff BATFET - hard reset until plugin
removed print_current

I'm dumb and made a function to do something that didn't need to be
added, organized task/to-do section
added hard reset option on startup

hold both buttons during powerup to do a BATFET cutout reset - hopefully
can recover from i2c hangs now
added DEBUG preprocessor flag

added ifdefs all over to remove serial print stuff for use when not
debugging. Code size reduced from ~90% -> ~30%
Added discharge rate indication

MSB of SOC blinks proportionately faster for higher draw devices when
attached
added i2c clear function

configure SDA and SCL as gpio and toggle SCL until SDA is released (=1)
on startup to prevent slaves from hanging the bus
add FSM to disable SOC on charger unplug

adjusted SOC levels to be better, still not perfect
changed self-detect to work better (?)
fixed bug in SOC hysteresis
Added low discharge auto do_best

moved reset check to timer1 ISR
added fades to different profiles during do_best
added do_best button sequencing

fixed some stuff in do_best()
Added best profile saving

profile saving in eeprom verified
fixed bug in manual do_best to turn off leds after
band-aided the a_det hang on some phones