Move most code in system76 boards into system76/common

This commit is contained in:
Jeremy Soller
2020-06-24 13:38:06 -06:00
committed by Jeremy Soller
parent 185459b031
commit 42e88d03b3
44 changed files with 296 additions and 1586 deletions

View File

@@ -23,22 +23,6 @@ void board_init(void) {
gpio_set(&SWI_N, true);
}
void board_event(void) {
if (main_cycle == 0) {
if (gpio_get(&ACIN_N)) {
// Discharging (no AC adapter)
gpio_set(&LED_BAT_CHG, false);
gpio_set(&LED_BAT_FULL, false);
} else if (battery_status & 0x0020) {
// Fully charged
// TODO: turn off charger
gpio_set(&LED_BAT_CHG, false);
gpio_set(&LED_BAT_FULL, true);
} else {
// Charging
// TODO: detect no battery connected
gpio_set(&LED_BAT_CHG, true);
gpio_set(&LED_BAT_FULL, false);
}
}
}
void board_on_ac(bool ac) { /* Fix unused variable */ ac = ac; }
void board_event(void) {}