Changeset - 62fbc7ad93b6
[Not reviewed]
default
0 2 0
ethanzonca@CL-ENS241-08.cedarville.edu - 12 years ago 2013-03-25 15:28:26
ethanzonca@CL-ENS241-08.cedarville.edu
Fixed buzzer busy wait
2 files changed with 13 insertions and 5 deletions:
0 comments (0 inline, 0 general)
master/master/config.h
Show inline comments
 
@@ -38,8 +38,8 @@
 
#define HEATER_THRESHOLD 80
 
 
// Touchdown buzzer
 
#define BUZZER_RATE 3000
 
#define BUZZER_DURATION 3000
 
#define BUZZER_RATE 5000
 
#define BUZZER_DURATION 1000
 
#define BUZZER_FAILSAFE_DURATION 600000
 
#define BUZZER_TRIGGER_MINDURATION 1
 
#define BUZZER_TRIGGER_MAXALTITUDE 1
 
@@ -118,7 +118,7 @@
 
// --------------------------------------------------------------------------
 

	
 
// TX delay in milliseconds
 
#define TX_DELAY      500
 
#define TX_DELAY      200
 

	
 
// Maximum packet delay
 
#define MAX_PACKET_LEN 512  // bytes
master/master/master.c
Show inline comments
 
@@ -67,6 +67,9 @@ int main(void)
 
	uint32_t lastLedCycle = 0;
 
	uint32_t lastDataReq = 0;
 
	uint32_t lastBuzz = 0;
 
	uint32_t lastBuzzOn = 0;
 
	
 
	bool buzz = false;
 
	
 
	// Result of last parser run
 
	int parseResult = PARSERESULT_NODATA;
 
@@ -122,12 +125,17 @@ int main(void)
 
			if(sensordata_isTouchdown())
 
			{
 
				led_on(LED_BUZZ);
 
				_delay_ms(BUZZER_DURATION);
 
				led_off(LED_BUZZ);
 
				lastBuzzOn = time_millis();
 
				buzz = true;
 
			}			
 
			lastBuzz = time_millis();
 
		}
 
		
 
		if(buzz && time_millis() - lastBuzzOn > BUZZER_DURATION) {
 
			led_off(LED_BUZZ);
 
			buzz = false;
 
		}
 
		
 
		// Periodic: Data Request
 
		if(time_millis() - lastDataReq > DATAREQUEST_RATE)  
 
		{
0 comments (0 inline, 0 general)