()
| 114 | } |
| 115 | |
| 116 | fn state() -> &'static WatchState { |
| 117 | static S: OnceLock<WatchState> = OnceLock::new(); |
| 118 | S.get_or_init(|| WatchState { |
| 119 | crown_bits: AtomicU64::new(0), |
| 120 | touch_x: std::array::from_fn(|_| AtomicU64::new(0)), |
| 121 | touch_y: std::array::from_fn(|_| AtomicU64::new(0)), |
| 122 | touch_active: std::array::from_fn(|_| AtomicU64::new(0)), |
| 123 | screen_w: AtomicU64::new(198f64.to_bits()), |
| 124 | screen_h: AtomicU64::new(242f64.to_bits()), |
| 125 | target_fps: AtomicI64::new(30), |
| 126 | start: OnceLock::new(), |
| 127 | last_frame_ns: AtomicU64::new(0), |
| 128 | frame_count: AtomicUsize::new(0), |
| 129 | }) |
| 130 | } |
| 131 | |
| 132 | fn now_nanos() -> u64 { |
| 133 | let s = state(); |
no outgoing calls
no test coverage detected