Rockbox General > Rockbox General Discussion

switching the hold button?

(1/2) > >>

cvitullo:
this seems easy in theory, but is it possible to switch the direction of the hold switch on the sansa? so when it would normally be engaged, it is off, and vice versa.

Mad Cow:
It's very possible, you would need to go into the button handling code and switch around the two hold switch position ADC readings. It should be easy, unless I'm understanding something wrong here.

EDIT: A quick look through the sansa's button code confused me, the hold didn't work like I thought it did from what I saw.

EDIT2: Actually, it looks pretty easy. On line 250 of firmware\target\arm\/sandisk/sansa-e200/button-e200.c change
--- Code: ---    hold_button = (state & 0x80) != 0;

--- End code ---
to whatever value is read when hold is off. At least I think that would be it.

cvitullo:
thanks a bunch! it's been bugging me since you have to wedge your finger in between the headphones and the switch to turn it off, and it felt like it should be switched.

cvitullo:
sorry to be a n00b, but where's the code? i'd try to edit it, but i can't find it.

Mad Cow:
http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling

Read up, it's confusing at first, but almost anybody can do it if they really tried. I had no previous coding experience and I ran a custom build for a while, it's really easy once you get the hang of it.

Navigation

[0] Message Index

[#] Next page

Go to full version