From 833a83bb72e52ef0061ad06df4b55447ba3911fa Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Thu, 23 Feb 2023 14:14:53 +0100 Subject: [PATCH] touch test --- core/embed/rust/src/micropython/macros.rs | 2 +- core/embed/rust/src/ui/event.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/embed/rust/src/micropython/macros.rs b/core/embed/rust/src/micropython/macros.rs index 557666c8e..a4f037a07 100644 --- a/core/embed/rust/src/micropython/macros.rs +++ b/core/embed/rust/src/micropython/macros.rs @@ -211,7 +211,7 @@ macro_rules! obj_module { #[allow(unused_macros)] // Should be used only for debugging purposes macro_rules! print { ($($string:expr),+) => { - #[cfg(feature = "debug")] + #[cfg(feature = "ui_debug")] { $(crate::micropython::print::print($string);)+ } diff --git a/core/embed/rust/src/ui/event.rs b/core/embed/rust/src/ui/event.rs index 3c273f996..5d5b42492 100644 --- a/core/embed/rust/src/ui/event.rs +++ b/core/embed/rust/src/ui/event.rs @@ -45,7 +45,13 @@ impl TouchEvent { pub fn new(event: u32, x: u32, y: u32) -> Result { let point = Point::new(x.try_into()?, y.try_into()?); let result = match event { - 1 => Self::TouchStart(point), + 1 => { + use crate::ui::util::u32_to_str; + let mut buffer = [0u8; 20]; + let num = 10000000 * event + x * 1000 + y; + println!(u32_to_str(num, buffer.as_mut_slice()).unwrap()); + Self::TouchStart(point) + }, 2 => Self::TouchMove(point), 4 => Self::TouchEnd(point), _ => return Err(error::Error::OutOfRange),