Skip to content

Commit

Permalink
renamed alarm variables from beep_ to notification_
Browse files Browse the repository at this point in the history
git-svn-id: http://multiwii.googlecode.com/svn/trunk/MultiWii_shared@1170 02679b44-d973-9852-f2fa-63770883b36c
  • Loading branch information
[email protected] committed Oct 6, 2012
1 parent 94c2b45 commit e198979
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
28 changes: 14 additions & 14 deletions Alarms.ino
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ static uint32_t channelLastToggleTime[5] ={0,0,0,0,0};
#if defined(RCOPTIONSBEEP)
static uint8_t i = 0,firstrun = 1, last_rcOptions[CHECKBOXITEMS];

if (last_rcOptions[i] != rcOptions[i])beep_toggle = 1;
if (last_rcOptions[i] != rcOptions[i])notification_toggle = 1;
last_rcOptions[i] = rcOptions[i];
i++;
if(i >= CHECKBOXITEMS)i=0;

if(firstrun == 1 && beep_confirmation == 0){
beep_toggle = 0; //only enable options beep AFTER gyro init
if(firstrun == 1 && notification_confirmation == 0){
notification_toggle = 0; //only enable options beep AFTER gyro init
beeperOnBox = 0;
}
else firstrun = 0;
Expand Down Expand Up @@ -83,21 +83,21 @@ static uint32_t channelLastToggleTime[5] ={0,0,0,0,0};
//D: Double, L: Long, M: Middle, S: Short, N: None
if (warn_failsafe == 2) beep_code('L','N','N','D');
else if (warn_failsafe == 1) beep_code('S','L','L','S');
else if (beep_toggle == 1) {beep_code('S','N','N','N'); }
else if (beep_toggle == 2) beep_code('S','S','N','N');
else if (beep_toggle > 2) beep_code('S','S','S','N');
else if (notification_toggle == 1) beep_code('S','N','N','N');
else if (notification_toggle == 2) beep_code('S','S','N','N');
else if (notification_toggle > 2) beep_code('S','S','S','N');
else if (warn_noGPSfix == 1) beep_code('S','S','N','S');
else if (beeperOnBox == 1) beep_code('S','S','S','S');
else if (warn_pMeter == 1 && f.ARMED == 1) beep_code('S','S','N','M');
else if (warn_runtime == 1 && f.ARMED == 1)beep_code('S','S','S','N');
else if (warn_vbat == 4) beep_code('M','S','M','S'); // beep_code('S','S','L','D');
else if (warn_vbat == 2) beep_code('M','N','M','D'); // beep_code('S','L','N','D');
else if (warn_vbat == 1) beep_code('M','N','N','D'); // beep_code('L','N','N','D');
else if (beep_confirmation == 1) beep_code('L','N','N','L');
else if (beep_confirmation == 2) beep_code('L','L','N','L');
else if (beep_confirmation == 3) beep_code('L','L','L','L');
else if (beep_confirmation == 4) beep_code('L','M','S','N');
else if (beep_confirmation > 4) beep_code('L','L','L','L');
else if (notification_confirmation == 1) beep_code('L','N','N','L');
else if (notification_confirmation == 2) beep_code('L','L','N','L');
else if (notification_confirmation == 3) beep_code('L','L','L','L');
else if (notification_confirmation == 4) beep_code('L','M','S','N');
else if (notification_confirmation > 4) beep_code('L','L','L','L');
else if (buzzerSequenceActive == 1) beep_code('N','N','N','N'); //if no signal is needed, finish sequence if not finished yet
else{ //reset everything and keep quiet
if (channelIsOn[1]) {
Expand Down Expand Up @@ -140,8 +140,8 @@ static uint32_t channelLastToggleTime[5] ={0,0,0,0,0};
}
if (icnt >=3 && (channelLastToggleTime[1]<millis()-Duration) ){
icnt=0;
if (beep_toggle)beep_toggle = 0;
if (beep_confirmation)beep_confirmation = 0;
if (notification_toggle)notification_toggle = 0;
if (notification_confirmation)notification_confirmation = 0;
buzzerSequenceActive = 0; //sequence is now done, next sequence may begin
if (channelIsOn[1]) {
BUZZERPIN_OFF;
Expand Down Expand Up @@ -535,4 +535,4 @@ void blinkLED(uint8_t num, uint8_t ontime,uint8_t repeat) {
switch_landing_lights(0);
}
}
#endif
#endif
8 changes: 4 additions & 4 deletions LCD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ void lcdprint_int16(int16_t v) {
void initLCD() {
blinkLED(20,30,1);
#if defined(BUZZER)
beep_confirmation = 1;
notification_confirmation = 1;
#endif
#if defined(LCD_SERIAL3W)
SerialEnd(0);
Expand Down Expand Up @@ -1171,7 +1171,7 @@ static uint8_t lcdStickState[4];
void ConfigRefresh(uint8_t p) {
blinkLED(10,20,1);
#if defined(BUZZER)
beep_toggle = 1;
notification_toggle = 1;
#endif
strcpy_P(line1,PSTR(" "));
strcpy(line2,line1);
Expand All @@ -1192,7 +1192,7 @@ void ConfigRefresh(uint8_t p) {
#ifndef OLED_I2C_128x64
blinkLED(2,4,1);
#if defined(BUZZER)
beep_toggle = 1;
notification_toggle = 1;
#endif
LCDclear();
#else
Expand Down Expand Up @@ -1276,7 +1276,7 @@ void configurationLoop() {
} // while (LCD == 1)
blinkLED(20,30,1);
#if defined(BUZZER)
beep_confirmation = 1;
notification_confirmation = 1;
#endif

LCDclear();
Expand Down
10 changes: 5 additions & 5 deletions MultiWii.ino
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ static struct {
static uint8_t nav_mode = NAV_MODE_NONE; //Navigation mode

#if defined(BUZZER)
static uint8_t beep_toggle = 0,
beep_confirmation = 0;
static uint8_t notification_toggle = 0,
notification_confirmation = 0;
#endif


Expand Down Expand Up @@ -772,9 +772,9 @@ void loop () {
AccInflightCalibrationArmed = !AccInflightCalibrationArmed;
#if defined(BUZZER)
if (AccInflightCalibrationArmed){
beep_toggle = 2;
notification_toggle = 2;
} else {
beep_toggle = 3;
notification_toggle = 3;
}
#endif
}
Expand Down Expand Up @@ -1183,4 +1183,4 @@ void loop () {
mixTable();
writeServos();
writeMotors();
}
}
2 changes: 1 addition & 1 deletion Output.ino
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ void initOutput() {
delay(5000);
blinkLED(2,20, 2);
#if defined(BUZZER)
beep_confirmation = 2;
notification_confirmation = 2;
#endif
}
exit; // statement never reached
Expand Down
6 changes: 3 additions & 3 deletions Sensors.ino
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void GYRO_Common() {
gyroZero[axis]=g[axis]/400;
blinkLED(10,15,1);
#if defined(BUZZER)
beep_confirmation = 4;
notification_confirmation = 4;
#endif
}
}
Expand Down Expand Up @@ -380,7 +380,7 @@ void ACC_Common() {
AccInflightCalibrationActive = 0;
AccInflightCalibrationMeasurementDone = 1;
#if defined(BUZZER)
beep_confirmation = 1; //buzzer for indicatiing the end of calibration
notification_confirmation = 1; //buzzer for indicatiing the end of calibration
#endif
// recover saved values to maintain current flight behavior until new values are transferred
global_conf.accZero[ROLL] = accZero_saved[ROLL] ;
Expand Down Expand Up @@ -1453,7 +1453,7 @@ void i2c_srf08_change_addr(int8_t current, int8_t moveto) {
i2c_writeReg(current, SRF08_REV_COMMAND, moveto); delay(30); // now change i2c address
blinkLED(5,1,2);
#if defined(BUZZER)
beep_confirmation = 2;
notification_confirmation = 2;
#endif
}

Expand Down

0 comments on commit e198979

Please sign in to comment.