fixup! feat(core): integrate new drawing library

cepetr/gfx-alpha
cepetr 4 weeks ago
parent c53fa0548a
commit e652f46079

@ -117,6 +117,10 @@ extern "C" fn screen_boot(
let vendor_img =
unsafe { core::slice::from_raw_parts(vendor_img as *const u8, vendor_img_len) };
// Splits a version stored as a u32 into four numbers
// starting with the major version.
let version = version.to_le_bytes();
ModelUI::screen_boot(warning, vendor_str, version, vendor_img, wait);
}

@ -410,7 +410,7 @@ impl UIFeaturesBootloader for ModelMercuryFeatures {
fn screen_boot(
warning: bool,
vendor_str: Option<&str>,
version: u32,
version: [u8; 4],
vendor_img: &[u8],
wait: i32,
) {
@ -448,13 +448,12 @@ impl UIFeaturesBootloader for ModelMercuryFeatures {
let pos = Point::new(SCREEN.width() / 2, SCREEN.height() - 5 - 25);
let mut version_text: BootloaderString = String::new();
let ver_nums = version_split(version);
unwrap!(uwrite!(
version_text,
"{}.{}.{}",
ver_nums[0],
ver_nums[1],
ver_nums[2]
version[0],
version[1],
version[2]
));
shape::Text::new(pos, version_text.as_str())

@ -379,7 +379,7 @@ impl UIFeaturesBootloader for ModelTRFeatures {
fn screen_boot(
_warning: bool,
vendor_str: Option<&str>,
version: u32,
version: [u8; 4],
vendor_img: &[u8],
wait: i32,
) {
@ -409,13 +409,12 @@ impl UIFeaturesBootloader for ModelTRFeatures {
let pos = Point::new(constant::WIDTH / 2, 46);
let mut version_text: BootloaderString = String::new();
let ver_nums = version_split(version);
unwrap!(uwrite!(
version_text,
"{}.{}.{}",
ver_nums[0],
ver_nums[1],
ver_nums[2]
version[0],
version[1],
version[2]
));
shape::Text::new(pos, version_text.as_str())

@ -399,7 +399,7 @@ impl UIFeaturesBootloader for ModelTTFeatures {
fn screen_boot(
warning: bool,
vendor_str: Option<&str>,
version: u32,
version: [u8; 4],
vendor_img: &[u8],
wait: i32,
) {
@ -437,13 +437,12 @@ impl UIFeaturesBootloader for ModelTTFeatures {
let pos = Point::new(SCREEN.width() / 2, SCREEN.height() - 5 - 25);
let mut version_text: BootloaderString = String::new();
let ver_nums = version_split(version);
unwrap!(uwrite!(
version_text,
"{}.{}.{}",
ver_nums[0],
ver_nums[1],
ver_nums[2]
version[0],
version[1],
version[2]
));
shape::Text::new(pos, version_text.as_str())

@ -60,7 +60,7 @@ pub trait UIFeaturesBootloader {
fn screen_boot(
warning: bool,
vendor_str: Option<&str>,
version: u32,
version: [u8; 4],
vendor_img: &[u8],
wait: i32,
);

@ -179,12 +179,6 @@ macro_rules! include_icon {
};
}
/// Splits a version stored as a u32 into four numbers
/// starting with the major version.
pub fn version_split(version: u32) -> [u8; 4] {
version.to_le_bytes()
}
#[cfg(test)]
mod tests {
use crate::strutil;

Loading…
Cancel
Save