APMD-List:
Archives

  
Back

to

APMD

Home

      Index: [thread] [date] [subject] [author]
  From: Craig Markwardt <craigm@pcasun3.gsfc.nasa.gov>
  To  : <apmd-list@worldvisions.ca>
  Date: Tue, 7 Dec 1999 14:50:56 -0500 (EST)

PATCH> apmd-3.0beta9

Here are two small patches:

 * apmd.c: Estimate battery lifetime from longest available time
   baseline (ie, the "major" checkpoint).  Previous release used the
   shortest baseline and hence was highly oscillatory.

 * apmd_proxy: reset power_performance/conserve upon wake-up for
   drives that forget their timeout setting.

Craig

diff -ur apmd-3.0beta9/apmd.c apmd-3.0beta9cm1/apmd.c
--- apmd-3.0beta9/apmd.c	Mon Jul  5 18:21:56 1999
+++ apmd-3.0beta9cm1/apmd.c	Sat Dec  4 22:00:31 1999
@@ -673,8 +673,8 @@
 	    && !quiet)
 	warning = 1;
 
-    dt = time(0) - minor_checkpoint;
-    dp = minor_percentage - apmi->battery_percentage;
+    dt = time(0) - major_checkpoint;
+    dp = major_percentage - apmi->battery_percentage;
 
     /* If no warning, or no change since last logged message, then do nothing */
     if (!warning && (dt == 0 || dp == 0))
diff -ur apmd-3.0beta9/apmd_proxy apmd-3.0beta9cm1/apmd_proxy
--- apmd-3.0beta9/apmd_proxy	Mon Jul  5 18:29:32 1999
+++ apmd-3.0beta9cm1/apmd_proxy	Sun Nov 21 00:47:23 1999
@@ -222,6 +222,14 @@
 		fi
 	fi
 
+	# Drives can forget their time-out setting after suspend,
+	# so we may have to reprogram the drive.
+        if on_ac_power >/dev/null; then
+                power_performance
+        else
+                power_conserve
+        fi
+
 	# other common actions:  reload troublesome drivers
 	# EXAMPLE: reload OSS sound drivers.  Path may vary.
 	#	/usr/local/bin/soundon


Index: [thread] [date] [subject] [author]


Write to me! apenwarr@worldvisions.ca