Skip to content

Commit

Permalink
only log end if not discarded
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed Aug 13, 2024
1 parent 2735319 commit 797d013
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
7 changes: 0 additions & 7 deletions src/core0_audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,6 @@ pub fn offload(
if let Ok(mut awake) = i2c.pi_is_awake_and_tc2_agent_is_ready(delay, true) {
if !awake && wake_if_asleep {
watchdog.disable();
event_logger.log_event(
LoggerEvent::new(
LoggerEventKind::ToldRpiToWake(7),
synced_date_time.get_timestamp_micros(&timer),
),
flash_storage,
);
wake_raspberry_pi(i2c, delay);
awake = true;
watchdog.start(8388607.micros());
Expand Down
15 changes: 8 additions & 7 deletions src/core1_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,13 +946,6 @@ pub fn core_1_task(
.set_recording_flag(&mut delay, false)
.map_err(|e| error!("Error clearing recording flag on attiny: {}", e));

event_logger.log_event(
LoggerEvent::new(
LoggerEventKind::EndedRecording,
synced_date_time.get_timestamp_micros(&timer),
),
&mut flash_storage,
);
if !making_status_recording
&& motion_detection.as_ref().unwrap().was_false_positive()
// && cptv_stream.num_frames <= 100
Expand All @@ -973,6 +966,14 @@ pub fn core_1_task(
),
&mut flash_storage,
);
} else {
event_logger.log_event(
LoggerEvent::new(
LoggerEventKind::EndedRecording,
synced_date_time.get_timestamp_micros(&timer),
),
&mut flash_storage,
);
}
if making_status_recording {
making_status_recording = false;
Expand Down

0 comments on commit 797d013

Please sign in to comment.