Skip to content

Commit

Permalink
slight tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed Mar 18, 2024
1 parent f0e3e7f commit b65f2be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/device_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ impl DeviceConfig {
pub fn load_last_offload(&mut self) {
let offload_fs =
fs::read("/etc/cacophony/.offload_time");
// .map_err(|_| "Error reading file from disk")?;
let last_offload = match offload_fs{
Ok(file_data) => Some(LittleEndian::read_i64(&file_data[0..8])),
_ => {
Expand Down
22 changes: 2 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod telemetry;
mod utils;

use byteorder::{BigEndian, ByteOrder, LittleEndian};
use chrono::{DateTime, NaiveDateTime};
use chrono::{ NaiveDateTime};
use rppal::spi::BitOrder;
use rppal::{
gpio::{Gpio, Trigger},
Expand Down Expand Up @@ -37,7 +37,7 @@ use crate::event_logger::{LoggerEvent, LoggerEventKind};
use crate::mode_config::ModeConfig;
use crate::socket_stream::{get_socket_address, SocketStream};
use crate::telemetry::{read_telemetry, Telemetry};
use crate::utils::{u8_slice_as_u16_slice};
use crate::utils::u8_slice_as_u16_slice;
use crate::ExtTransferMessage::{
BeginAndEndFileTransfer, BeginFileTransfer, CameraConnectInfo,
CameraRawFrameTransfer, EndFileTransfer, GetMotionDetectionMask, ResumeFileTransfer,
Expand Down Expand Up @@ -197,23 +197,6 @@ fn save_audio_file_to_disk(audio_bytes: Vec<u8>, output_dir: &str) {
}
}

// NOTE: For debug purposes, we may want to also save the CPTV file locally for inspection.
// let path = format!(
// "{}/{}.cptv",
// "/home/pi",
// recording_date_time.format("%Y-%m-%d--%H-%M-%S")
// );
// match fs::write(&path, &cptv_bytes) {
// Ok(()) => {
// info!("Saved CPTV file {}", path);
// }
// Err(e) => {
// error!(
// "Failed writing CPTV file to storage at {}, reason: {}",
// path, e
// );
// }
// }
} else {
error!("File {} already exists, discarding duplicate", path);
}
Expand Down Expand Up @@ -666,7 +649,6 @@ fn main() {
LittleEndian::write_u16(&mut return_payload_buf[6..8], 0);
spi.write(&return_payload_buf).unwrap();
if process_interrupted(&term, &mut attiny_i2c_interface) {
info!("ENDING PROCESS");
break 'transfer;
}
continue 'transfer;
Expand Down

0 comments on commit b65f2be

Please sign in to comment.