feat(quiet): gate F640 SDO reads and SMDBG probes behind --quiet; eliminates 5-7ms stall family (67/30min -> 0), hop max 7095->555us, cycle 565->539us p50, rate +5% (1872Hz)
This commit is contained in:
parent
2782c769d2
commit
eb48b7be6c
10
src/main.rs
10
src/main.rs
|
|
@ -1671,7 +1671,7 @@ async fn run(cfg: &Config) -> Result<(), Box<dyn std::error::Error>> {
|
|||
// ---- rfm-async: event-driven forwarder, no tick ----
|
||||
if cfg.mode == Mode::RfmAsync {
|
||||
let rfm = rfm_ctx.take().expect("rfm not opened");
|
||||
return rfm_async_loop(&maindevice, station, rfm, cfg.duration_sec, cfg.fprd_gate_us, cfg.dc_discipline, &sd, cfg.dc_align, cfg.sync_offset_ns, cfg.dc_wphase_ns, cfg.rx_bytes, cfg.tx_bytes).await;
|
||||
return rfm_async_loop(&maindevice, station, rfm, cfg.duration_sec, cfg.fprd_gate_us, cfg.dc_discipline, &sd, cfg.dc_align, cfg.sync_offset_ns, cfg.dc_wphase_ns, cfg.rx_bytes, cfg.tx_bytes, cfg.quiet).await;
|
||||
}
|
||||
|
||||
// ---- rfm-lrw: single-frame read+write loop ----
|
||||
|
|
@ -2651,6 +2651,7 @@ async fn rfm_async_loop(
|
|||
dc_wphase_ns: i64,
|
||||
rx_bytes: usize,
|
||||
tx_bytes: usize,
|
||||
quiet: bool,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
use el6695_rt::rfm::*;
|
||||
println!("rfm-async: event-driven forwarding, no tick (Ctrl-C to stop)");
|
||||
|
|
@ -3008,7 +3009,8 @@ async fn rfm_async_loop(
|
|||
{ let n = Instant::now(); seg_fprd_us = n.duration_since(cursor).as_micros() as u64; cursor = n; }
|
||||
|
||||
// F640 remote-write-cycle counter (independent of reap path)
|
||||
if n_fpwr > 0 && n_fpwr % 8192 == 0 && last_f640_print != n_fpwr {
|
||||
// gated in --quiet: the CoE SDO read stalls the wire 1-4ms.
|
||||
if !quiet && n_fpwr > 0 && n_fpwr % 8192 == 0 && last_f640_print != n_fpwr {
|
||||
last_f640_print = n_fpwr;
|
||||
let c = sd.sdo_read::<u16>(0xF640, 1).await;
|
||||
println!(" F640CNT n={} count={:?}", n_fpwr, c);
|
||||
|
|
@ -3122,8 +3124,8 @@ async fn rfm_async_loop(
|
|||
}
|
||||
}
|
||||
if last_report.elapsed() >= Duration::from_secs(10) {
|
||||
// SM 鎺㈤拡: 姣?绉掕 SM2/SM3 浣胯兘浣?+ SM2 缂撳啿, 鍖哄垎鍒嗛厤鏈敓鏁?vs 妗ヤ笉杞彂
|
||||
if start.elapsed().as_secs() % 30 == 0 {
|
||||
// SM probe: --quiet gated (register reads on the wire)
|
||||
if !quiet && start.elapsed().as_secs() % 30 == 0 {
|
||||
let sm2c = ethercrab::Command::fprd(station, regs::sm_base(2) + regs::SM_OFF_CTRL)
|
||||
.receive::<u8>(maindevice).await.unwrap_or(0xFF);
|
||||
let sm2e = ethercrab::Command::fprd(station, regs::sm_base(2) + regs::SM_OFF_ENABLE)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user