From: Grazvydas Ignotas Date: Thu, 4 Aug 2011 22:09:29 +0000 (+0300) Subject: pndevmapperd: don't blink when charging up X-Git-Tag: sz_beta3~42 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3befce9f155639bc1f28572dcbece8859ff0cd9f;p=pandora-libraries.git pndevmapperd: don't blink when charging up there is no point attracting attention when charging up, if bat is still low (I even find it annoying). --- diff --git a/apps/pndevmapperd.c b/apps/pndevmapperd.c index 2e1f651..09293a1 100644 --- a/apps/pndevmapperd.c +++ b/apps/pndevmapperd.c @@ -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;