summaryrefslogtreecommitdiffstats
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)
/* Returns true if any power input is capable of charging. */
bool charger_inserted(void)
{
- return power_thread_inputs & POWER_INPUT_CHARGER;
+#ifndef BOOTLOADER
+ unsigned int data = power_thread_inputs;
+#else
+ unsigned int data = power_input_status();
+#endif
+ return data & POWER_INPUT_CHARGER;
}
/* Returns true if any power input is connected - charging-capable
* or not. */
bool power_input_present(void)
{
- return power_thread_inputs & POWER_INPUT;
+#ifndef BOOTLOADER
+ unsigned int data = power_thread_inputs;
+#else
+ unsigned int data = power_input_status();
+#endif
+ return data & POWER_INPUT;
}
/*