forked from len0rd/rockbox
Enable the charging_status function also for targets with target-specific battery charging.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20521 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ed1a3355de
commit
52d298044f
3 changed files with 8 additions and 8 deletions
|
|
@ -519,7 +519,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
charger_inserted,
|
charger_inserted,
|
||||||
# if CONFIG_CHARGING == CHARGING_MONITOR
|
# if CONFIG_CHARGING >= CHARGING_MONITOR
|
||||||
charging_state,
|
charging_state,
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -128,12 +128,12 @@ void* plugin_get_buffer(size_t *buffer_size);
|
||||||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||||
|
|
||||||
/* increase this every time the api struct changes */
|
/* increase this every time the api struct changes */
|
||||||
#define PLUGIN_API_VERSION 144
|
#define PLUGIN_API_VERSION 145
|
||||||
|
|
||||||
/* update this to latest version if a change to the api struct breaks
|
/* update this to latest version if a change to the api struct breaks
|
||||||
backwards compatibility (and please take the opportunity to sort in any
|
backwards compatibility (and please take the opportunity to sort in any
|
||||||
new function which are "waiting" at the end of the function table) */
|
new function which are "waiting" at the end of the function table) */
|
||||||
#define PLUGIN_MIN_API_VERSION 144
|
#define PLUGIN_MIN_API_VERSION 145
|
||||||
|
|
||||||
/* plugin return codes */
|
/* plugin return codes */
|
||||||
enum plugin_status {
|
enum plugin_status {
|
||||||
|
|
@ -658,7 +658,7 @@ struct plugin_api {
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
bool (*charger_inserted)(void);
|
bool (*charger_inserted)(void);
|
||||||
# if CONFIG_CHARGING == CHARGING_MONITOR
|
# if CONFIG_CHARGING >= CHARGING_MONITOR
|
||||||
bool (*charging_state)(void);
|
bool (*charging_state)(void);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ static unsigned int charge_state(void)
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
if (rb->charger_inserted())
|
if (rb->charger_inserted())
|
||||||
ret = BIT_CHARGER;
|
ret = BIT_CHARGER;
|
||||||
#if CONFIG_CHARGING == CHARGING_MONITOR
|
#if CONFIG_CHARGING >= CHARGING_MONITOR
|
||||||
if (rb->charging_state())
|
if (rb->charging_state())
|
||||||
ret |= BIT_CHARGING;
|
ret |= BIT_CHARGING;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -310,7 +310,7 @@ static bool flush_buffer(void)
|
||||||
"%02d:%02d, %04d, "
|
"%02d:%02d, %04d, "
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
" %c"
|
" %c"
|
||||||
#if CONFIG_CHARGING == CHARGING_MONITOR
|
#if CONFIG_CHARGING >= CHARGING_MONITOR
|
||||||
", %c"
|
", %c"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -324,7 +324,7 @@ static bool flush_buffer(void)
|
||||||
bat[i].voltage
|
bat[i].voltage
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
, (bat[i].flags & BIT_CHARGER) ? 'A' : '-'
|
, (bat[i].flags & BIT_CHARGER) ? 'A' : '-'
|
||||||
#if CONFIG_CHARGING == CHARGING_MONITOR
|
#if CONFIG_CHARGING >= CHARGING_MONITOR
|
||||||
, (bat[i].flags & BIT_CHARGING) ? 'C' : '-'
|
, (bat[i].flags & BIT_CHARGING) ? 'C' : '-'
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -517,7 +517,7 @@ int main(void)
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
", C:"
|
", C:"
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CHARGING == CHARGING_MONITOR
|
#if CONFIG_CHARGING >= CHARGING_MONITOR
|
||||||
", S:"
|
", S:"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_USB_POWER
|
#ifdef HAVE_USB_POWER
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue