@@ -17,13 +17,12 @@ use libremarkable::stopwatch;
1717
1818use chrono:: { DateTime , Local } ;
1919use log:: info;
20- use once_cell:: sync:: Lazy ;
2120
2221use std:: collections:: VecDeque ;
2322use std:: fmt;
2423use std:: process:: Command ;
2524use std:: sync:: atomic:: { AtomicBool , AtomicI32 , AtomicU8 , Ordering } ;
26- use std:: sync:: Mutex ;
25+ use std:: sync:: { LazyLock , Mutex } ;
2726use std:: thread:: sleep;
2827use std:: time:: Duration ;
2928
@@ -141,16 +140,17 @@ const CANVAS_REGION: mxcfb_rect = mxcfb_rect {
141140
142141type PointAndPressure = ( cgmath:: Point2 < f32 > , i32 ) ;
143142
144- static G_TOUCH_MODE : Lazy < AtomicU8 > = Lazy :: new ( || AtomicU8 :: new ( TouchMode :: OnlyUI . into ( ) ) ) ;
145- static G_DRAW_MODE : Lazy < AtomicI32 > = Lazy :: new ( || AtomicI32 :: new ( DrawMode :: Draw ( 2 ) . into ( ) ) ) ;
146- static UNPRESS_OBSERVED : Lazy < AtomicBool > = Lazy :: new ( || AtomicBool :: new ( false ) ) ;
147- static WACOM_IN_RANGE : Lazy < AtomicBool > = Lazy :: new ( || AtomicBool :: new ( false ) ) ;
148- static WACOM_RUBBER_SIDE : Lazy < AtomicBool > = Lazy :: new ( || AtomicBool :: new ( false ) ) ;
149- static WACOM_HISTORY : Lazy < Mutex < VecDeque < PointAndPressure > > > =
150- Lazy :: new ( || Mutex :: new ( VecDeque :: new ( ) ) ) ;
151- static G_COUNTER : Lazy < Mutex < u32 > > = Lazy :: new ( || Mutex :: new ( 0 ) ) ;
152- static SAVED_CANVAS : Lazy < Mutex < Option < storage:: CompressedCanvasState > > > =
153- Lazy :: new ( || Mutex :: new ( None ) ) ;
143+ static G_TOUCH_MODE : LazyLock < AtomicU8 > = LazyLock :: new ( || AtomicU8 :: new ( TouchMode :: OnlyUI . into ( ) ) ) ;
144+ static G_DRAW_MODE : LazyLock < AtomicI32 > =
145+ LazyLock :: new ( || AtomicI32 :: new ( DrawMode :: Draw ( 2 ) . into ( ) ) ) ;
146+ static UNPRESS_OBSERVED : LazyLock < AtomicBool > = LazyLock :: new ( || AtomicBool :: new ( false ) ) ;
147+ static WACOM_IN_RANGE : LazyLock < AtomicBool > = LazyLock :: new ( || AtomicBool :: new ( false ) ) ;
148+ static WACOM_RUBBER_SIDE : LazyLock < AtomicBool > = LazyLock :: new ( || AtomicBool :: new ( false ) ) ;
149+ static WACOM_HISTORY : LazyLock < Mutex < VecDeque < PointAndPressure > > > =
150+ LazyLock :: new ( || Mutex :: new ( VecDeque :: new ( ) ) ) ;
151+ static G_COUNTER : LazyLock < Mutex < u32 > > = LazyLock :: new ( || Mutex :: new ( 0 ) ) ;
152+ static SAVED_CANVAS : LazyLock < Mutex < Option < storage:: CompressedCanvasState > > > =
153+ LazyLock :: new ( || Mutex :: new ( None ) ) ;
154154
155155// ####################
156156// ## Button Handlers
0 commit comments