mirror of
https://github.com/CTCaer/hekate.git
synced 2024-11-29 21:12:06 +00:00
regulator 5V: fix battery/usb source swap
This commit is contained in:
parent
e8f73a42b8
commit
9dbf745649
1 changed files with 6 additions and 0 deletions
|
@ -81,7 +81,13 @@ bool regulator_5v_get_dev_enabled(u8 dev)
|
||||||
void regulator_5v_batt_src_enable(bool enable)
|
void regulator_5v_batt_src_enable(bool enable)
|
||||||
{
|
{
|
||||||
if (enable && !batt_src)
|
if (enable && !batt_src)
|
||||||
|
{
|
||||||
gpio_write(GPIO_PORT_A, GPIO_PIN_5, GPIO_HIGH);
|
gpio_write(GPIO_PORT_A, GPIO_PIN_5, GPIO_HIGH);
|
||||||
else if (!enable && batt_src)
|
batt_src = true;
|
||||||
gpio_write(GPIO_PORT_A, GPIO_PIN_5, GPIO_LOW);
|
}
|
||||||
|
else if (!enable && batt_src)
|
||||||
|
{
|
||||||
|
gpio_write(GPIO_PORT_A, GPIO_PIN_5, GPIO_LOW);
|
||||||
|
batt_src = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue