From ab4bb55d0fc7cbc1b117104c0190cac2d21ab8b3 Mon Sep 17 00:00:00 2001 From: Yukai Li Date: Thu, 25 Aug 2022 10:07:54 -0600 Subject: [PATCH] nfc: Change furi_assert to furi_crash for default switch cases (#1662) * nfc: Change furi_assert to furi_crash for default switch cases * Nfc: change MiFare Ultralight crash message Co-authored-by: Aleksandr Kutuzov --- applications/nfc/helpers/nfc_generators.c | 2 +- lib/nfc/protocols/mifare_ultralight.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/applications/nfc/helpers/nfc_generators.c b/applications/nfc/helpers/nfc_generators.c index b94adbd7b..11083b9f0 100644 --- a/applications/nfc/helpers/nfc_generators.c +++ b/applications/nfc/helpers/nfc_generators.c @@ -254,7 +254,7 @@ static void session_register_page = 234; break; default: - furi_assert(false); + furi_crash("Unknown MFUL"); break; } diff --git a/lib/nfc/protocols/mifare_ultralight.c b/lib/nfc/protocols/mifare_ultralight.c index f637d378a..b3d80deb3 100644 --- a/lib/nfc/protocols/mifare_ultralight.c +++ b/lib/nfc/protocols/mifare_ultralight.c @@ -940,7 +940,7 @@ static bool mf_ul_check_lock(MfUltralightEmulator* emulator, int16_t write_page) if(write_page >= 512) return true; break; default: - furi_assert(false); + furi_crash("Unknown MFUL"); return true; } @@ -967,8 +967,7 @@ static bool mf_ul_check_lock(MfUltralightEmulator* emulator, int16_t write_page) else if(write_page == 41) shift = 12; else { - furi_assert(false); - shift = 0; + furi_crash("Unknown MFUL"); } break; @@ -999,8 +998,7 @@ static bool mf_ul_check_lock(MfUltralightEmulator* emulator, int16_t write_page) shift = (write_page - 16) / 32; break; default: - furi_assert(false); - shift = 0; + furi_crash("Unknown MFUL"); break; } @@ -1177,8 +1175,7 @@ static void mf_ul_emulate_write( block_lock_count = 8; break; default: - furi_assert(false); - block_lock_count = 0; + furi_crash("Unknown MFUL"); break; }