minor formatting update

This commit is contained in:
swaits committed 2010-09-30 21:34:55 +00:00
1 parent e4e0d92857
commit f9d527d3f3
1 file changed
+10 -2
+10 -2
View File
@@ -118,10 +118,14 @@ int readline()
if ( (flags & POWER_GOOD_BITS) != POWER_GOOD_BITS ) if ( (flags & POWER_GOOD_BITS) != POWER_GOOD_BITS )
{ {
if ( (flags & BATT_GOOD_BITS) != BATT_GOOD_BITS ) if ( (flags & BATT_GOOD_BITS) != BATT_GOOD_BITS )
{
nextstate = U_LOW; nextstate = U_LOW;
}
else else
{
nextstate = U_FAIL; nextstate = U_FAIL;
} }
}
// count the time we've been in this new state // count the time we've been in this new state
if ( nextstate != lastnextstate ) if ( nextstate != lastnextstate )
@@ -132,8 +136,10 @@ int readline()
{ {
// keep this from overflowing // keep this from overflowing
if ( count <= DEBOUNCE_TIME ) if ( count <= DEBOUNCE_TIME )
{
count += POLL_INTERVAL; count += POLL_INTERVAL;
} }
}
lastnextstate = nextstate; lastnextstate = nextstate;
// and if we exceed the threshold take the state as our current // and if we exceed the threshold take the state as our current
@@ -150,7 +156,9 @@ void term()
syslog(LOG_NOTICE,"caught signal."); syslog(LOG_NOTICE,"caught signal.");
init(); init();
if ( fd != -1 ) if ( fd != -1 )
{
close(fd); close(fd);
}
syslog(LOG_NOTICE,"terminated."); syslog(LOG_NOTICE,"terminated.");
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
@@ -233,7 +241,9 @@ int main(int argc,char** argv)
{ {
// warn if we just got the signal! // warn if we just got the signal!
if ( laststate != U_LOW ) if ( laststate != U_LOW )
{
lowmessage(); lowmessage();
}
// set kill signal // set kill signal
if ( killtime == 0 ) if ( killtime == 0 )
@@ -289,5 +299,3 @@ int main(int argc,char** argv)
} }
} }