Subversion Repositories FlightCtrl

Rev

Rev 1887 | Rev 1955 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1887 Rev 1908
Line 87... Line 87...
87
 
87
 
88
void flashingLights(void) {
88
void flashingLights(void) {
89
  static int8_t delay = 0;
89
  static int8_t delay = 0;
90
  if (!delay--) { // 10 ms intervals
90
  if (!delay--) { // 10 ms intervals
-
 
91
    delay = 4;
-
 
92
    if (beepModulation != BEEP_MODULATION_NONE) {
-
 
93
      // alarm
-
 
94
      flashingLight(0, 25, 0x55, 25);
-
 
95
      flashingLight(1, 25, 0xAA, 25);
91
    delay = 4;
96
    } else {
92
    flashingLight(0, staticParams.J16Timing, staticParams.J16Bitmask,
97
      flashingLight(0, staticParams.J16Timing, staticParams.J16Bitmask,
93
        dynamicParams.J16Timing);
98
          dynamicParams.J16Timing);
94
    flashingLight(1, staticParams.J17Timing, staticParams.J17Bitmask,
99
      flashingLight(1, staticParams.J17Timing, staticParams.J17Bitmask,
-
 
100
          dynamicParams.J17Timing);
95
        dynamicParams.J17Timing);
101
    }
96
  }
102
  }
Line 97... Line 103...
97
}
103
}
98
 
104
 
99
void output_update(void) {
105
void output_update(void) {
100
  if (!DIGITAL_DEBUG_MASK)
106
  if (!DIGITAL_DEBUG_MASK) {
101
    flashingLights();
107
    flashingLights();
102
  else if (DIGITAL_DEBUG_MASK == DEBUG_LEDTEST_ON) {
108
  } else if (DIGITAL_DEBUG_MASK == DEBUG_LEDTEST_ON) {
103
    OUTPUT_SET(0, 1);
109
    OUTPUT_SET(0, 1);
104
    OUTPUT_SET(1, 1);
110
    OUTPUT_SET(1, 1);
105
  } else if (DIGITAL_DEBUG_MASK == DEBUG_LEDTEST_OFF) {
111
  } else if (DIGITAL_DEBUG_MASK == DEBUG_LEDTEST_OFF) {
Line 136... Line 142...
136
 
142
 
137
/*
143
/*
138
 * Beep the R/C alarm signal
144
 * Beep the R/C alarm signal
139
 */
145
 */
140
void beepRCAlarm(void) {
146
void beepRCAlarm(void) {
141
  if(beepModulation == 0xFFFF) { // If not already beeping an alarm signal (?)
147
  if(beepModulation == BEEP_MODULATION_NONE) { // If not already beeping an alarm signal (?)
142
    beepTime = 15000; // 1.5 seconds
148
    beepTime = 15000; // 1.5 seconds
143
    beepModulation = 0x0C00;
149
    beepModulation = BEEP_MODULATION_RCALARM;
144
  }
150
  }
Line 145... Line 151...
145
}
151
}
146
 
152
 
147
/*
153
/*
148
 * Beep the I2C bus error signal
154
 * Beep the I2C bus error signal
149
 */
155
 */
150
void beepI2CAlarm(void) {
156
void beepI2CAlarm(void) {
151
  if((beepModulation == 0xFFFF) && (MKFlags & MKFLAG_MOTOR_RUN)) {
157
  if((beepModulation == BEEP_MODULATION_NONE) && (MKFlags & MKFLAG_MOTOR_RUN)) {
152
    beepTime = 10000; // 1 second
158
    beepTime = 10000; // 1 second
153
    beepModulation = 0x0080;
159
    beepModulation = BEEP_MODULATION_I2CALARM;
Line 154... Line 160...
154
  }
160
  }
155
}
161
}
156
 
162
 
157
/*
163
/*
158
 * Beep the battery low alarm signal
164
 * Beep the battery low alarm signal
159
 */
165
 */
160
void beepBatteryAlarm(void) {
166
void beepBatteryAlarm(void) {
161
  beepModulation = 0x0300;
167
  beepModulation = BEEP_MODULATION_BATTERYALARM;
162
  if(!beepTime) {
168
  if(!beepTime) {
Line 163... Line 169...
163
    beepTime = 6000; // 0.6 seconds
169
    beepTime = 6000; // 0.6 seconds
164
  }
170
  }
165
}
171
}
166
 
172
 
167
/*
173
/*
168
 * Beep the EEPROM checksum alarm
174
 * Beep the EEPROM checksum alarm
169
 */
175
 */
170
void beepEEPROMAlarm(void) {
176
void beepEEPROMAlarm(void) {
171
  beepModulation = 0x0007;
177
  beepModulation = BEEP_MODULATION_EEPROMALARM;