diff --git a/core/embed/bootloader/bootui.h b/core/embed/bootloader/bootui.h index 4c07f9f17..b53b10334 100644 --- a/core/embed/bootloader/bootui.h +++ b/core/embed/bootloader/bootui.h @@ -56,10 +56,13 @@ void ui_screen_fail(void); void ui_fadein(void); void ui_fadeout(void); +// clang-format off #define INPUT_CANCEL 0x01 // Cancel button #define INPUT_CONFIRM 0x02 // Confirm button #define INPUT_LONG_CONFIRM 0x04 // Long Confirm button #define INPUT_INFO 0x08 // Info icon +// clang-format on + int ui_user_input(int zones); #endif diff --git a/crypto/tests/test_check_cashaddr.h b/crypto/tests/test_check_cashaddr.h index d38b744a6..11d5d6065 100644 --- a/crypto/tests/test_check_cashaddr.h +++ b/crypto/tests/test_check_cashaddr.h @@ -55,8 +55,9 @@ START_TEST(test_cashaddr) { rawdata_len = base58_decode_check(valid_cashaddr[i].legacy, HASHER_SHA2D, rawdata, sizeof(rawdata)); ck_assert_int_eq(rawdata_len, 21); - ck_assert_int_eq(prog[0], - rawdata[0] == 0 ? 0x00 : rawdata[0] == 5 ? 0x08 : -1); + ck_assert_int_eq(prog[0], rawdata[0] == 0 ? 0x00 + : rawdata[0] == 5 ? 0x08 + : -1); ck_assert_int_eq(memcmp(rawdata + 1, prog + 1, 20), 0); ret = cash_addr_encode(rebuild, hrp, prog, 21); ck_assert_int_eq(ret, 1); diff --git a/legacy/firmware/config.c b/legacy/firmware/config.c index e48120a3a..448bc1f03 100644 --- a/legacy/firmware/config.c +++ b/legacy/firmware/config.c @@ -62,24 +62,26 @@ static const uint32_t META_MAGIC_V10 = 0xFFFFFFFF; #define FLAG_PUBLIC_SHIFTED (FLAG_PUBLIC << 8) #define FLAGS_WRITE_SHIFTED (FLAGS_WRITE << 8) -#define KEY_UUID (0 | APP | FLAG_PUBLIC_SHIFTED) // bytes(12) -#define KEY_VERSION (1 | APP) // uint32 -#define KEY_MNEMONIC (2 | APP) // string(241) -#define KEY_LANGUAGE (3 | APP | FLAG_PUBLIC_SHIFTED) // string(17) -#define KEY_LABEL (4 | APP | FLAG_PUBLIC_SHIFTED) // string(33) +// clang-format off +#define KEY_UUID (0 | APP | FLAG_PUBLIC_SHIFTED) // bytes(12) +#define KEY_VERSION (1 | APP) // uint32 +#define KEY_MNEMONIC (2 | APP) // string(241) +#define KEY_LANGUAGE (3 | APP | FLAG_PUBLIC_SHIFTED) // string(17) +#define KEY_LABEL (4 | APP | FLAG_PUBLIC_SHIFTED) // string(33) #define KEY_PASSPHRASE_PROTECTION (5 | APP | FLAG_PUBLIC_SHIFTED) // bool -#define KEY_HOMESCREEN (6 | APP | FLAG_PUBLIC_SHIFTED) // bytes(1024) -#define KEY_NEEDS_BACKUP (7 | APP) // bool -#define KEY_FLAGS (8 | APP) // uint32 -#define KEY_U2F_COUNTER (9 | APP | FLAGS_WRITE_SHIFTED) // uint32 -#define KEY_UNFINISHED_BACKUP (11 | APP) // bool -#define KEY_AUTO_LOCK_DELAY_MS (12 | APP) // uint32 -#define KEY_NO_BACKUP (13 | APP) // bool -#define KEY_INITIALIZED (14 | APP | FLAG_PUBLIC_SHIFTED) // uint32 -#define KEY_NODE (15 | APP) // node -#define KEY_IMPORTED (16 | APP) // bool -#define KEY_U2F_ROOT (17 | APP | FLAG_PUBLIC_SHIFTED) // node -#define KEY_DEBUG_LINK_PIN (255 | APP | FLAG_PUBLIC_SHIFTED) // string(10) +#define KEY_HOMESCREEN (6 | APP | FLAG_PUBLIC_SHIFTED) // bytes(1024) +#define KEY_NEEDS_BACKUP (7 | APP) // bool +#define KEY_FLAGS (8 | APP) // uint32 +#define KEY_U2F_COUNTER (9 | APP | FLAGS_WRITE_SHIFTED) // uint32 +#define KEY_UNFINISHED_BACKUP (11 | APP) // bool +#define KEY_AUTO_LOCK_DELAY_MS (12 | APP) // uint32 +#define KEY_NO_BACKUP (13 | APP) // bool +#define KEY_INITIALIZED (14 | APP | FLAG_PUBLIC_SHIFTED) // uint32 +#define KEY_NODE (15 | APP) // node +#define KEY_IMPORTED (16 | APP) // bool +#define KEY_U2F_ROOT (17 | APP | FLAG_PUBLIC_SHIFTED) // node +#define KEY_DEBUG_LINK_PIN (255 | APP | FLAG_PUBLIC_SHIFTED) // string(10) +// clang-format on #define MAX_SESSIONS_COUNT 10 diff --git a/legacy/firmware/layout2.c b/legacy/firmware/layout2.c index fef49d7b2..d1a3c918f 100644 --- a/legacy/firmware/layout2.c +++ b/legacy/firmware/layout2.c @@ -695,8 +695,10 @@ void layoutAddress(const char *address, const char *desc, bool qrcode, oledDrawString(0, 0 * 9, desc, FONT_STANDARD); } if (addrlen > 10) { // don't split short addresses - uint32_t rowlen = - (addrlen - 1) / (addrlen <= 42 ? 2 : addrlen <= 63 ? 3 : 4) + 1; + uint32_t rowlen = (addrlen - 1) / (addrlen <= 42 ? 2 + : addrlen <= 63 ? 3 + : 4) + + 1; const char **str = split_message((const uint8_t *)address, addrlen, rowlen); for (int i = 0; i < 4; i++) { diff --git a/legacy/firmware/recovery.c b/legacy/firmware/recovery.c index 38fa2e9fe..a302c6b38 100644 --- a/legacy/firmware/recovery.c +++ b/legacy/firmware/recovery.c @@ -146,11 +146,9 @@ static void recovery_request(void) { WordRequest resp = {0}; memzero(&resp, sizeof(WordRequest)); resp.has_type = true; - resp.type = awaiting_word == 1 - ? WordRequestType_WordRequestType_Plain - : (word_index % 4 == 3) - ? WordRequestType_WordRequestType_Matrix6 - : WordRequestType_WordRequestType_Matrix9; + resp.type = awaiting_word == 1 ? WordRequestType_WordRequestType_Plain + : (word_index % 4 == 3) ? WordRequestType_WordRequestType_Matrix6 + : WordRequestType_WordRequestType_Matrix9; msg_write(MessageType_MessageType_WordRequest, &resp); }