Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed fire detection stop

  • Loading branch information...
commit 9df387694c59119c84ca8175d31a183e3ac33a94 1 parent 377057a
Maciek Albin authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 Sender/SenderC.nc
5 Sender/SenderC.nc
View
@@ -186,6 +186,7 @@ implementation
int avgTwo = 0;
int splitIndex;
bool areNeighboursDark = TRUE;
+ bool isFire = FALSE;
FireMsg *pkt = NULL;
// The first condition is that all nodes detect that it is currently dark
@@ -224,6 +225,7 @@ implementation
// we have fire
// turn on red led
call Leds.led0On();
+ isFire = TRUE;
if(!AMBusy) {
// send the fire message
@@ -235,7 +237,8 @@ implementation
}
}
}
- } else {
+ }
+ if (!isFire) {
// fire may be over, ensure that the red ligh is turned off
call Leds.led0Off();
}
Please sign in to comment.
Something went wrong with that request. Please try again.