mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
powermgmt-target.h: move prototypes to powermgmt.h
Implement empty stubs if needed instead of empty static inline git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31617 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
66149b454b
commit
19fba5fb30
7 changed files with 8 additions and 32 deletions
|
|
@ -139,6 +139,8 @@ int _battery_time(void); /* minutes */
|
||||||
int _battery_voltage(void); /* voltage in millivolts */
|
int _battery_voltage(void); /* voltage in millivolts */
|
||||||
#if CONFIG_CHARGING >= CHARGING_TARGET
|
#if CONFIG_CHARGING >= CHARGING_TARGET
|
||||||
void powermgmt_init_target(void);
|
void powermgmt_init_target(void);
|
||||||
|
void charging_algorithm_close(void);
|
||||||
|
void charging_algorithm_step(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_BATTERY_SWITCH
|
#ifdef HAVE_BATTERY_SWITCH
|
||||||
|
|
|
||||||
|
|
@ -100,10 +100,6 @@
|
||||||
#error "Charger settings not defined!"
|
#error "Charger settings not defined!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void powermgmt_init_target(void);
|
|
||||||
void charging_algorithm_step(void);
|
|
||||||
void charging_algorithm_close(void);
|
|
||||||
|
|
||||||
/* We want to be able to reset the averaging filter */
|
/* We want to be able to reset the averaging filter */
|
||||||
#define HAVE_RESET_BATTERY_FILTER
|
#define HAVE_RESET_BATTERY_FILTER
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,10 +107,6 @@
|
||||||
#define BATT_AVE_SAMPLES 128
|
#define BATT_AVE_SAMPLES 128
|
||||||
#define ICHARGER_AVE_SAMPLES 32
|
#define ICHARGER_AVE_SAMPLES 32
|
||||||
|
|
||||||
void powermgmt_init_target(void);
|
|
||||||
void charging_algorithm_step(void);
|
|
||||||
void charging_algorithm_close(void);
|
|
||||||
|
|
||||||
/* Provide filtered charge current */
|
/* Provide filtered charge current */
|
||||||
int battery_charge_current(void);
|
int battery_charge_current(void);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,6 @@
|
||||||
*/
|
*/
|
||||||
#define ADC_BATTERY ADC_RTCSUP
|
#define ADC_BATTERY ADC_RTCSUP
|
||||||
|
|
||||||
void powermgmt_init_target(void);
|
|
||||||
void charging_algorithm_step(void);
|
|
||||||
void charging_algorithm_close(void);
|
|
||||||
|
|
||||||
/* We want to be able to reset the averaging filter */
|
/* We want to be able to reset the averaging filter */
|
||||||
#define HAVE_RESET_BATTERY_FILTER
|
#define HAVE_RESET_BATTERY_FILTER
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,6 @@
|
||||||
#define ADC_BATTERY ADC_RTCSUP
|
#define ADC_BATTERY ADC_RTCSUP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void powermgmt_init_target(void);
|
|
||||||
void charging_algorithm_step(void);
|
|
||||||
void charging_algorithm_close(void);
|
|
||||||
|
|
||||||
/* We want to be able to reset the averaging filter */
|
/* We want to be able to reset the averaging filter */
|
||||||
#define HAVE_RESET_BATTERY_FILTER
|
#define HAVE_RESET_BATTERY_FILTER
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,10 @@ int _battery_voltage(void)
|
||||||
return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
|
return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void powermgmt_init_target(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/** Charger control **/
|
/** Charger control **/
|
||||||
#ifdef CHARGING_DEBUG_FILE
|
#ifdef CHARGING_DEBUG_FILE
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
|
@ -483,12 +487,12 @@ void charging_algorithm_step(void)
|
||||||
charger_enable(trickle_sec > 0);
|
charger_enable(trickle_sec > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CHARGING_DEBUG_FILE
|
|
||||||
void charging_algorithm_close(void)
|
void charging_algorithm_close(void)
|
||||||
{
|
{
|
||||||
|
#ifdef CHARGING_DEBUG_FILE
|
||||||
debug_file_close();
|
debug_file_close();
|
||||||
}
|
|
||||||
#endif /* CHARGING_DEBUG_FILE */
|
#endif /* CHARGING_DEBUG_FILE */
|
||||||
|
}
|
||||||
|
|
||||||
/* Returns true if the unit is charging the batteries. */
|
/* Returns true if the unit is charging the batteries. */
|
||||||
bool charging_state(void)
|
bool charging_state(void)
|
||||||
|
|
|
||||||
|
|
@ -86,18 +86,4 @@ bool charger_enabled(void);
|
||||||
/* Battery filter lengths in samples */
|
/* Battery filter lengths in samples */
|
||||||
#define BATT_AVE_SAMPLES 32
|
#define BATT_AVE_SAMPLES 32
|
||||||
|
|
||||||
/* No init to do */
|
|
||||||
#if !(CONFIG_PLATFORM & PLATFORM_HOSTED)
|
|
||||||
static inline void powermgmt_init_target(void) {}
|
|
||||||
#endif
|
|
||||||
void charging_algorithm_step(void);
|
|
||||||
|
|
||||||
#ifdef CHARGING_DEBUG_FILE
|
|
||||||
/* Need to flush and close debug file */
|
|
||||||
void charging_algorithm_close(void);
|
|
||||||
#else
|
|
||||||
/* No poweroff operation to do */
|
|
||||||
static inline void charging_algorithm_close(void) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* POWERMGMT_TARGET_H */
|
#endif /* POWERMGMT_TARGET_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue