Right now I am designing a circuit that will charge a Li-ion battery via USB, using the MCP73831 (at 100 mA).
The battery voltage (nominally 3.7 V) will be regulated to 3.3 V to power a microcontroller like an ATtiny85 or ESP8266 for example.
Below is what I have so far. My question is: Are there any flaws/mistakes I made, and how can I charge the Li-ion battery while simultaneously powering the MCU?
Because right now I can only charge OR use the MCU, depending on the SPDT switch.