mirror of
https://github.com/LegitCamper/picocalc-os-rs.git
synced 2026-10-23 06:57:36 -06:00
get fps better
This commit is contained in:
1 parent
bbc9613f62
commit
a7daa4c5fc
6 files changed
+72
-21
No files matched your search
+5
-5
@@ -65,10 +65,10 @@ pub mod display {
|
||||
abi_sys::lock_display(lock);
|
||||
}
|
||||
|
||||
// const BUF_SIZE: usize = 15 * 1024; // tune this for performance
|
||||
// static mut BUF: [CPixel; BUF_SIZE] = [CPixel::new(); BUF_SIZE];
|
||||
const BUF_SIZE: usize = 250 * 1024; // tune this for performance
|
||||
static mut BUF: Lazy<Vec<CPixel>> = Lazy::new(|| vec![const { CPixel::new() }; BUF_SIZE]);
|
||||
const BUF_SIZE: usize = 15 * 1024; // tune this for performance
|
||||
static mut BUF: [CPixel; BUF_SIZE] = [CPixel::new(); BUF_SIZE];
|
||||
// const BUF_SIZE: usize = 250 * 1024; // tune this for performance
|
||||
// static mut BUF: Lazy<Vec<CPixel>> = Lazy::new(|| vec![const { CPixel::new() }; BUF_SIZE]);
|
||||
|
||||
pub struct Display;
|
||||
|
||||
@@ -97,7 +97,7 @@ pub mod display {
|
||||
unsafe { BUF[count] = p.into() };
|
||||
count += 1;
|
||||
|
||||
if count == BUF_SIZE {
|
||||
if count == BUF_SIZE - 1 {
|
||||
abi_sys::draw_iter(unsafe { BUF.as_ptr() }, count);
|
||||
count = 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user