summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index dacafee8e0..6cac300cdf 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -467,14 +467,24 @@ static inline void charging_algorithm_close(void)
467/* Returns true if any power input is capable of charging. */ 467/* Returns true if any power input is capable of charging. */
468bool charger_inserted(void) 468bool charger_inserted(void)
469{ 469{
470 return power_thread_inputs & POWER_INPUT_CHARGER; 470#ifndef BOOTLOADER
471 unsigned int data = power_thread_inputs;
472#else
473 unsigned int data = power_input_status();
474#endif
475 return data & POWER_INPUT_CHARGER;
471} 476}
472 477
473/* Returns true if any power input is connected - charging-capable 478/* Returns true if any power input is connected - charging-capable
474 * or not. */ 479 * or not. */
475bool power_input_present(void) 480bool power_input_present(void)
476{ 481{
477 return power_thread_inputs & POWER_INPUT; 482#ifndef BOOTLOADER
483 unsigned int data = power_thread_inputs;
484#else
485 unsigned int data = power_input_status();
486#endif
487 return data & POWER_INPUT;
478} 488}
479 489
480/* 490/*