summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config-fmrecorder.h2
-rw-r--r--firmware/powermgmt.c16
2 files changed, 15 insertions, 3 deletions
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index 716bc98..50cee2b 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -54,8 +54,10 @@
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x8000
+#ifndef BOOTLOADER
/* Define this if you have an FM Radio */
#define CONFIG_TUNER S1A0903X01
+#endif
#define AB_REPEAT_ENABLE 1
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 5aa85c8..065690f 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -374,6 +374,7 @@ static int runcurrent(void)
current = CURRENT_NORMAL;
#endif /* MEM == 8 */
+#ifndef BOOTLOADER
if (usb_inserted()
#ifdef HAVE_USB_POWER
#if (CURRENT_USB < CURRENT_NORMAL)
@@ -405,6 +406,7 @@ static int runcurrent(void)
if (remote_detect())
current += CURRENT_REMOTE;
#endif
+#endif /* BOOTLOADER */
return current;
}
@@ -447,7 +449,12 @@ void reset_battery_filter(int millivolts)
#endif /* HAVE_BATTERY_SWITCH */
/** Generic charging algorithms for common charging types **/
-#if CONFIG_CHARGING == CHARGING_SIMPLE
+#if CONFIG_CHARGING == 0 || CONFIG_CHARGING == CHARGING_SIMPLE
+static inline void powermgmt_init_target(void)
+{
+ /* Nothing to do */
+}
+
static inline void charging_algorithm_step(void)
{
/* Nothing to do */
@@ -461,6 +468,11 @@ static inline void charging_algorithm_close(void)
/*
* Monitor CHARGING/DISCHARGING state.
*/
+static inline void powermgmt_init_target(void)
+{
+ /* Nothing to do */
+}
+
static inline void charging_algorithm_step(void)
{
switch (charger_input_state)
@@ -664,9 +676,7 @@ static void power_thread(void)
battery_percent += battery_percent < 100;
}
-#if CONFIG_CHARGING == CHARGING_TARGET
powermgmt_init_target();
-#endif
next_power_hist = current_tick + HZ*60;