freemyipod r630 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r629‎ | r630 | r631 >
Date:01:18, 20 February 2011
Author:theseven
Status:new
Tags:
Comment:
Installers: Fix button handling
Modified paths:
  • /apps/installer-ipodclassic/main.c (modified) (history)
  • /apps/installer-ipodnano2g/main.c (modified) (history)

Diff [purge]

Index: apps/installer-ipodclassic/main.c
@@ -106,6 +106,7 @@
107107 void handler(void* user, enum button_event eventtype, int which, int value)
108108 {
109109 if (eventtype == BUTTON_PRESS) button |= 1 << which;
 110+ if (eventtype == BUTTON_RELEASE) button &= ~(1 << which);
110111 if (eventtype == WHEEL_MOVED_ACCEL)
111112 scrollpos = MAX(0, MIN(295, scrollpos + value / 8));
112113 wakeup_signal(&eventwakeup);
@@ -362,7 +363,6 @@
363364 shutdown(false);
364365 reset();
365366 }
366 - button = 0;
367367 }
368368
369369 button_unregister_handler(hook);
Index: apps/installer-ipodnano2g/main.c
@@ -74,6 +74,7 @@
7575 void handler(void* user, enum button_event eventtype, int which, int value)
7676 {
7777 if (eventtype == BUTTON_PRESS) button |= 1 << which;
 78+ if (eventtype == BUTTON_RELEASE) button &= ~(1 << which);
7879 if (eventtype == WHEEL_MOVED_ACCEL)
7980 scrollpos = MAX(0, MIN(309, scrollpos + value / 8));
8081 wakeup_signal(&eventwakeup);
@@ -755,7 +756,6 @@
756757 shutdown(false);
757758 reset();
758759 }
759 - button = 0;
760760 }
761761
762762 button_unregister_handler(hook);
@@ -794,7 +794,6 @@
795795 shutdown(false);
796796 reset();
797797 }
798 - button = 0;
799798 }
800799
801800 button_unregister_handler(hook);
@@ -818,7 +817,6 @@
819818 break;
820819 }
821820 else if (button == 4) break;
822 - button = 0;
823821 }
824822
825823 button_unregister_handler(hook);