Merge branch 'master' of git.opendreambox.org:/git/enigma2
authorghost <andreas.monzner@multimedia-labs.de>
Fri, 6 Feb 2009 15:40:17 +0000 (16:40 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Fri, 6 Feb 2009 15:40:17 +0000 (16:40 +0100)
lib/python/Components/Harddisk.py

index 404baafa0718cb7d54981e52a11843aff388c3f5..44245ebb8b16847426cc0a83a276e459da908988 100644 (file)
@@ -248,15 +248,21 @@ class Harddisk:
 
                idle_time = t - self.last_access
 
-               l = sum(self.readStats())
+               stats = self.readStats()
+               print "nr_read", stats[0], "nr_write", stats[1]
+               l = sum(stats)
+               print "sum", l, "prev_sum", self.last_stat
 
                if l != self.last_stat: # access
+                       print "hdd was accessed since previous check!"
                        self.last_stat = l
                        self.last_access = t
                        self.idle_time = 0
                        self.is_sleeping = False
+               else:
+                       print "hdd IDLE!"
 
-               #print "[IDLE]", idle_time, self.max_idle_time, self.is_sleeping
+               print "[IDLE]", idle_time, self.max_idle_time, self.is_sleeping
                if idle_time >= self.max_idle_time and not self.is_sleeping:
                        self.setSleep()
                        self.is_sleeping = True
@@ -270,7 +276,7 @@ class Harddisk:
                        if not idle:
                                self.timer.stop()
                        else:
-                               self.timer.start(idle * 250, False)  # poll 4 times per period.
+                               self.timer.start(idle * 100, False)  # poll 10 times per period.
 
        def isSleeping(self):
                return self.is_sleeping