fixup! refactor(core): improve conditional compilations based on model

tychovrahe/bluetooth/cleaner_disc2
tychovrahe 1 year ago
parent d7d33f41a7
commit 63368b2c92

@ -18,7 +18,7 @@ if TREZOR_MODEL in ('1', ):
)
Return()
FEATURES_WANTED = ["sdcard"]
FEATURES_WANTED = ["sd_card"]
CCFLAGS_MOD = ''
CPPPATH_MOD = []

@ -19,7 +19,7 @@ FEATURE_FLAGS = {
"SYSTEM_VIEW": False,
}
FEATURES_WANTED = ["input", "sbu", "sdcard", "rgb_led"]
FEATURES_WANTED = ["input", "sbu", "sd_card", "rgb_led"]
CCFLAGS_MOD = ''
CPPPATH_MOD = []

@ -6,7 +6,7 @@ import tools
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
FEATURES_WANTED = ["input", "sbu", "sdcard", "rdb_led"]
FEATURES_WANTED = ["input", "sbu", "sd_card", "rdb_led"]
CCFLAGS_MOD = ''
CPPPATH_MOD = []

@ -6,7 +6,7 @@ import tools
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
FEATURES_WANTED = ["input", "sdcard"]
FEATURES_WANTED = ["input", "sd_card"]
CCFLAGS_MOD = ''
CPPPATH_MOD = []

@ -686,13 +686,11 @@ def cargo_build():
if DMA2D:
features.append('dma2d')
if TREZOR_MODEL in ('T',) :
if TREZOR_MODEL in ('T',):
features.append('touch')
if TREZOR_MODEL in ('R') :
features.append('buttons')
if TREZOR_MODEL in ('1') :
features.append('buttons')
features.append('sd_card')
if TREZOR_MODEL in ('R', '1'):
features.append('button')
env.get('ENV')['TREZOR_MODEL'] = TREZOR_MODEL

@ -17,13 +17,13 @@ dma2d = []
ui_debug = []
ui_bounds = []
bootloader = []
buttons = []
button = []
touch = []
clippy = []
jpeg = []
debug = ["ui_debug"]
sbu = []
sdcard = []
sd_card = []
rgb_led = []
test = ["cc", "glob", "micropython", "protobuf", "ui", "ui_debug", "dma2d", "touch"]

@ -1,6 +1,6 @@
use super::ffi;
#[cfg(feature = "buttons")]
#[cfg(feature = "button")]
pub use super::ffi::{BTN_EVT_DOWN, BTN_EVT_UP, BTN_LEFT, BTN_RIGHT};
#[cfg(feature = "touch")]
@ -8,7 +8,7 @@ pub fn io_touch_read() -> u32 {
unsafe { ffi::touch_read() }
}
#[cfg(feature = "buttons")]
#[cfg(feature = "button")]
pub fn io_button_read() -> u32 {
unsafe { ffi::button_read() }
}

@ -11,7 +11,7 @@ use crate::{
},
};
#[cfg(feature = "buttons")]
#[cfg(feature = "button")]
use crate::ui::event::ButtonEvent;
#[cfg(feature = "touch")]
use crate::ui::event::TouchEvent;
@ -347,7 +347,7 @@ where
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum Event<'a> {
#[cfg(feature = "buttons")]
#[cfg(feature = "button")]
Button(ButtonEvent),
#[cfg(feature = "touch")]
Touch(TouchEvent),

@ -23,7 +23,7 @@ use crate::{
},
};
#[cfg(feature = "buttons")]
#[cfg(feature = "button")]
use crate::ui::event::ButtonEvent;
#[cfg(feature = "touch")]
use crate::ui::event::TouchEvent;
@ -400,7 +400,7 @@ extern "C" fn ui_layout_touch_event(_n_args: usize, _args: *const Obj) -> Obj {
Obj::const_none()
}
#[cfg(feature = "buttons")]
#[cfg(feature = "button")]
extern "C" fn ui_layout_button_event(n_args: usize, args: *const Obj) -> Obj {
let block = |args: &[Obj], _kwargs: &Map| {
if args.len() != 3 {
@ -414,7 +414,7 @@ extern "C" fn ui_layout_button_event(n_args: usize, args: *const Obj) -> Obj {
unsafe { util::try_with_args_and_kwargs(n_args, args, &Map::EMPTY, block) }
}
#[cfg(not(feature = "buttons"))]
#[cfg(not(feature = "button"))]
extern "C" fn ui_layout_button_event(_n_args: usize, _args: *const Obj) -> Obj {
Obj::const_none()
}

@ -3,7 +3,7 @@
#ifdef TREZOR_MODEL_T
#define USE_TOUCH 1
#define USE_SD_CARD 1
#define USE_SDCARD 1
#define USE_SBU 1
#endif

@ -15,7 +15,7 @@ def configure(env, features_wanted, defines, sources):
if "input" in features_wanted:
sources += ['embed/trezorhal/button.c']
features_available.append("buttons")
features_available.append("button")
env.get('ENV')['TREZOR_BOARD'] = board

@ -15,7 +15,7 @@ def configure(env, features_wanted, defines, sources):
if "input" in features_wanted:
sources += ['embed/trezorhal/button.c']
features_available.append("buttons")
features_available.append("button")
if "rgb_led" in features_wanted:
sources += ['embed/trezorhal/rgb_led.c']

@ -15,7 +15,7 @@ def configure(env, features_wanted, defines, sources):
if "input" in features_wanted:
sources += ['embed/trezorhal/button.c']
features_available.append("buttons")
features_available.append("button")
if "sbu" in features_wanted:
sources += ['embed/trezorhal/sbu.c', ]

@ -19,11 +19,11 @@ def configure(env, features_wanted, defines, sources):
sources += ['embed/trezorhal/touch/ft6x36.c', ]
features_available.append("touch")
if "sdcard" in features_wanted:
if "sd_card" in features_wanted:
sources += ['embed/trezorhal/sdcard.c', ]
sources += ['embed/extmod/modtrezorio/ff.c', ]
sources += ['embed/extmod/modtrezorio/ffunicode.c', ]
features_available.append("sdcard")
features_available.append("sd_card")
if "sbu" in features_wanted:
sources += ['embed/trezorhal/sbu.c', ]

Loading…
Cancel
Save