mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
gate camera wdt behind a feature flag
not needed in all scenarios
This commit is contained in:
parent
5882bc7b71
commit
d325f80e31
2 changed files with 7 additions and 0 deletions
|
|
@ -63,6 +63,7 @@ hosted-baosec = ["bao1x-emu", "ux-api/hosted-baosec", "no-gam"]
|
||||||
autotest = []
|
autotest = []
|
||||||
# factory feature - makes it keep on scanning forever - used for calibrating factory test jigs
|
# factory feature - makes it keep on scanning forever - used for calibrating factory test jigs
|
||||||
eternal-scan = []
|
eternal-scan = []
|
||||||
|
cam-watchdog = []
|
||||||
|
|
||||||
with-logo = []
|
with-logo = []
|
||||||
bao1x = ["utralib/bao1x", "blitstr2/bao1x"]
|
bao1x = ["utralib/bao1x", "blitstr2/bao1x"]
|
||||||
|
|
|
||||||
|
|
@ -432,6 +432,7 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! {
|
||||||
let mut bw_thresh: u8 = 128;
|
let mut bw_thresh: u8 = 128;
|
||||||
let mut qr_request: Option<xous::MessageEnvelope> = None;
|
let mut qr_request: Option<xous::MessageEnvelope> = None;
|
||||||
let mut kbd_listeners: Vec<(CID, usize)> = Vec::new();
|
let mut kbd_listeners: Vec<(CID, usize)> = Vec::new();
|
||||||
|
#[cfg(feature = "cam-watchdog")]
|
||||||
let cam_started = Arc::new(AtomicBool::new(false));
|
let cam_started = Arc::new(AtomicBool::new(false));
|
||||||
let mut dry_run = false;
|
let mut dry_run = false;
|
||||||
#[allow(unused_mut)]
|
#[allow(unused_mut)]
|
||||||
|
|
@ -514,9 +515,13 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! {
|
||||||
cam.set_slicing((border, 0), (cols - border, IMAGE_HEIGHT));
|
cam.set_slicing((border, 0), (cols - border, IMAGE_HEIGHT));
|
||||||
log::info!("320x240 resolution setup with 256x240 slicing");
|
log::info!("320x240 resolution setup with 256x240 slicing");
|
||||||
|
|
||||||
|
#[cfg(feature = "cam-watchdog")]
|
||||||
cam_started.store(false, Ordering::SeqCst);
|
cam_started.store(false, Ordering::SeqCst);
|
||||||
|
#[cfg(not(feature = "cam-watchdog"))]
|
||||||
|
hal.set_preemption(false);
|
||||||
|
|
||||||
// start watchdog to make sure camera is running
|
// start watchdog to make sure camera is running
|
||||||
|
#[cfg(feature = "cam-watchdog")]
|
||||||
let _ = std::thread::spawn({
|
let _ = std::thread::spawn({
|
||||||
let cid = cid.clone();
|
let cid = cid.clone();
|
||||||
let cam_started = cam_started.clone();
|
let cam_started = cam_started.clone();
|
||||||
|
|
@ -600,6 +605,7 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GfxOpcode::CamIrq => {
|
GfxOpcode::CamIrq => {
|
||||||
|
#[cfg(feature = "cam-watchdog")]
|
||||||
cam_started.store(true, Ordering::SeqCst);
|
cam_started.store(true, Ordering::SeqCst);
|
||||||
// copy the camera data to our FB
|
// copy the camera data to our FB
|
||||||
let fb: &[u32] = cam.rx_buf();
|
let fb: &[u32] = cam.rx_buf();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue