Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Miscellany
Tuesday, March 6th, 2007 at 1:52:05am UTC 

  1. Index: firmware/target/arm/ipod/3g/button-3g.c
  2. ===================================================================
  3. --- firmware/target/arm/ipod/3g/button-3g.c     (revision 12631)
  4. +++ firmware/target/arm/ipod/3g/button-3g.c     (working copy)
  5. @@ -40,6 +40,8 @@
  6.  #include "system.h"
  7.  #include "powermgmt.h"
  8.  
  9. +#define MIN_SENSITIVITY 6
  10. +
  11.  /* iPod 3G and mini 1G, mini 2G uses iPod 4G code */
  12.  void handle_scroll_wheel(int new_scroll, int was_hold, int reverse)
  13.  {
  14. @@ -54,18 +56,30 @@
  15.          {0, -1, 1, 0}
  16.      };
  17.  
  18. +    /* Increases speed of scrolling if wheel rotated faster */
  19. +    static long old_tick = -1;
  20. +    long new_tick = current_tick;
  21. +    static int sensitivity = MIN_SENSITIVITY;
  22. +
  23. +    if ( TIME_AFTER( old_tick, new_tick ) >= 1 ) { /* lowest sensitivity */
  24. +        sensitivity = MIN_SENSITIVITY;
  25. +    }
  26. +    old_tick = new_tick;
  27. +
  28.      if ( prev_scroll == -1 ) {
  29.          prev_scroll = new_scroll;
  30.      }
  31.      else if (direction != scroll_state[prev_scroll][new_scroll]) {
  32.          direction = scroll_state[prev_scroll][new_scroll];
  33.          count = 0;
  34. +        sensitivity = MIN_SENSITIVITY;
  35.      }
  36.      else if (!was_hold) {
  37.          backlight_on();
  38.          reset_poweroff_timer();
  39. -        if (++count == 6) { /* reduce sensitivity */
  40. +        if (++count >= sensitivity ) { /* dynamic sensitivity */
  41.              count = 0;
  42. +            if ( --sensitivity == 0 ) sensitivity = 1;
  43.              switch (direction) {
  44.                  case 1:
  45.                      if (reverse) {

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right