diff --git a/common/protob/messages-management.proto b/common/protob/messages-management.proto index e2c084175..9ecb44e25 100644 --- a/common/protob/messages-management.proto +++ b/common/protob/messages-management.proto @@ -180,6 +180,7 @@ message ApplySettings { optional SafetyCheckLevel safety_checks = 9; // Safety check level, set to Prompt to limit path namespace enforcement optional bool experimental_features = 10; // enable experimental message types optional bool hide_passphrase_from_host = 11; // do not show passphrase coming from host + optional uint32 brightness = 12; // display brightness, 0 = select on device } /** diff --git a/core/.changelog.d/3208.added b/core/.changelog.d/3208.added new file mode 100644 index 000000000..995ba08ab --- /dev/null +++ b/core/.changelog.d/3208.added @@ -0,0 +1 @@ +[T2T1] Added user adjustable brightness setting. diff --git a/core/Makefile b/core/Makefile index dba27525e..64d726435 100644 --- a/core/Makefile +++ b/core/Makefile @@ -29,8 +29,8 @@ PRODUCTION ?= 0 PYOPT ?= 1 BITCOIN_ONLY ?= 0 BOOTLOADER_QA ?= 0 -BOOTLOADER_DEVEL ?= 0 -TREZOR_MODEL ?= T +BOOTLOADER_DEVEL ?= 1 +TREZOR_MODEL ?= T3T1 TREZOR_MEMPERF ?= 0 ADDRESS_SANITIZER ?= 0 CMAKELISTS ?= 0 diff --git a/core/embed/firmware/main.c b/core/embed/firmware/main.c index 64e42da49..7ab54086a 100644 --- a/core/embed/firmware/main.c +++ b/core/embed/firmware/main.c @@ -128,6 +128,10 @@ int main(void) { dma2d_init(); #endif +#if defined TREZOR_MODEL_T + set_core_clock(CLOCK_180_MHZ); +#endif + display_reinit(); #ifdef STM32U5 diff --git a/core/embed/rust/librust_qstr.h b/core/embed/rust/librust_qstr.h index bd7a90819..4d0f870e6 100644 --- a/core/embed/rust/librust_qstr.h +++ b/core/embed/rust/librust_qstr.h @@ -131,6 +131,7 @@ static void _librust_qstrs(void) { MP_QSTR_buttons__try_again; MP_QSTR_buttons__turn_off; MP_QSTR_buttons__turn_on; + MP_QSTR_callback; MP_QSTR_can_go_back; MP_QSTR_cancel_arrow; MP_QSTR_cancel_cross; @@ -382,6 +383,7 @@ static void _librust_qstrs(void) { MP_QSTR_request_bip39; MP_QSTR_request_complete_repaint; MP_QSTR_request_number; + MP_QSTR_request_number_slider; MP_QSTR_request_passphrase; MP_QSTR_request_pin; MP_QSTR_request_slip39; diff --git a/core/embed/rust/src/ui/model_tt/component/mod.rs b/core/embed/rust/src/ui/model_tt/component/mod.rs index ec6d1b0b7..994accd6e 100644 --- a/core/embed/rust/src/ui/model_tt/component/mod.rs +++ b/core/embed/rust/src/ui/model_tt/component/mod.rs @@ -16,6 +16,7 @@ mod keyboard; mod loader; #[cfg(feature = "translations")] mod number_input; +mod number_input_slider; #[cfg(feature = "translations")] mod page; mod progress; @@ -50,6 +51,7 @@ pub use keyboard::{ pub use loader::{Loader, LoaderMsg, LoaderStyle, LoaderStyleSheet}; #[cfg(feature = "translations")] pub use number_input::{NumberInputDialog, NumberInputDialogMsg}; +pub use number_input_slider::{NumberInputSliderDialog, NumberInputSliderDialogMsg}; #[cfg(feature = "translations")] pub use page::ButtonPage; pub use progress::Progress; diff --git a/core/embed/rust/src/ui/model_tt/component/number_input_slider.rs b/core/embed/rust/src/ui/model_tt/component/number_input_slider.rs new file mode 100644 index 000000000..382429d6a --- /dev/null +++ b/core/embed/rust/src/ui/model_tt/component/number_input_slider.rs @@ -0,0 +1,209 @@ +use crate::ui::{ + component::{base::ComponentExt, Child, Component, Event, EventCtx}, + constant::screen, + display, + event::TouchEvent, + geometry::{Grid, Insets, Point, Rect}, +}; + +use super::{theme, Button, ButtonMsg}; + +pub enum NumberInputSliderDialogMsg { + Confirmed, + Cancelled, +} + +pub struct NumberInputSliderDialog +where + F: Fn(u32), +{ + area: Rect, + callback: F, + input: Child, + cancel_button: Child