diff --git a/master/master/config.h b/master/master/config.h --- a/master/master/config.h +++ b/master/master/config.h @@ -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 diff --git a/master/master/master.c b/master/master/master.c --- a/master/master/master.c +++ b/master/master/master.c @@ -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) {