fix: compile error
This commit is contained in:
parent
cc7c5c92b0
commit
c3bc0fe4eb
@ -229,7 +229,7 @@ pub struct OpenCVCaptureStream {
|
|||||||
impl OpenCVCaptureStream {
|
impl OpenCVCaptureStream {
|
||||||
/// Capture a single frame from the camera
|
/// Capture a single frame from the camera
|
||||||
pub fn capture_frame(&mut self) -> Result<core::Mat> {
|
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 self.capture.read(&mut frame)? {
|
||||||
if frame.empty() {
|
if frame.empty() {
|
||||||
return Err(anyhow!("Captured frame is empty"));
|
return Err(anyhow!("Captured frame is empty"));
|
||||||
|
|||||||
@ -152,7 +152,7 @@ impl GpsController {
|
|||||||
|
|
||||||
// Set up PPS edge detection (rising edge)
|
// Set up PPS edge detection (rising edge)
|
||||||
let last_pps = self.last_pps.clone();
|
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 now = Utc::now();
|
||||||
let mut last_pps = last_pps.lock().unwrap();
|
let mut last_pps = last_pps.lock().unwrap();
|
||||||
*last_pps = Some(now);
|
*last_pps = Some(now);
|
||||||
@ -249,9 +249,17 @@ impl GpsController {
|
|||||||
// Create a separate thread for GPS processing (blocking I/O)
|
// Create a separate thread for GPS processing (blocking I/O)
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
info!("Starting GPS processing on port {}", port_name);
|
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
|
// Get the port
|
||||||
let port = match serialport::open(&port_name) {
|
let port = match port.open() {
|
||||||
Ok(port) => port,
|
Ok(port) => port,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("Failed to open GPS port: {}", e);
|
error!("Failed to open GPS port: {}", e);
|
||||||
|
|||||||
@ -9,7 +9,7 @@ use std::thread;
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
|
||||||
use crate::camera::frame_buffer::Frame;
|
use crate::camera::Frame;
|
||||||
|
|
||||||
/// Stream quality settings
|
/// Stream quality settings
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user