dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re[2]: log battery status
From: Uwe Freese (
Date: 2003-03-24

Hello Björn,

Björn Stenberg wrote on Monday, March 24, 2003, 10:11:26 AM:

BS> Thijs Withaar wrote:
>> i've been browsing through the source code somewhat,
>> but could anybody give me some hints as to where
>> to get started ?

BS> firmware/powermgmt.c:battery_level_update() is called once per
BS> minute. The tricky thing is logging to disk without increasing the
BS> number of disk spinups. I have no ready solution for that.


- remember which values weren't saved (how many minutes), increasing
  every minute in the powermgmt loop, as a variable in powermgmt
  (e.g. minutes_not_logged)
- write a log_voltage() function in powermgmt that's called every time
  the disk spins up and that does

  if minutes_not_logged > 0
    open logfile
    write values
    close logfile
    minutes_not_logged = 0

Bye, Uwe.

Page was last modified "Jan 10 2012" The Rockbox Crew