Rockbox Development > Starting Development and Compiling

HAVE_LCD_CHARCELLS and shutdown menu for e200

(1/2) > >>

TheMarkster:
I'm new to this, so bear with me if this is not the right board.

I thought it would be nice to have a shutdown option in the main root menu for my player (sansa e260v1).  When I started looking over the source code I noticed there already was code for a shutdown option in the main menu, but it wasn't showing up in my player.  (This would be in apps/rootmenu.c.)  The problem seems to be that the code for the shutdown option is surrounded by

#ifdef HAVE_LCD_CHARCELLS
...
#endif

and hence isn't being compiled for my player.

I discovered that by commenting out the #ifdef ... #endif and by converting the line

    MENUITEM_FUNCTION(do_shutdown_item, 0, ID2P(LANG_SHUTDOWN),
                  do_shutdown, NULL, NULL, Icon_NOICON);


to


    MENUITEM_FUNCTION(do_shutdown_item, 0, "Shutdown",
                  do_shutdown, NULL, NULL, Icon_NOICON);


I was able to get the source to compile and work on my e200 series player. 

My question is: what exactly does having  HAVE_LCD_CHARCELLS defined mean?  Especially, why would having it defined preclude having a shutdown option in the menu?  In other words, why check for HAVE_LCD_CHARCELLS in the first place concerning having a shutdown menu option?

My workaround seems to be working just fine with the exception that the player boots into the settings menu rather than into the main menu on powerup.  (Play/Pause gets me to WPS and the bottom button below the scroll wheel gets me back to the main menu.)

MarcGuay:
http://www.rockbox.org/tracker/task/6733

I believe the have-charcells if-block refers to the Archos units, who perhaps don't have a way of shutting down gracefully via a keypress?

As for the start screen, there is an option in the settings to choose which screen to open on, and you probably have it set to "Settings".

TheMarkster:
Thanks for the reply, and for the link to the task tracker, and for the tip on the startup screen option.  I'm now back to starting up at the main menu as before.  You saved me the grief of trying to figure out how my hack had goofed up the start screen.

pixelma:

--- Quote from: MarcGuay on May 09, 2008, 03:08:15 PM ---I believe the have-charcells if-block refers to the Archos units, who perhaps don't have a way of shutting down gracefully via a keypress?
--- End quote ---
I think the reason you gave here is correct but its not valid for all "Archos units".
It only refers to the one line of Archos targets - the "Player/Studio", the first two on the DeviceChart wiki - which happens to be the only target with a so called "charcell" display. Other Archos units like e.g. my Ondio can be shut down gracefully without an option and so doesn't have this. I can imagine that this is the reason one chose to wrap it into this define even though it might not be the "clean" way.

About such an option in general: if I can shut down a player by pressing one button (even if it's two long presses in a row) thus quite comfortably, I wouldn't want an option in the menu for it because: pressing one button is quicker than bringing up the menu, navigate to the option and select it; I'd like to avoid accidentally shutting down my player by chosing a wrong "menu item"; it clutters up the menu unnecessarily (as if Rockbox wouldn't have enough options, setttings...). I only speak for myself here though.

TheMarkster:
On my player (e200) sometimes the shut down via the power button doesn't respond the way I'd like.  At times I have to hold it down so long that the hardware powers down, bypassing the auto bookmark creation.  That's why I put the shutdown menu option in there in my custom build.  Besides that, rockbox boots back up in short order, so an accidental shutdown is not a biggie, especially if you have auto bookmarking on.

One thing I can't figure out is how to get the player to speak the new menu option.  I don't use the voice menus, but I'd still like to get it to work.  I should probably create a new thread, though.

Navigation

[0] Message Index

[#] Next page

Go to full version