oryp6: Do not invert full battery light

This commit is contained in:
Jeremy Soller
2020-06-23 09:14:44 -06:00
parent 1c04c6aa39
commit c9a602c5af
3 changed files with 7 additions and 7 deletions

View File

@ -61,21 +61,21 @@ void board_event(void) {
}
if (main_cycle == 0) {
// Battery LED's are inverted on the oryp6
// Battery charging LED is inverted on the oryp6
if (acin) {
// Discharging (no AC adapter)
gpio_set(&LED_BAT_CHG_N, true);
gpio_set(&LED_BAT_FULL_N, true);
gpio_set(&LED_BAT_FULL, false);
} else if (battery_status & 0x0020) {
// Fully charged
// TODO: turn off charger
gpio_set(&LED_BAT_CHG_N, true);
gpio_set(&LED_BAT_FULL_N, false);
gpio_set(&LED_BAT_FULL, true);
} else {
// Charging
// TODO: detect no battery connected
gpio_set(&LED_BAT_CHG_N, false);
gpio_set(&LED_BAT_FULL_N, true);
gpio_set(&LED_BAT_FULL, false);
}
if (power_state == POWER_STATE_S0 || power_state == POWER_STATE_S3 || power_state == POWER_STATE_DS3) {

View File

@ -15,7 +15,7 @@ struct Gpio __code EC_RSMRST_N = GPIO(E, 5);
struct Gpio __code GC6_FB_EN = GPIO(J, 7);
struct Gpio __code LED_ACIN = GPIO(C, 7);
struct Gpio __code LED_BAT_CHG_N = GPIO(H, 5);
struct Gpio __code LED_BAT_FULL_N = GPIO(J, 0);
struct Gpio __code LED_BAT_FULL = GPIO(J, 0);
struct Gpio __code LED_PWR = GPIO(D, 0);
struct Gpio __code LID_SW_N = GPIO(B, 1);
struct Gpio __code PM_PWROK = GPIO(C, 6);
@ -51,7 +51,7 @@ void gpio_init() {
GPDRG = 0x40;
GPDRH = 0x20;
GPDRI = 0x20;
GPDRJ = 0x03;
GPDRJ = 0x02;
// Set GPIO control
// EC_PWM_PIN_24

View File

@ -27,7 +27,7 @@ extern struct Gpio __code GC6_FB_EN;
extern struct Gpio __code LED_ACIN;
extern struct Gpio __code LED_AIRPLANE_N;
extern struct Gpio __code LED_BAT_CHG_N;
extern struct Gpio __code LED_BAT_FULL_N;
extern struct Gpio __code LED_BAT_FULL;
extern struct Gpio __code LED_PWR;
extern struct Gpio __code LID_SW_N;
#define HAVE_PCH_DPWROK_EC 0