diff --git a/.travis.yml b/.travis.yml index ec39b55f1b..d4e0121371 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ script: - make build_trezorhal - - make build_unix MICROPY_PY_TREZORUI_NOUI=1 + - make build_unix TREZOR_NOUI=1 - make test diff --git a/micropython/extmod/modtrezorui/display-unix-null.h b/micropython/extmod/modtrezorui/display-unix-null.h index b4db2c5570..382c1f4170 100644 --- a/micropython/extmod/modtrezorui/display-unix-null.h +++ b/micropython/extmod/modtrezorui/display-unix-null.h @@ -8,11 +8,6 @@ #define CMD(X) (void)(X); #define DATA(X) (void)(X); -uint32_t trezorui_poll_event(void) -{ - return 0; -} - void display_init(void) { } diff --git a/micropython/extmod/modtrezorui/display.c b/micropython/extmod/modtrezorui/display.c index c1d420f611..05d53a5baa 100644 --- a/micropython/extmod/modtrezorui/display.c +++ b/micropython/extmod/modtrezorui/display.c @@ -23,7 +23,7 @@ static int OFFSET[2] = {0, 0}; #if defined STM32_HAL_H #include "display-stmhal.h" #else -#ifndef TREZORUI_NOUI +#ifndef TREZOR_NOUI #include "display-unix-sdl.h" #else #include "display-unix-null.h" diff --git a/micropython/unix/Makefile b/micropython/unix/Makefile index b3186f8b03..fe9f21c242 100644 --- a/micropython/unix/Makefile +++ b/micropython/unix/Makefile @@ -7,10 +7,11 @@ MICROPY_PY_TREZORDEBUG = 1 MICROPY_PY_TREZORMSG = 1 MICROPY_PY_TREZORUI = 1 -MICROPY_PY_TREZORUI_NOUI = 0 MICROPY_PY_TREZORUTILS = 1 +TREZOR_NOUI = 0 + EXTMOD_DIR = ../../micropython/extmod CFLAGS_EXTRA='-DMP_CONFIGFILE="../../../micropython/unix/mpconfigport.h"' @@ -85,10 +86,10 @@ ifeq ($(MICROPY_PY_TREZORUI),1) $(EXTMOD_DIR)/modtrezorui/font_robotomono_regular_20.c \ $(EXTMOD_DIR)/modtrezorui/modtrezorui.c \ $(EXTMOD_DIR)/modtrezorui/trezor-qrenc/qr_encode.c -ifeq ($(MICROPY_PY_TREZORUI_NOUI),1) - CFLAGS_MOD += -DTREZORUI_NOUI=1 +ifeq ($(TREZOR_NOUI),1) + CFLAGS_MOD += -DTREZOR_NOUI=1 else - LDFLAGS_MOD += -lSDL2 -lSDL2_image + LDFLAGS_MOD += -lSDL2 endif endif diff --git a/micropython/unix/touch.c b/micropython/unix/touch.c index d29ec33eba..a82971a556 100644 --- a/micropython/unix/touch.c +++ b/micropython/unix/touch.c @@ -5,12 +5,16 @@ * see LICENSE file for details */ +#include +#ifndef TREZOR_NOUI #include +#endif #include "options.h" uint32_t touch_read(void) { +#ifndef TREZOR_NOUI SDL_Event event; int x, y; SDL_PumpEvents(); @@ -48,5 +52,6 @@ uint32_t touch_read(void) break; } } +#endif return 0; }