Rockbox

Tasklist

FS#10285 - Sansa clip alternative button driver

Attached to Project: Rockbox
Opened by Bertrik Sikken (bertrik) - Saturday, 06 June 2009, 12:00 GMT
Last edited by Bertrik Sikken (bertrik) - Thursday, 11 June 2009, 22:18 GMT
Task Type Patches
Category Drivers
Status Closed
Assigned To No-one
Operating System Another
Severity Low
Priority Normal
Reported Version Version 3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Attached is an alternative driver for the Sansa Clip. This driver uses a kernel tick task to scan the button matrix.

Features:
+ fixes sansa clip button issues from  FS#10048 
+ no more explicit delays needed that need to be tuned so they work for all processor speeds.
+ the mechanism used may be suitable for other ams targets that use a button matrix too
- it can take up to three kernel tick (30 ms) for a button to be detected, so please test if you notice any latency issues
- buttons are scanned even when no application is asking for buttons to be read
- not tested in the bootloader yet
This task depends upon

Closed by  Bertrik Sikken (bertrik)
Thursday, 11 June 2009, 22:18 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed as svn revision 21253
Comment by Rafaël Carré (funman) - Tuesday, 09 June 2009, 00:05 GMT
very responsive : i played a bit chopper and snake2 at maximal speed without problems
Comment by Rafaël Carré (funman) - Tuesday, 09 June 2009, 19:33 GMT
Tested in bootloader: I had to enable interrupts before button driver is used, and also to sleep for 3 ticks.

Since the driver is responsive (just try snake at maximum level), the only problem remaining is that buttons are scanned even when not requested.

Can this draw more power from the battery ?
Comment by Rafaël Carré (funman) - Wednesday, 10 June 2009, 00:01 GMT
Don't use an extra kernel tick since button_read_device() is already called from a tick.

Could be done for m200v4 also but needs a tester
Comment by Bertrik Sikken (bertrik) - Thursday, 11 June 2009, 20:30 GMT
Attached patch is very similar to funman's, but scans all three rows at button initialisation to get an initial button state, instead of enabling irqs and doing a sleep(3) in the bootloader.
Comment by Rafaël Carré (funman) - Thursday, 11 June 2009, 20:36 GMT
have you tested it in the bootloader ? (press any button to get verbose rockbox loading)

Some buttons could not be read if the delay between row setting and column reading is not important enough.
Comment by Bertrik Sikken (bertrik) - Thursday, 11 June 2009, 21:05 GMT
Yes, I tested it in the bootloader. I see the bootloader text ("Loading firmware..") when pressing a button during boot (any button except left or down, those cause the OF to boot).
Comment by Rafaël Carré (funman) - Thursday, 11 June 2009, 21:32 GMT
The down button causing OF boot is a bug in mkamsboot' dualboot.S - not related to this task.

So is there anything left or the patch can be committed?

Loading...