Skip to content

Commit de90644

Browse files
authored
Merge pull request #58 from TheCacophonyProject/r36
- Bump version r36
2 parents 864d2d8 + b5270b0 commit de90644

File tree

7 files changed

+25
-9
lines changed

7 files changed

+25
-9
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-22.04
1616

1717
env:
18-
RP2040_FIRMWARE_VERSION: 0.2.40
18+
RP2040_FIRMWARE_VERSION: 0.2.41
1919

2020
steps:
2121
- name: Checkout repository
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Rust
2525
uses: actions-rs/toolchain@v1
2626
with:
27-
toolchain: 1.89.0
27+
toolchain: 1.90.0
2828
override: true
2929
components: rustfmt, clippy
3030

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.89.0" # If changing this then also change it in .github/workflows/release.yaml rust toolchain
2+
channel = "1.90.0" # If changing this then also change it in .github/workflows/release.yaml rust toolchain
33
targets = ["aarch64-unknown-linux-musl"]

src/camera_transfer_state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ pub fn enter_camera_transfer_loop(
476476
firmware version: {firmware_version}"
477477
);
478478
let estimated_offload_mb =
479-
(num_blocks_to_offload * 128) as f32 / 1024.0;
479+
num_blocks_to_offload as f32 * 128.0 / 1024.0;
480480
let estimated_offload_time_seconds =
481481
(estimated_offload_mb * 2.0) / 60.0;
482482
if num_files_to_offload > 0 && num_events_to_offload > 0 {
@@ -696,6 +696,7 @@ pub fn enter_camera_transfer_loop(
696696
CAMERA_BEGIN_FILE_TRANSFER => {
697697
if file_download.is_some() {
698698
warn!("Trying to begin file without ending current");
699+
part_count = 0;
699700
}
700701
info!("Begin file transfer");
701702
// Open new file transfer

src/device_config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ fn default_location_accuracy() -> Option<f32> {
4848
fn default_output_dir() -> String {
4949
String::from("/var/spool/cptv")
5050
}
51+
52+
#[allow(dead_code)]
5153
fn default_activate_thermal_throttler() -> bool {
5254
false
5355
}
@@ -535,6 +537,7 @@ impl Default for ThermalRecordingSettings {
535537
}
536538

537539
#[derive(Deserialize, Debug, PartialEq, Clone)]
540+
#[allow(dead_code)]
538541
struct ThermalThrottlerSettings {
539542
#[serde(default = "default_activate_thermal_throttler")]
540543
activate: bool,

src/double_buffer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ impl DoubleBuffer {
2424

2525
pub fn get_front(&self) -> &Mutex<RefCell<Option<Frame>>> {
2626
let val = self.swapper.load(Ordering::Acquire);
27-
if val % 2 == 0 { &self.front } else { &self.back }
27+
if val.is_multiple_of(2) { &self.front } else { &self.back }
2828
}
2929

3030
pub fn get_back(&self) -> &Mutex<RefCell<Option<Frame>>> {
3131
let val = self.swapper.load(Ordering::Acquire);
32-
if val % 2 == 0 { &self.back } else { &self.front }
32+
if val.is_multiple_of(2) { &self.back } else { &self.front }
3333
}
3434
}

src/event_logger.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ impl From<u8> for FileType {
9090
}
9191
}
9292

93+
impl FileType {
94+
pub fn is_cptv(&self) -> bool {
95+
matches!(
96+
self,
97+
FileType::CptvScheduled
98+
| FileType::CptvUserRequested
99+
| FileType::CptvStartup
100+
| FileType::CptvShutdown
101+
)
102+
}
103+
}
104+
93105
#[derive(Copy, Clone, Debug)]
94106
pub struct DiscardedRecordingInfo {
95107
pub recording_type: FileType,
@@ -324,8 +336,8 @@ impl LoggerEvent {
324336
let num_frames = discard_info.num_frames;
325337
let seconds_since_last_ffc = discard_info.seconds_since_last_ffc;
326338
call.body
327-
.push_param(format!(r#"{{ "recording-type": "{recording_type:?}", "num-frames": "{num_frames}", "seconds-since-last-ffc": "{seconds_since_last_ffc}" }}"#))
328-
.unwrap();
339+
.push_param(format!(r#"{{ "recording-type": "{recording_type:?}", "num-frames": "{num_frames}", "seconds-since-last-ffc": "{seconds_since_last_ffc}" }}"#))
340+
.unwrap();
329341
call.body.push_param("WouldDiscardAsFalsePositive").unwrap();
330342
} else if let LoggerEventKind::Rp2040GotNewConfig(new_config_info) = self.event {
331343
let audio_mode = new_config_info.audio_mode;

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use crate::recording_state::RecordingState;
5252
const AUDIO_SHEBANG: u16 = 1;
5353

5454
const EXPECTED_RP2040_FIRMWARE_HASH: &str = include_str!("../_releases/tc2-firmware.sha256");
55-
const EXPECTED_RP2040_FIRMWARE_VERSION: u32 = 35;
55+
const EXPECTED_RP2040_FIRMWARE_VERSION: u32 = 36;
5656
const EXPECTED_ATTINY_FIRMWARE_VERSION: u8 = 1;
5757

5858
const SEGMENT_LENGTH: usize = 9760;

0 commit comments

Comments
 (0)