feat: animate at 60 fps with timers in hundredths and bars that grow by eighths
Frames tick every 16 ms; password checks and the bus's fallback wake-ups keep their own 100 ms clock. Running units show hundredths, and a running bar's tip fills in eighths when the console font has the block glyphs. The scripted boot demo uses about 2% of a core.
This commit is contained in:
1 parent
a071b2d065
commit
0a29c7c88a
11 files changed
+93
-23
No files matched your search
@@ -10,7 +10,10 @@ use crate::{
|
||||
ask_password::{PasswordEntry, RequestWatch},
|
||||
console_takeover::Console,
|
||||
passphrase_input::asks_to_quit,
|
||||
stream_sources::{CarriedItem, periodic_inputs, readable_source, unfold_carrying},
|
||||
stream_sources::{
|
||||
BACKGROUND_CHECK_INTERVAL, CarriedItem, periodic_inputs, readable_source,
|
||||
unfold_carrying,
|
||||
},
|
||||
watch_screen::{ConsoleDesk, ScreenInput, WatchEnding},
|
||||
},
|
||||
screen_settings::font_glyphs::Glyphs,
|
||||
@@ -76,7 +79,6 @@ impl ConsoleDesk for LiveDesk {
|
||||
}
|
||||
|
||||
fn frame_passed(&mut self, _state: &mut BootState, _now: Duration) -> ControlFlow<WatchEnding> {
|
||||
self.follow_requests(!self.requests_watched);
|
||||
ControlFlow::Continue(())
|
||||
}
|
||||
|
||||
@@ -84,6 +86,10 @@ impl ConsoleDesk for LiveDesk {
|
||||
self.follow_requests(true);
|
||||
}
|
||||
|
||||
fn check_prompts(&mut self) {
|
||||
self.follow_requests(!self.requests_watched);
|
||||
}
|
||||
|
||||
fn keep_console_up(&mut self) -> bool {
|
||||
self.console.keep_up()
|
||||
}
|
||||
@@ -97,6 +103,10 @@ impl ConsoleDesk for LiveDesk {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn prompt_check_inputs() -> impl Stream<Item = ScreenInput> {
|
||||
periodic_inputs(BACKGROUND_CHECK_INTERVAL, || ScreenInput::PromptCheck)
|
||||
}
|
||||
|
||||
pub fn console_upkeep_inputs() -> impl Stream<Item = ScreenInput> {
|
||||
periodic_inputs(CONSOLE_UPKEEP_INTERVAL, || ScreenInput::ConsoleUpkeep)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user