diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/config-fmrecorder.h | 2 | ||||
-rw-r--r-- | firmware/powermgmt.c | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index 716bc98e09..50cee2be12 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h | |||
@@ -54,8 +54,10 @@ | |||
54 | /* The number of bytes reserved for loadable plugins */ | 54 | /* The number of bytes reserved for loadable plugins */ |
55 | #define PLUGIN_BUFFER_SIZE 0x8000 | 55 | #define PLUGIN_BUFFER_SIZE 0x8000 |
56 | 56 | ||
57 | #ifndef BOOTLOADER | ||
57 | /* Define this if you have an FM Radio */ | 58 | /* Define this if you have an FM Radio */ |
58 | #define CONFIG_TUNER S1A0903X01 | 59 | #define CONFIG_TUNER S1A0903X01 |
60 | #endif | ||
59 | 61 | ||
60 | #define AB_REPEAT_ENABLE 1 | 62 | #define AB_REPEAT_ENABLE 1 |
61 | 63 | ||
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 5aa85c883d..065690fdb3 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -374,6 +374,7 @@ static int runcurrent(void) | |||
374 | current = CURRENT_NORMAL; | 374 | current = CURRENT_NORMAL; |
375 | #endif /* MEM == 8 */ | 375 | #endif /* MEM == 8 */ |
376 | 376 | ||
377 | #ifndef BOOTLOADER | ||
377 | if (usb_inserted() | 378 | if (usb_inserted() |
378 | #ifdef HAVE_USB_POWER | 379 | #ifdef HAVE_USB_POWER |
379 | #if (CURRENT_USB < CURRENT_NORMAL) | 380 | #if (CURRENT_USB < CURRENT_NORMAL) |
@@ -405,6 +406,7 @@ static int runcurrent(void) | |||
405 | if (remote_detect()) | 406 | if (remote_detect()) |
406 | current += CURRENT_REMOTE; | 407 | current += CURRENT_REMOTE; |
407 | #endif | 408 | #endif |
409 | #endif /* BOOTLOADER */ | ||
408 | 410 | ||
409 | return current; | 411 | return current; |
410 | } | 412 | } |
@@ -447,7 +449,12 @@ void reset_battery_filter(int millivolts) | |||
447 | #endif /* HAVE_BATTERY_SWITCH */ | 449 | #endif /* HAVE_BATTERY_SWITCH */ |
448 | 450 | ||
449 | /** Generic charging algorithms for common charging types **/ | 451 | /** Generic charging algorithms for common charging types **/ |
450 | #if CONFIG_CHARGING == CHARGING_SIMPLE | 452 | #if CONFIG_CHARGING == 0 || CONFIG_CHARGING == CHARGING_SIMPLE |
453 | static inline void powermgmt_init_target(void) | ||
454 | { | ||
455 | /* Nothing to do */ | ||
456 | } | ||
457 | |||
451 | static inline void charging_algorithm_step(void) | 458 | static inline void charging_algorithm_step(void) |
452 | { | 459 | { |
453 | /* Nothing to do */ | 460 | /* Nothing to do */ |
@@ -461,6 +468,11 @@ static inline void charging_algorithm_close(void) | |||
461 | /* | 468 | /* |
462 | * Monitor CHARGING/DISCHARGING state. | 469 | * Monitor CHARGING/DISCHARGING state. |
463 | */ | 470 | */ |
471 | static inline void powermgmt_init_target(void) | ||
472 | { | ||
473 | /* Nothing to do */ | ||
474 | } | ||
475 | |||
464 | static inline void charging_algorithm_step(void) | 476 | static inline void charging_algorithm_step(void) |
465 | { | 477 | { |
466 | switch (charger_input_state) | 478 | switch (charger_input_state) |
@@ -664,9 +676,7 @@ static void power_thread(void) | |||
664 | battery_percent += battery_percent < 100; | 676 | battery_percent += battery_percent < 100; |
665 | } | 677 | } |
666 | 678 | ||
667 | #if CONFIG_CHARGING == CHARGING_TARGET | ||
668 | powermgmt_init_target(); | 679 | powermgmt_init_target(); |
669 | #endif | ||
670 | 680 | ||
671 | next_power_hist = current_tick + HZ*60; | 681 | next_power_hist = current_tick + HZ*60; |
672 | 682 | ||