diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 282d32732..3e3670356 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -118,7 +118,7 @@ jobs: submodules: recursive - uses: ./.github/actions/environment - run: nix-shell --run "poetry run make -C core build_bootloader_emu" - if: matrix.coins == 'universal' && matrix.model != 'T3T1' # FIXME T3T1 bootloader emulator + if: matrix.coins == 'universal' - run: nix-shell --run "poetry run make -C core build_unix_frozen" - run: cp core/build/unix/trezor-emu-core core/build/unix/trezor-emu-core-${{ matrix.model }}-${{ matrix.coins }} - uses: actions/upload-artifact@v4 diff --git a/core/SConscript.bootloader b/core/SConscript.bootloader index ba4c944f9..eaaf8c3c8 100644 --- a/core/SConscript.bootloader +++ b/core/SConscript.bootloader @@ -220,6 +220,8 @@ def cargo_build(): features = ["model_t1"] elif TREZOR_MODEL in ("R",): features = ["model_tr"] + elif TREZOR_MODEL in ("T3T1",): + features = ["model_mercury"] else: features = ["model_tt"] features.append("ui") diff --git a/core/SConscript.bootloader_emu b/core/SConscript.bootloader_emu index eac3ce228..9471cbb89 100644 --- a/core/SConscript.bootloader_emu +++ b/core/SConscript.bootloader_emu @@ -274,6 +274,8 @@ def cargo_build(): features = ["model_t1"] elif TREZOR_MODEL in ("R",): features = ["model_tr"] + elif TREZOR_MODEL in ("T3T1",): + features = ["model_mercury"] else: features = ["model_tt"] diff --git a/core/embed/rust/Cargo.toml b/core/embed/rust/Cargo.toml index bf10bf9db..2faab74a7 100644 --- a/core/embed/rust/Cargo.toml +++ b/core/embed/rust/Cargo.toml @@ -10,6 +10,7 @@ default = ["model_tt"] crypto = ["zeroize"] model_tt = ["jpeg"] model_tr = [] +model_mercury = ["jpeg", "dma2d"] micropython = [] protobuf = ["micropython"] ui = [] diff --git a/core/embed/rust/src/ui/constant.rs b/core/embed/rust/src/ui/constant.rs index 91fd83f70..3237db67a 100644 --- a/core/embed/rust/src/ui/constant.rs +++ b/core/embed/rust/src/ui/constant.rs @@ -1,6 +1,12 @@ //! Reexporting the `constant` module according to the //! current feature (Trezor model) +#[cfg(all( + feature = "model_mercury", + not(feature = "model_tr"), + not(feature = "model_tt") +))] +pub use super::model_mercury::constant::*; #[cfg(all(feature = "model_tr", not(feature = "model_tt")))] pub use super::model_tr::constant::*; #[cfg(feature = "model_tt")] diff --git a/core/embed/rust/src/ui/display/loader/mod.rs b/core/embed/rust/src/ui/display/loader/mod.rs index f87ff791e..3b780a57d 100644 --- a/core/embed/rust/src/ui/display/loader/mod.rs +++ b/core/embed/rust/src/ui/display/loader/mod.rs @@ -5,16 +5,16 @@ mod starry; use crate::ui::display::{Color, Icon}; -#[cfg(feature = "model_tt")] +#[cfg(any(feature = "model_tt", feature = "model_mercury"))] use crate::ui::display::loader::circular::{ loader_circular as determinate, loader_circular_indeterminate as indeterminate, }; -#[cfg(feature = "model_tt")] +#[cfg(any(feature = "model_tt", feature = "model_mercury"))] pub use crate::ui::display::loader::circular::{loader_circular_uncompress, LoaderDimensions}; -#[cfg(not(feature = "model_tt"))] +#[cfg(all(not(feature = "model_tt"), not(feature = "model_mercury")))] use crate::ui::display::loader::rectangular::loader_rectangular as determinate; -#[cfg(not(feature = "model_tt"))] +#[cfg(all(not(feature = "model_tt"), not(feature = "model_mercury")))] use crate::ui::display::loader::starry::loader_starry_indeterminate as indeterminate; pub use small::loader_small_indeterminate; diff --git a/core/embed/rust/src/ui/mod.rs b/core/embed/rust/src/ui/mod.rs index 9152755bc..fd8c51dac 100644 --- a/core/embed/rust/src/ui/mod.rs +++ b/core/embed/rust/src/ui/mod.rs @@ -14,6 +14,9 @@ pub mod util; pub mod layout; mod api; + +#[cfg(feature = "model_mercury")] +pub mod model_mercury; #[cfg(feature = "model_tr")] pub mod model_tr; #[cfg(feature = "model_tt")] diff --git a/core/embed/rust/src/ui/model_mercury/bootloader/intro.rs b/core/embed/rust/src/ui/model_mercury/bootloader/intro.rs new file mode 100644 index 000000000..91c8d9534 --- /dev/null +++ b/core/embed/rust/src/ui/model_mercury/bootloader/intro.rs @@ -0,0 +1,113 @@ +use crate::{ + strutil::TString, + ui::{ + component::{Child, Component, Event, EventCtx, Label, Pad}, + constant::screen, + display::Icon, + geometry::{Alignment, Insets, Point, Rect}, + }, +}; + +use super::super::{ + component::{Button, ButtonMsg::Clicked}, + constant::WIDTH, + theme::bootloader::{ + button_bld, button_bld_menu, text_title, BLD_BG, BUTTON_AREA_START, BUTTON_HEIGHT, + CONTENT_PADDING, CORNER_BUTTON_AREA, MENU32, TEXT_NORMAL, TEXT_WARNING, TITLE_AREA, + }, +}; + +#[repr(u32)] +#[derive(Copy, Clone, ToPrimitive)] +pub enum IntroMsg { + Menu = 1, + Host = 2, +} + +pub struct Intro<'a> { + bg: Pad, + title: Child>, + menu: Child