Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: ciel on July 11, 2018, 12:49:47 PM

Title: Clip+ button_read_device
Post by: ciel on July 11, 2018, 12:49:47 PM
In firmware/target/arm/as3525/sansa-clipplus/button-clip.c, in the function button_read_device() lines 43-53, the code does some special handling for port D6. Does anyone know the details, e.g. why does B0 need to be set and unset? where do the number of cycles to delay for come from?
Title: Re: Clip+ button_read_device
Post by: saratoga on July 11, 2018, 01:25:15 PM
https://www.rockbox.org/wiki/Main/SansaAMSHardwareMappings#Button_readout

The delay is to allow enough time for the gpio to settle to the new value.

Edit: sorry you mean clip+. Not sure what that resets.
Title: Re: Clip+ button_read_device
Post by: Bilgus on July 11, 2018, 08:01:18 PM
As far as I can tell the clip+ doesn't need B0 set/unset and therefore doesn't need the delay to settle either..

I've a patch here:

http://gerrit.rockbox.org/r/#/c/1757/6/firmware/target/arm/as3525/sansa-clipplus/button-clip.c

Title: Re: Clip+ button_read_device
Post by: ciel on July 12, 2018, 01:28:10 PM
OK. I'm guessing it could be a remnant of the row/column keyscan method that the other Sansa devices use but the clip+ does not.
Title: Re: Clip+ button_read_device
Post by: Bilgus on July 12, 2018, 05:07:24 PM
possibly but thats not to say there isn't a clip+ out there that needs it maybe some other hardware revision thats why I left the code and just defined it out..