From 80707f195be4a580a8a5913b48324884cddfa0a0 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 15 Dec 2017 22:59:00 +0100 Subject: [PATCH] modtrezorui: small cleanup --- embed/extmod/modtrezorui/display.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/embed/extmod/modtrezorui/display.c b/embed/extmod/modtrezorui/display.c index be2f71942..e99208840 100644 --- a/embed/extmod/modtrezorui/display.c +++ b/embed/extmod/modtrezorui/display.c @@ -32,7 +32,6 @@ static int DISPLAY_OFFSET[2] = {0, 0}; #if defined TREZOR_STM32 #include "display-stm32.h" #elif defined TREZOR_UNIX -#include #include "display-unix.h" #else #error Unsupported TREZOR port. Only STM32 and UNIX ports are supported. @@ -388,8 +387,11 @@ void display_print(const char *text, int textlen) display_refresh(); } -#ifndef TREZOR_UNIX -int mini_vsnprintf(char* buffer, unsigned int buffer_len, const char *fmt, va_list va); +#ifdef TREZOR_UNIX +#define mini_vsnprintf vsnprintf +#include +#else +#include "mini_printf.h" #endif // variadic display_print @@ -401,11 +403,7 @@ void display_printf(const char *fmt, ...) va_list va; va_start(va, fmt); char buf[256]; -#ifndef TREZOR_UNIX int len = mini_vsnprintf(buf, sizeof(buf), fmt, va); -#else - int len = vsnprintf(buf, sizeof(buf), fmt, va); -#endif display_print(buf, len); va_end(va); }