generated from GarandPLG/rust-flake-template
Expose tick interval constant and simplify handler
Move the 33 ms tick interval into `tick` as a public constant `TICK_MS` and drop the parameter from `handle_tick_event`. Update re‑exports and callers accordingly
This commit is contained in:
1 parent
b1183175be
commit
35209dd064
3 files changed
+6
-6
No files matched your search
@@ -4,4 +4,4 @@ mod tick;
|
||||
|
||||
pub use audio::{AudioCmd, SoundrackParts, Soundtrack, handle_audio};
|
||||
pub use events::handle_ct_events;
|
||||
pub use tick::handle_tick_event;
|
||||
pub use tick::{TICK_MS, handle_tick_event};
|
||||
@@ -4,8 +4,10 @@ use std::{
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
pub fn handle_tick_event(tx: Sender<()>, tick_ms: u8) {
|
||||
let interval: Duration = Duration::from_millis(tick_ms as u64);
|
||||
pub const TICK_MS: u8 = 33;
|
||||
|
||||
pub fn handle_tick_event(tx: Sender<()>) {
|
||||
let interval: Duration = Duration::from_millis(TICK_MS as u64);
|
||||
loop {
|
||||
if tx.send(()).is_err() {
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user