diff --git a/app/src/common/parser.h b/app/src/common/parser.h index 212734e0..c000b072 100644 --- a/app/src/common/parser.h +++ b/app/src/common/parser.h @@ -24,11 +24,6 @@ extern "C" { #include "coin.h" #define OUTPUT_HANDLER_SIZE 600 -#if defined(TARGET_NANOS) -#undef OUTPUT_HANDLER_SIZE -#define OUTPUT_HANDLER_SIZE 450 -#endif - #define MAX_CONTENT_SIZE 550 #define MAX_TITLE_SIZE 40 #define PRINTABLE_TITLE_SIZE 17 @@ -36,7 +31,6 @@ extern "C" { #define SCREEN_BREAK ":" #define SCREEN_INDENT ">" #define TITLE_TRUNCATE_REPLACE "---" -#define END_OF_STRING_SIZE const char *parser_getErrorDescription(parser_error_t err); diff --git a/app/src/common/tx.c b/app/src/common/tx.c index 9a7c8a4e..83591b75 100644 --- a/app/src/common/tx.c +++ b/app/src/common/tx.c @@ -78,9 +78,15 @@ static parser_tx_t tx_obj; const char *tx_parse(tx_type_e type) { +#if defined(COMPILE_TEXTUAL) if (type != tx_json && type != tx_textual) { return parser_getErrorDescription(parser_value_out_of_range); } +#else + if (type != tx_json) { + return parser_getErrorDescription(parser_value_out_of_range); + } +#endif MEMZERO(&tx_obj, sizeof(tx_obj)); tx_obj.tx_type = type; diff --git a/app/src/parser.c b/app/src/parser.c index c590eeb7..aa4e8adc 100644 --- a/app/src/parser.c +++ b/app/src/parser.c @@ -53,7 +53,9 @@ parser_error_t parser_parse(parser_context_t *ctx, CHECK_PARSER_ERR(parser_init_context(ctx, data, dataLen)) ctx->tx_obj = tx_obj; if (tx_obj->tx_type == tx_textual) { +#if defined(COMPILE_TEXTUAL) CHECK_PARSER_ERR(_read_text_tx(ctx, tx_obj)) +#endif } else { CHECK_PARSER_ERR(_read_json_tx(ctx, tx_obj)) } @@ -311,6 +313,7 @@ __Z_INLINE parser_error_t parser_formatAmount(uint16_t amountToken, return parser_formatAmountItem(showItemTokenIdx, outVal, outValLen, showPageIdx, &dummy); } +#if defined(COMPILE_TEXTUAL) __Z_INLINE parser_error_t parser_screenPrint(const parser_context_t *ctx, Cbor_container *container, char *outKey, uint16_t outKeyLen, @@ -478,6 +481,7 @@ __Z_INLINE parser_error_t parser_getTextualItem(const parser_context_t *ctx, return parser_ok; } +#endif __Z_INLINE parser_error_t parser_getJsonItem(const parser_context_t *ctx, uint8_t displayIdx, @@ -535,11 +539,12 @@ parser_error_t parser_getItem(const parser_context_t *ctx, uint8_t pageIdx, uint8_t *pageCount) { if (ctx->tx_obj->tx_type == tx_textual) { +#if defined(COMPILE_TEXTUAL) CHECK_PARSER_ERR(parser_getTextualItem(ctx,displayIdx, outKey, outKeyLen, outVal, outValLen, pageIdx, pageCount)); - +#endif } else { CHECK_PARSER_ERR(parser_getJsonItem(ctx,displayIdx, outKey, outKeyLen,