@@ -180,6 +180,7 @@ bool is_melody_playing_pause = false;
180
180
uint32_t melody_next_note = 0 ;
181
181
int * melody ;
182
182
int melody_last_alert_index = MELODY_NONE ;
183
+ uint16_t melody_snooze_seconds = 0 ;
183
184
184
185
185
186
uint32_t app_timer_ms (uint32_t ticks )
@@ -203,7 +204,7 @@ uint32_t millis(void)
203
204
204
205
void melody_play (int index , bool interrupt_melody )
205
206
{
206
- if (is_melody_playing && !interrupt_melody )
207
+ if (is_melody_playing && !interrupt_melody || melody_snooze_seconds > 0 )
207
208
{
208
209
return ;
209
210
}
@@ -1635,6 +1636,12 @@ static void logging_timer_handler(void *p_context) {
1635
1636
1636
1637
strftime (datetimestring , 64 , "%Y-%m-%dT%H:%M:%S" , tmTime );
1637
1638
1639
+ // Decrement melody snooze counter if active
1640
+ if (melody_snooze_seconds > 0 )
1641
+ {
1642
+ -- melody_snooze_seconds ;
1643
+ }
1644
+
1638
1645
// Write GPS status to display
1639
1646
Adafruit_GFX_setCursor (64 ,8 );
1640
1647
snprintf (gps_status , sizeof (gps_status ), "GPS %02d S%01d%01d" , hgps .seconds , hgps .is_valid , hgps .fix );
@@ -2135,7 +2142,7 @@ void log_file_start()
2135
2142
void update_status_packet (char * buffer )
2136
2143
{
2137
2144
// Update the buffer with the a status response packet
2138
- sprintf (buffer , "status,OK,%d,%d,%d,%d,%d,%d,%d,%d" , log_file_active , fault_count , recent_fault_index , lfs_percent_free , lfs_file_count , hgps .fix , hgps .sats_in_view , melody_last_alert_index );
2145
+ sprintf (buffer , "status,OK,%d,%d,%d,%d,%d,%d,%d,%d,%d " , log_file_active , fault_count , recent_fault_index , lfs_percent_free , lfs_file_count , hgps .fix , hgps .sats_in_view , melody_last_alert_index , melody_snooze_seconds );
2139
2146
}
2140
2147
2141
2148
uint16_t create_fault_packet (char * buffer )
0 commit comments