diff --git a/services/bao1x-hal-service/src/api.rs b/services/bao1x-hal-service/src/api.rs index 38dfc432f..e611317f2 100644 --- a/services/bao1x-hal-service/src/api.rs +++ b/services/bao1x-hal-service/src/api.rs @@ -1,3 +1,7 @@ +/// This is a "well known name" used by `libstd` to connect to the time server +/// Anyone who wants to check if time has been initialized would use this name. +pub const TIME_SERVER_PUBLIC: &'static [u8; 16] = b"timeserverpublic"; + /// Do not modify the discriminants in this structure. They are used in `libstd` directly. #[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Debug)] pub enum TimeOp { diff --git a/services/bao1x-hal-service/src/servers/rtc.rs b/services/bao1x-hal-service/src/servers/rtc.rs index 4800367de..c4a73b99e 100644 --- a/services/bao1x-hal-service/src/servers/rtc.rs +++ b/services/bao1x-hal-service/src/servers/rtc.rs @@ -1,12 +1,9 @@ use bao1x_hal::rtc::*; use utralib::*; +use crate::api::TIME_SERVER_PUBLIC; use crate::api::TimeOp; -/// This is a "well known name" used by `libstd` to connect to the time server -/// Anyone who wants to check if time has been initialized would use this name. -pub const TIME_SERVER_PUBLIC: &'static [u8; 16] = b"timeserverpublic"; - pub fn start_rtc_service() { let _ = std::thread::spawn({ move || { @@ -144,6 +141,7 @@ fn rtc_service() -> ! { let tz_hi_ms = scalar.arg1; let tz_lo_ms = scalar.arg2; let tz_ms = ((tz_hi_ms as i64) << 32) | (tz_lo_ms as i64); + log::info!("TZ offset set to {}", tz_ms / 1000); // sanity check with very broad bounds: I don't know of any time zones that are more // than +/2 days from UTC 86400 seconds in a day, times 1000 // milliseconds, times 2 days