1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 12:08:59 +00:00

chore(core/rust): add uDebug capability to more places

This commit is contained in:
matejcik 2024-09-16 16:56:33 +02:00 committed by matejcik
parent ef90546324
commit 0be96cb70b
14 changed files with 17 additions and 0 deletions

View File

@ -26,6 +26,7 @@ use super::Paginate;
/// Type used by components that do not return any messages.
///
/// Alternative to the yet-unstable `!`-type.
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum Never {}
/// User interface is composed of components that can react to `Event`s through

View File

@ -1,4 +1,5 @@
/// Common message type for pagination components.
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum PageMsg<T> {
/// Pass-through from paged component.
Content(T),

View File

@ -579,6 +579,7 @@ impl Alignment2D {
}
#[derive(Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum Axis {
Horizontal,
Vertical,

View File

@ -32,6 +32,7 @@ const CONTENT_AREA: Rect = Rect::new(
);
#[derive(Copy, Clone, ToPrimitive)]
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum ConfirmMsg {
Cancel = 1,
Confirm = 2,

View File

@ -16,6 +16,7 @@ use crate::{
use super::theme;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum ButtonMsg {
Pressed,
Released,
@ -551,6 +552,7 @@ impl Button {
}
}
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum CancelConfirmMsg {
Cancelled,
Confirmed,
@ -562,12 +564,14 @@ type CancelInfoConfirm<F0, F1, F2> =
type CancelConfirm<F0, F1> = FixedHeightBar<Split<MsgMap<Button, F0>, MsgMap<Button, F1>>>;
#[derive(Clone, Copy)]
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum CancelInfoConfirmMsg {
Cancelled,
Info,
Confirmed,
}
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum SelectWordMsg {
Selected(usize),
}

View File

@ -16,6 +16,7 @@ use crate::{
use super::theme;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum DialogMsg<T, U> {
Content(T),
Controls(U),

View File

@ -23,6 +23,7 @@ const SCROLLBAR_HEIGHT: i16 = 10;
const APP_NAME_PADDING: i16 = 12;
const APP_NAME_HEIGHT: i16 = 30;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum FidoMsg {
Confirmed(usize),
Cancelled,

View File

@ -21,6 +21,7 @@ pub struct Frame<T> {
content: Child<T>,
}
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum FrameMsg<T> {
Content(T),
Button(CancelInfoConfirmMsg),

View File

@ -61,6 +61,7 @@ pub struct Homescreen {
delay: Timer,
}
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum HomescreenMsg {
Dismissed,
}

View File

@ -13,6 +13,7 @@ use crate::{
pub const MNEMONIC_KEY_COUNT: usize = 9;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum MnemonicKeyboardMsg {
Confirmed,
Previous,

View File

@ -20,6 +20,7 @@ use crate::{
use core::cell::Cell;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum PassphraseKeyboardMsg {
Confirmed,
Cancelled,

View File

@ -23,6 +23,7 @@ use crate::{
},
};
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum PinKeyboardMsg {
Confirmed,
Cancelled,

View File

@ -9,6 +9,7 @@ use crate::ui::{
};
use heapless::Vec;
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum SelectWordCountMsg {
Selected(u32),
}

View File

@ -17,6 +17,7 @@ use crate::{
use super::{theme, Button, ButtonMsg};
#[cfg_attr(feature = "debug", derive(ufmt::derive::uDebug))]
pub enum NumberInputDialogMsg {
Selected,
InfoRequested,