Skip to content

Commit

Permalink
update messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed Apr 9, 2024
1 parent d1ad96c commit 6a00ecc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/event_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum LoggerEventKind {
Rp2040WokenByAlarm,
RtcCommError,
AttinyCommError,
Rp2040Woken,
Rp2040MissedAudioAlarm,
}

impl Into<u16> for LoggerEventKind {
Expand All @@ -47,7 +47,7 @@ impl Into<u16> for LoggerEventKind {
Rp2040WokenByAlarm => 17,
RtcCommError => 18,
AttinyCommError => 19,
Rp2040Woken => 20,
Rp2040MissedAudioAlarm => 20,
}
}
}
Expand Down Expand Up @@ -77,7 +77,7 @@ impl TryFrom<u16> for LoggerEventKind {
17 => Ok(Rp2040WokenByAlarm),
18 => Ok(RtcCommError),
19 => Ok(AttinyCommError),
20 => Ok(Rp2040Woken),
20 => Ok(Rp2040MissedAudioAlarm),
_ => Err(()),
}
}
Expand Down
11 changes: 8 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ fn main() {
let (tx, rx) = channel();
let (restart_tx, restart_rx) = channel();
let cross_thread_signal: Arc<AtomicBool> = Arc::new(AtomicBool::new(false));
if frame_acquire{
if frame_acquire {
let cross_thread_signal_2 = cross_thread_signal.clone();

let _ = thread::Builder::new().name("frame-socket".to_string()).spawn_with_priority(ThreadPriority::Max, move |result| {
Expand Down Expand Up @@ -597,7 +597,7 @@ fn main() {
}
});
}
info!("Waiting to acquire frames from rp2040");
info!("Waiting to for messages from rp2040");
// Poke register 0x07 of the attiny letting the rp2040 know that we're ready:
let mut attiny_i2c_interface = None;
if let Ok(mut attiny_i2c) = I2c::new() {
Expand Down Expand Up @@ -935,7 +935,12 @@ fn main() {
part_count = 0;
let mut file = Vec::new();
file.extend_from_slice(&chunk);
save_cptv_file_to_disk(file, device_config.output_dir());
let shebang = u8_slice_as_u16_slice(&file[0..2]);
if shebang[0] == AUDIO_SHEBANG{
save_audio_file_to_disk(file, device_config.output_dir());
}else{
save_cptv_file_to_disk(file, device_config.output_dir())
}
let _ = tx.send((None, Some(false)));
}
CAMERA_GET_MOTION_DETECTION_MASK => {
Expand Down

0 comments on commit 6a00ecc

Please sign in to comment.