A fork of pulp-os for the xteink4 adding custom apps
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: debounce issue

hans e42d2ffd bc6e889f

+34 -10
+10 -10
build.rs
··· 87 87 88 88 // body sizes (px): 0=XSmall 1=Small 2=Medium 3=Large 4=XLarge 89 89 const BODY_PX: [(f32, &str); 5] = [ 90 - (14.0, "XSMALL"), 91 - (17.0, "SMALL"), 92 - (21.0, "MEDIUM"), 93 - (26.0, "LARGE"), 94 - (32.0, "XLARGE"), 90 + (16.0, "XSMALL"), 91 + (19.0, "SMALL"), 92 + (23.0, "MEDIUM"), 93 + (28.0, "LARGE"), 94 + (35.0, "XLARGE"), 95 95 ]; 96 96 97 97 // Heading sizes scale proportionally 98 98 const HEADING_PX: [(f32, &str); 5] = [ 99 - (19.0, "XSMALL"), 100 - (23.0, "SMALL"), 101 - (28.0, "MEDIUM"), 102 - (34.0, "LARGE"), 103 - (42.0, "XLARGE"), 99 + (23.0, "XSMALL"), 100 + (27.0, "SMALL"), 101 + (32.0, "MEDIUM"), 102 + (38.0, "LARGE"), 103 + (46.0, "XLARGE"), 104 104 ]; 105 105 106 106 // fontdue coverage threshold; values >= this become black
+7
kernel/src/drivers/input.rs
··· 89 89 } 90 90 } 91 91 92 + pub fn reset_hold_state(&mut self) { 93 + let now = Instant::now(); 94 + self.press_since = now; 95 + self.long_press_fired = false; 96 + self.last_repeat = now; 97 + } 98 + 92 99 pub fn poll(&mut self) -> Option<Event> { 93 100 if !self.queue.is_empty() { 94 101 return self.queue.pop();
+5
kernel/src/kernel/scheduler.rs
··· 176 176 177 177 if transition != Transition::None { 178 178 app_mgr.apply_transition(transition, &mut self.handle()); 179 + tasks::request_hold_reset(); 179 180 } 180 181 181 182 false ··· 323 324 // because ch_cached stays false until the full write completes. 324 325 // the TICK_MS timeout ensures is_busy is re-checked regularly 325 326 // even during long background operations. 327 + // 328 + // first non-None transition wins; hold is reset so the held button 329 + // doesn't re-fire LongPress/Repeat for the remainder of the waveform 326 330 async fn busy_wait_with_background<A: AppLayer>( 327 331 &mut self, 328 332 app_mgr: &mut A, ··· 357 361 let t = app_mgr.dispatch_event(hw_event, &mut *self.bm_cache); 358 362 if t != Transition::None && deferred.is_none() { 359 363 deferred = Some(t); 364 + tasks::request_hold_reset(); 360 365 } 361 366 } 362 367 }
+12
kernel/src/kernel/tasks.rs
··· 12 12 pub static INPUT_EVENTS: Channel<CriticalSectionRawMutex, Event, INPUT_CHANNEL_CAP> = 13 13 Channel::new(); 14 14 15 + // signal input_task to reset hold timers after a navigation event is consumed 16 + pub static RESET_HOLD: Signal<CriticalSectionRawMutex, ()> = Signal::new(); 17 + 18 + #[inline] 19 + pub fn request_hold_reset() { 20 + RESET_HOLD.signal(()); 21 + } 22 + 15 23 pub static BATTERY_MV: Signal<CriticalSectionRawMutex, u16> = Signal::new(); 16 24 17 25 const BATTERY_INTERVAL_TICKS: u32 = 3000; // 3000 x 10 ms = 30 s ··· 26 34 27 35 loop { 28 36 ticker.next().await; 37 + 38 + if RESET_HOLD.try_take().is_some() { 39 + input.reset_hold_state(); 40 + } 29 41 30 42 if let Some(ev) = input.poll() { 31 43 let _ = INPUT_EVENTS.try_send(ev);