forked from adafruit/Adafruit_nRF52_Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Xenon board can tell when it is getting powered through the USB rathe…
…r 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.
- Loading branch information
Showing
2 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters