fix: compile error

This commit is contained in:
grabbit 2025-03-21 21:09:58 +08:00
parent cc7c5c92b0
commit c3bc0fe4eb
3 changed files with 12 additions and 4 deletions

View File

@ -229,7 +229,7 @@ pub struct OpenCVCaptureStream {
impl OpenCVCaptureStream {
/// Capture a single frame from the camera
pub fn capture_frame(&mut self) -> Result<core::Mat> {
let mut frame = core::Mat::default()?;
let mut frame = core::Mat::default();
if self.capture.read(&mut frame)? {
if frame.empty() {
return Err(anyhow!("Captured frame is empty"));

View File

@ -152,7 +152,7 @@ impl GpsController {
// Set up PPS edge detection (rising edge)
let last_pps = self.last_pps.clone();
match input_pin.set_async_interrupt(Trigger::RisingEdge, move |_| {
match input_pin.set_async_interrupt(Trigger::RisingEdge, Some(time::Duration::from_millis(20)), move |_| {
let now = Utc::now();
let mut last_pps = last_pps.lock().unwrap();
*last_pps = Some(now);
@ -249,9 +249,17 @@ impl GpsController {
// Create a separate thread for GPS processing (blocking I/O)
thread::spawn(move || {
info!("Starting GPS processing on port {}", port_name);
// Open the serial port
let port = serialport::new(&port_name, self.config.baud_rate)
.data_bits(Eight)
.flow_control(serialport::FlowControl::None)
.parity(serialport::Parity::None)
.stop_bits(serialport::StopBits::One)
.timeout(time::Duration::from_millis(1000));
// Get the port
let port = match serialport::open(&port_name) {
let port = match port.open() {
Ok(port) => port,
Err(e) => {
error!("Failed to open GPS port: {}", e);

View File

@ -9,7 +9,7 @@ use std::thread;
use std::time::Duration;
use tokio::sync::mpsc;
use crate::camera::frame_buffer::Frame;
use crate::camera::Frame;
/// Stream quality settings
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]