]> git.openpandora.org Git - pandora-libraries.git/commitdiff
pndevmapperd: don't blink when charging up
authorGrazvydas Ignotas <notasas@gmail.com>
Thu, 4 Aug 2011 22:09:29 +0000 (01:09 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 4 Aug 2011 22:09:29 +0000 (01:09 +0300)
there is no point attracting attention when charging up,
if bat is still low (I even find it annoying).

apps/pndevmapperd.c

index 2e1f651ce4f91c0f33f138ee9cbc5eb4f86347c0..09293a1777e6111bc9a9c6a2d2b6be9e5280df43 100644 (file)
@@ -940,7 +940,7 @@ void sigalrm_handler ( int n ) {
 
     // is user charging up? if so, stop blinking.
     // perhaps we shoudl check if charger is connected, and not blink at all in that case..
-    if ( batlevel > b_threshold + 1 /* allow for error in read */ ) {
+    if ( uamps > 0 ) {
       //Re-arm warning
       b_warned = 0;
       pnd_log ( pndn_debug, "Battery is high again, flipping to non-blinker mode\n" );
@@ -970,7 +970,7 @@ void sigalrm_handler ( int n ) {
   }
 
   // warning is off..
-  if ( batlevel <= b_threshold ) {
+  if ( batlevel <= b_threshold && uamps < 0 ) {
     // battery seems low, go to active mode
     pnd_log ( pndn_debug, "Battery is low, flipping to blinker mode\n" );
     b_active = 1;