Rockbox mail archiveSubject: Re: Update to the AJRv1 recharging
Re: Update to the AJRv1 recharging
From: Jens Arnold <arnold-j_at_t-online.de>
Date: Wed, 23 Feb 2005 20:59:13 +0100
On 23.02.2005, you wrote:
> Jerry Van Baren wrote:
>> I've updated the AJRv1 charging patch page
>> I uploaded an updated patch file. I'm still having problems
>> with the size of some non-AJRv1 builds and have not had time
>> to chase this much (mpeg.o is hugely larger in the one
>> instance I was looking at).
> An update: In the software I attempt to close the
> powermgmt.csv file when USB is plugged in, but I'm not sure it
> is successful. I ran a recharge test overnight and ended up
> with a zero length file :-(.
This close() attempt cannot work the way it is implemented,
because the usb_inserted() check is asynchronous to the other
threads. Chances are >99% that the USB connection is already
accepted and disk control handed over to the USB bridge when
this code snippet runs.
If you want to implement it the proper way, you would have to
give the power thread an event queue. This would then require
the power thread to accept the USB connection, and it has the
chance to close the file before doing so. Of course introducing
an event queue then complicates the timing, because the thread
cannot simply sleep a determined amount of time.
Received on 2005-02-23