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

Rockbox mail archive

Subject: Re[2]: log battery status

Re[2]: log battery status

From: Uwe Freese <>
Date: Mon, 24 Mar 2003 11:39:10 +0100

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.
Received on 2003-03-24

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy