/** * Called by hook task every 1 sec */ static void led_second(void) { if (led_auto_control_is_enabled(EC_LED_ID_POWER_LED)) oak_led_set_power(system_get_board_version()); if (led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) oak_led_set_battery(system_get_board_version()); }
/** * Called by hook task every 1 sec */ static void led_second(void) { if (led_auto_control_is_enabled(EC_LED_ID_POWER_LED)) big_led_set_power(); if (led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) big_led_set_battery(); }
/** * Called by hook task every 250 ms */ static void led_tick(void) { if (led_debug) return; if (led_auto_control_is_enabled(EC_LED_ID_POWER_LED) && led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) { kevin_led_set_power_battery(); return; } set_color(LED_OFF); }
/* Called by hook task every 1 sec */ static void led_second(void) { /* * Reference board only has one LED, so overload it to act as both * power LED and battery LED. */ if (led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) led_set_battery(); }
/** * Called by hook task every 250 ms */ static void led_tick(void) { static unsigned ticks; int chstate = charge_get_state(); ticks++; /* If we don't control the LED, nothing to do */ if (!led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) return; /* If charging error, blink orange, 25% duty cycle, 4 sec period */ if (chstate == PWR_STATE_ERROR) { set_color((ticks % 16) < 4 ? LED_ORANGE : LED_OFF); return; } /* If charge-force-idle, blink green, 50% duty cycle, 2 sec period */ if (chstate == PWR_STATE_IDLE && (charge_get_flags() & CHARGE_FLAG_FORCE_IDLE)) { set_color((ticks & 0x4) ? LED_GREEN : LED_OFF); return; } /* If the system is charging, solid orange */ if (chstate == PWR_STATE_CHARGE) { set_color(LED_ORANGE); return; } /* If AC connected and fully charged (or close to it), solid green */ if (chstate == PWR_STATE_CHARGE_NEAR_FULL || chstate == PWR_STATE_IDLE) { set_color(LED_GREEN); return; } /* Otherwise, system is off and AC not connected, LED off */ set_color(LED_OFF); }
/** * Called by hook task every 1 sec */ static void led_second(void) { if (led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) glados_led_set_battery(); }