@@ -217,11 +217,13 @@ void melody_play(int index, bool interrupt_melody)
217
217
melody_notes = sizeof (melody_gotchi_fault )/sizeof (melody_gotchi_fault [0 ])/2 ;
218
218
// this calculates the duration of a whole note in ms (60s/tempo)*4 beats
219
219
melody_wholenote = (60000 * 4 ) / tempo_gotchi_fault ;
220
+ melody_last_alert_index = MELODY_GOTCHI_FAULT ;
220
221
break ;
221
222
case MELODY_ESC_FAULT :
222
223
melody = (int * )& melody_esc_fault ;
223
224
melody_notes = sizeof (melody_esc_fault )/sizeof (melody_esc_fault [0 ])/2 ;
224
225
melody_wholenote = (60000 * 4 ) / tempo_esc_fault ;
226
+ melody_last_alert_index = MELODY_ESC_FAULT ;
225
227
break ;
226
228
case MELODY_BLE_FAIL :
227
229
melody = (int * )& melody_ble_fail ;
@@ -242,21 +244,25 @@ void melody_play(int index, bool interrupt_melody)
242
244
melody = (int * )& melody_storage_limit ;
243
245
melody_notes = sizeof (melody_storage_limit )/sizeof (melody_storage_limit [0 ])/2 ;
244
246
melody_wholenote = (60000 * 4 ) / tempo_storage_limit ;
247
+ melody_last_alert_index = MELODY_STORAGE_LIMIT ;
245
248
break ;
246
249
case MELODY_ESC_TEMP :
247
250
melody = (int * )& melody_esc_temp ;
248
251
melody_notes = sizeof (melody_esc_temp )/sizeof (melody_esc_temp [0 ])/2 ;
249
252
melody_wholenote = (60000 * 4 ) / tempo_esc_temp ;
253
+ melody_last_alert_index = MELODY_ESC_TEMP ;
250
254
break ;
251
255
case MELODY_MOTOR_TEMP :
252
256
melody = (int * )& melody_motor_temp ;
253
257
melody_notes = sizeof (melody_motor_temp )/sizeof (melody_motor_temp [0 ])/2 ;
254
258
melody_wholenote = (60000 * 4 ) / tempo_motor_temp ;
259
+ melody_last_alert_index = MELODY_MOTOR_TEMP ;
255
260
break ;
256
261
case MELODY_VOLTAGE_LOW :
257
262
melody = (int * )& melody_voltage_low ;
258
263
melody_notes = sizeof (melody_voltage_low )/sizeof (melody_voltage_low [0 ])/2 ;
259
264
melody_wholenote = (60000 * 4 ) / tempo_voltage_low ;
265
+ melody_last_alert_index = MELODY_VOLTAGE_LOW ;
260
266
break ;
261
267
case MELODY_ASC :
262
268
melody = (int * )& melody_ascending ;
0 commit comments