You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/embed/unix/main_main.c

39 lines
1.1 KiB

#include "py/mpthread.h"
#include "py/runtime.h"
#include "py/stackctrl.h"
#ifdef USE_SECP256K1_ZKP
#include "zkp_context.h"
#endif
#include "common.h"
#include "display.h" // TODO:just for testing, remove later !!!
#include "rust_ui.h" // TODO:just for testing, remove later !!!
#include "touch.h" // TODO:just for testing, remove later !!!
MP_NOINLINE int main_(int argc, char **argv);
int main(int argc, char **argv) {
collect_hw_entropy();
#ifdef USE_SECP256K1_ZKP
ensure(sectrue * (zkp_context_init() == 0), NULL);
#endif
display_refresh();
display_backlight(255);
drawlib_demo(); // TODO: !!! remove
#if MICROPY_PY_THREAD
mp_thread_init();
#endif
// We should capture stack top ASAP after start, and it should be
// captured guaranteedly before any other stack variables are allocated.
// For this, actual main (renamed main_) should not be inlined into
// this function. main_() itself may have other functions inlined (with
// their own stack variables), that's why we need this main/main_ split.
mp_stack_ctrl_init();
return main_(argc, argv);
}