mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 10:22:02 +00:00
Merge pull request #28 from cjfranko/build_fix_error
Some checks failed
Build for Raspberry Pi / Build for aarch64 (push) Failing after 20s
Some checks failed
Build for Raspberry Pi / Build for aarch64 (push) Failing after 20s
fix build on native
This commit is contained in:
commit
bda4d4e6f5
3 changed files with 5 additions and 4 deletions
|
|
@ -60,6 +60,7 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use crate::sync_logic::LtcState;
|
use crate::sync_logic::LtcState;
|
||||||
|
use num_rational::Ratio;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
fn get_ltc_regex() -> Regex {
|
fn get_ltc_regex() -> Regex {
|
||||||
|
|
@ -119,7 +120,7 @@ mod tests {
|
||||||
assert_eq!(st.free_count, 1);
|
assert_eq!(st.free_count, 1);
|
||||||
let received_frame = rx.try_recv().unwrap();
|
let received_frame = rx.try_recv().unwrap();
|
||||||
assert_eq!(received_frame.status, "FREE");
|
assert_eq!(received_frame.status, "FREE");
|
||||||
assert_eq!(received_frame.frame_rate, 29.97);
|
assert_eq!(received_frame.frame_rate, Ratio::new(30000, 1001));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -173,9 +173,9 @@ impl LtcState {
|
||||||
pub fn get_sync_status(delta_ms: i64, config: &Config) -> &'static str {
|
pub fn get_sync_status(delta_ms: i64, config: &Config) -> &'static str {
|
||||||
if config.timeturner_offset.is_active() {
|
if config.timeturner_offset.is_active() {
|
||||||
"TIMETURNING"
|
"TIMETURNING"
|
||||||
} else if delta_ms.abs() <= 1 {
|
} else if delta_ms.abs() <= 8 {
|
||||||
"IN SYNC"
|
"IN SYNC"
|
||||||
} else if delta_ms > 2 {
|
} else if delta_ms > 10 {
|
||||||
"CLOCK AHEAD"
|
"CLOCK AHEAD"
|
||||||
} else {
|
} else {
|
||||||
"CLOCK BEHIND"
|
"CLOCK BEHIND"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::sync_logic::LtcFrame;
|
use crate::sync_logic::LtcFrame;
|
||||||
use chrono::{DateTime, Duration as ChronoDuration, Local, NaiveTime, TimeZone};
|
use chrono::{DateTime, Duration as ChronoDuration, Local, TimeZone};
|
||||||
use num_rational::Ratio;
|
use num_rational::Ratio;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue