Skip to content

Commit

Permalink
Fixed fire detection stop
Browse files Browse the repository at this point in the history
  • Loading branch information
mckk committed Mar 12, 2012
1 parent 377057a commit 9df3876
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sender/SenderC.nc
Expand Up @@ -186,6 +186,7 @@ implementation
int avgTwo = 0; int avgTwo = 0;
int splitIndex; int splitIndex;
bool areNeighboursDark = TRUE; bool areNeighboursDark = TRUE;
bool isFire = FALSE;
FireMsg *pkt = NULL; FireMsg *pkt = NULL;


// The first condition is that all nodes detect that it is currently dark // The first condition is that all nodes detect that it is currently dark
Expand Down Expand Up @@ -224,6 +225,7 @@ implementation
// we have fire // we have fire
// turn on red led // turn on red led
call Leds.led0On(); call Leds.led0On();
isFire = TRUE;


if(!AMBusy) { if(!AMBusy) {
// send the fire message // send the fire message
Expand All @@ -235,7 +237,8 @@ implementation
} }
} }
} }
} else { }
if (!isFire) {
// fire may be over, ensure that the red ligh is turned off // fire may be over, ensure that the red ligh is turned off
call Leds.led0Off(); call Leds.led0Off();
} }
Expand Down

0 comments on commit 9df3876

Please sign in to comment.