Skip to content

Commit 3cbfe9a

Browse files
committed
Track and report high priority audio alerts
1 parent ce7bf4e commit 3cbfe9a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,13 @@ void melody_play(int index, bool interrupt_melody)
217217
melody_notes=sizeof(melody_gotchi_fault)/sizeof(melody_gotchi_fault[0])/2;
218218
// this calculates the duration of a whole note in ms (60s/tempo)*4 beats
219219
melody_wholenote = (60000 * 4) / tempo_gotchi_fault;
220+
melody_last_alert_index = MELODY_GOTCHI_FAULT;
220221
break;
221222
case MELODY_ESC_FAULT:
222223
melody = (int*)&melody_esc_fault;
223224
melody_notes=sizeof(melody_esc_fault)/sizeof(melody_esc_fault[0])/2;
224225
melody_wholenote = (60000 * 4) / tempo_esc_fault;
226+
melody_last_alert_index = MELODY_ESC_FAULT;
225227
break;
226228
case MELODY_BLE_FAIL:
227229
melody = (int*)&melody_ble_fail;
@@ -242,21 +244,25 @@ void melody_play(int index, bool interrupt_melody)
242244
melody = (int*)&melody_storage_limit;
243245
melody_notes=sizeof(melody_storage_limit)/sizeof(melody_storage_limit[0])/2;
244246
melody_wholenote = (60000 * 4) / tempo_storage_limit;
247+
melody_last_alert_index = MELODY_STORAGE_LIMIT;
245248
break;
246249
case MELODY_ESC_TEMP:
247250
melody = (int*)&melody_esc_temp;
248251
melody_notes=sizeof(melody_esc_temp)/sizeof(melody_esc_temp[0])/2;
249252
melody_wholenote = (60000 * 4) / tempo_esc_temp;
253+
melody_last_alert_index = MELODY_ESC_TEMP;
250254
break;
251255
case MELODY_MOTOR_TEMP:
252256
melody = (int*)&melody_motor_temp;
253257
melody_notes=sizeof(melody_motor_temp)/sizeof(melody_motor_temp[0])/2;
254258
melody_wholenote = (60000 * 4) / tempo_motor_temp;
259+
melody_last_alert_index = MELODY_MOTOR_TEMP;
255260
break;
256261
case MELODY_VOLTAGE_LOW:
257262
melody = (int*)&melody_voltage_low;
258263
melody_notes=sizeof(melody_voltage_low)/sizeof(melody_voltage_low[0])/2;
259264
melody_wholenote = (60000 * 4) / tempo_voltage_low;
265+
melody_last_alert_index = MELODY_VOLTAGE_LOW;
260266
break;
261267
case MELODY_ASC:
262268
melody = (int*)&melody_ascending;

0 commit comments

Comments
 (0)