Rockbox

Tasklist

FS#6940 - Nano Car Adapter Mode enabled

Attached to Project: Rockbox
Opened by oblib (oblib__) - Friday, 30 March 2007, 04:43 GMT
Last edited by Torne Wuff (torne) - Wednesday, 10 February 2010, 13:40 GMT
Task Type Patches
Category Battery/Charging
Status Closed
Assigned To No-one
Operating System iPod Nano
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

All I did was enable the CONFIG_CHARGING for the nano, and set the proper GPIO bit in power-ipod.c. I don't know what the other consequences are of enabling CONFIG_CHARGING, so please let me know if there are any side effects.

To enable, go to settings->general settings->system->car adapter mode, and you can also look at general settings->display->lcd settings->backlight (while plugged in)
This task depends upon

Closed by  Torne Wuff (torne)
Wednesday, 10 February 2010, 13:40 GMT
Reason for closing:  Fixed
Additional comments about closing:  This has been fixed in r24581 - the correct GPIOs were already checked but CONFIG_CHARGING had not been enabled.
Comment by Russell Harmon (eatnumber1) - Friday, 30 March 2007, 11:49 GMT
You probably also want CHARGING_MONITOR instead of CHARGING_SIMPLE... look at  FS#6891 
Comment by oblib (oblib__) - Friday, 30 March 2007, 14:12 GMT
Can you tell me what the difference is? Both of them work for enabling car adapter mode, which is what I was after.
Comment by Russell Harmon (eatnumber1) - Saturday, 31 March 2007, 02:01 GMT
I may be entirely pulling this out of my ass, but I believe it determines what controls the charging.
Comment by oblib (oblib__) - Saturday, 31 March 2007, 13:27 GMT
Added support for +12V charger pin. Someone with a firewire charger please verify. After enabling the settings in the original post, you should be able to plug in the charger and see a plug symbol show up on the main screen of rockbox-default, and then if you unplug while playing, the music should pause.
Comment by oblib (oblib__) - Saturday, 31 March 2007, 13:30 GMT
Oops, I also meant to change the CONFIG_CHARGING mode to CHARGING_MONITOR. Could a developer confirm that I want CHARGING_MONITOR? It makes sense, since I think that is what the nano does (just monitor) but I can't tell by looking at the code what it does exactly.
Comment by oblib (oblib__) - Saturday, 31 March 2007, 15:47 GMT
After perusing the code, the only thing I can see the CHARGING_MONITOR vs CHARGING_SIMPLE doing is allowing a flag (charging_state) to be set in powermgmt.c that tells whether the ipod is CHARGING or DISCHARGING. I don't see any reason not to use CHARGING_MONITOR.
Comment by Russell Harmon (eatnumber1) - Tuesday, 10 April 2007, 18:41 GMT
There seems to be a problem with the syntax of your conditional in power-ipod.c. I'm not familiar with the syntax of that kind of conditional, but with that applied, my ipod remains in charging mode all the time. Changing the line to read return ((GPIOL_INPUT_VAL & 0x08)?false:true); worked for me, but that breaks the USB compatibility.
Comment by oblib (oblib__) - Wednesday, 18 April 2007, 02:56 GMT
Hmm, works fine for me from both the +5V USB pins and the +12ish V firewire pins. Anyone else care to try to verify?
Comment by dajuha (dajuha) - Monday, 28 May 2007, 06:10 GMT
Awesome work! We're almost there!

oblib, I can verify that your latest patch works (the latest, with CHARGING_MONITOR mode). When the vehicle is first turned on the iPod is powered on and when the vehicle is turned off the iPod is paused. This is precisely what I had in mind.

However, there does seem to be a bug. After the vehicle is turned off and turned back on again while the iPod is still powered on it crashes with a panic error. I can't seem to find why this is. The "now playing" screen is shown but quickly goes blank except for the theme and this text in the upper-left corner:
*PANIC*
Stkov

I then have to reset the iPod.

"Stkov" is mentioned in \firmware\thread.c if this helps.
Comment by oblib (oblib__) - Tuesday, 29 May 2007, 16:31 GMT
Interesting, I haven't seen that. What I have seen though, in a similar situation (power goes off then on again fairly soon), is that the nano will not recognize the external power. I figured it was just missing the reapplication of power, and a reset fixed it. I will take a look into this kernel panic when I get some time. Can anyone else confirm or deny this bug? Can anyone else fix it?
Comment by dajuha (dajuha) - Sunday, 10 June 2007, 16:03 GMT
Follow up: the latest revision of this patch appears to work as intended. I cannot replicate this message on other Nanos so I'm guessing this message is due to a faulty unit. Thanks for the great work! I hope this patch gets implemented in the daily builds.

Loading...