Sync acpi changes between boards

This commit is contained in:
Jeremy Soller 2020-02-12 21:43:33 +00:00
parent b830386e80
commit fc7fa1f11c
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
2 changed files with 19 additions and 3 deletions

View File

@ -7,9 +7,11 @@
extern uint8_t sci_extra;
uint8_t fcmd = 0;
uint8_t fdat = 0;
uint8_t fbuf[4] = { 0, 0, 0, 0 };
uint8_t ecos = 0;
static uint8_t fcmd = 0;
static uint8_t fdat = 0;
static uint8_t fbuf[4] = { 0, 0, 0, 0 };
void fcommand(void) {
// TODO
@ -66,6 +68,8 @@ uint8_t acpi_read(uint8_t addr) {
ACPI_16(0x2E, battery_remaining_capacity);
ACPI_16(0x32, battery_voltage);
ACPI_8(0x68, ecos);
ACPI_8(0xCC, sci_extra);
// Airplane mode LED
@ -100,6 +104,10 @@ void acpi_write(uint8_t addr, uint8_t data) {
lid_wake = (bool)(data & (1 << 2));
break;
case 0x68:
ecos = data;
break;
// Airplane mode LED
case 0xD9:
gpio_set(&LED_AIRPLANE_N, !(bool)(data & (1 << 6)));

View File

@ -8,6 +8,8 @@
extern uint8_t sci_extra;
uint8_t ecos = 0;
static uint8_t fcmd = 0;
static uint8_t fdat = 0;
static uint8_t fbuf[4] = { 0, 0, 0, 0 };
@ -81,6 +83,8 @@ uint8_t acpi_read(uint8_t addr) {
ACPI_16(0x2E, battery_remaining_capacity);
ACPI_16(0x32, battery_voltage);
ACPI_8(0x68, ecos);
ACPI_8(0xCC, sci_extra);
// Airplane mode LED
@ -115,6 +119,10 @@ void acpi_write(uint8_t addr, uint8_t data) {
lid_wake = (bool)(data & (1 << 2));
break;
case 0x68:
ecos = data;
break;
// Airplane mode LED
case 0xD9:
gpio_set(&LED_AIRPLANE_N, !(bool)(data & (1 << 6)));