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