expose the GAM minimum redraw period

this could be useful for functions that have to rapidly
toggle events on the screen and want to make sure that
the last event actually is rendered.
This commit is contained in:
bunnie 2023-10-29 23:02:44 +08:00
parent d4a934785b
commit ae7ee770ee
2 changed files with 2 additions and 1 deletions

View file

@ -31,6 +31,7 @@ use ime_plugin_api::{ImefCallback, ApiToken};
#[doc = include_str!("../README.md")]
pub const RATE_LIMIT_MS: usize = 33;
pub const SYSTEM_STYLE: GlyphStyle = GlyphStyle::Tall;
// Add names here and insert them into the EXPECTED_BOOT_CONTEXTS structure below.

View file

@ -175,7 +175,7 @@ fn wrapped_main() -> ! {
continue; // don't allow any redraws if a powerdown is requested
}
let elapsed_time = ticktimer.elapsed_ms();
if elapsed_time - last_time > 33 { // rate limit updates, no point in going faster than the eye can see
if elapsed_time - last_time > gam::RATE_LIMIT_MS as u64 { // rate limit updates, no point in going faster than the eye can see
last_time = elapsed_time;
if deface(&gfx, &trng, &mut canvases) {