You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xenon board can tell when it is getting powered through the USB rather than a battery and when a battery is being charged. Added required pins inside variant files and they work as specified:
- When PIN_PWD is HIGH, Xenon is being powered through the USB
- When PIN_CHG is LOW, a battery attached to Xenon is being charged
Note though that prior to using these pins it is neccessary to specify pinMode(PIN_CHG, INPUT) and pinMode(PIN_PWR, INPUT) due to how they're being implemented in hardware. Using these two pins 3 states of power can be deduced:
- hasUsbPower = digitalRead(PIN_PWR);
- isCharging = (hasUsbPower && !digitalRead(PIN_CHG));
- onBatteryPower = !hasUsbPower;
Added the missing LED1 initialisation.
BUTTON_FRESET pin number assignment was fixed.
0 commit comments