mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-20 04:54:45 -07:00
Api Symbols: replace asserts with checks
merge ofw commit
This commit is contained in:
@@ -20,7 +20,9 @@ St25tbError st25tb_poller_send_frame(
|
||||
const BitBuffer* tx_buffer,
|
||||
BitBuffer* rx_buffer,
|
||||
uint32_t fwt) {
|
||||
furi_assert(instance);
|
||||
furi_check(instance);
|
||||
furi_check(tx_buffer);
|
||||
furi_check(rx_buffer);
|
||||
|
||||
const size_t tx_bytes = bit_buffer_get_size_bytes(tx_buffer);
|
||||
furi_assert(
|
||||
@@ -54,8 +56,8 @@ St25tbError st25tb_poller_send_frame(
|
||||
|
||||
St25tbError st25tb_poller_initiate(St25tbPoller* instance, uint8_t* chip_id_ptr) {
|
||||
// Send Initiate()
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->nfc);
|
||||
furi_check(instance);
|
||||
furi_check(instance->nfc);
|
||||
|
||||
bit_buffer_reset(instance->tx_buffer);
|
||||
bit_buffer_reset(instance->rx_buffer);
|
||||
@@ -86,8 +88,8 @@ St25tbError st25tb_poller_initiate(St25tbPoller* instance, uint8_t* chip_id_ptr)
|
||||
}
|
||||
|
||||
St25tbError st25tb_poller_select(St25tbPoller* instance, uint8_t* chip_id_ptr) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->nfc);
|
||||
furi_check(instance);
|
||||
furi_check(instance->nfc);
|
||||
|
||||
St25tbError ret;
|
||||
|
||||
@@ -169,8 +171,9 @@ St25tbError st25tb_poller_read(St25tbPoller* instance, St25tbData* data) {
|
||||
}
|
||||
|
||||
St25tbError st25tb_poller_get_uid(St25tbPoller* instance, uint8_t* uid) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->nfc);
|
||||
furi_check(instance);
|
||||
furi_check(instance->nfc);
|
||||
furi_check(uid);
|
||||
|
||||
St25tbError ret;
|
||||
|
||||
@@ -213,10 +216,10 @@ St25tbError st25tb_poller_get_uid(St25tbPoller* instance, uint8_t* uid) {
|
||||
|
||||
St25tbError
|
||||
st25tb_poller_read_block(St25tbPoller* instance, uint32_t* block, uint8_t block_number) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->nfc);
|
||||
furi_assert(block);
|
||||
furi_assert(
|
||||
furi_check(instance);
|
||||
furi_check(instance->nfc);
|
||||
furi_check(block);
|
||||
furi_check(
|
||||
(block_number <= st25tb_get_block_count(instance->data->type)) ||
|
||||
block_number == ST25TB_SYSTEM_OTP_BLOCK);
|
||||
FURI_LOG_T(TAG, "reading block %d", block_number);
|
||||
@@ -248,9 +251,9 @@ St25tbError
|
||||
|
||||
St25tbError
|
||||
st25tb_poller_write_block(St25tbPoller* instance, uint32_t block, uint8_t block_number) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->nfc);
|
||||
furi_assert(
|
||||
furi_check(instance);
|
||||
furi_check(instance->nfc);
|
||||
furi_check(
|
||||
(block_number <= st25tb_get_block_count(instance->data->type)) ||
|
||||
block_number == ST25TB_SYSTEM_OTP_BLOCK);
|
||||
FURI_LOG_T(TAG, "writing block %d", block_number);
|
||||
@@ -292,7 +295,7 @@ St25tbError
|
||||
}
|
||||
|
||||
St25tbError st25tb_poller_halt(St25tbPoller* instance) {
|
||||
furi_assert(instance);
|
||||
furi_check(instance);
|
||||
|
||||
bit_buffer_reset(instance->tx_buffer);
|
||||
bit_buffer_reset(instance->rx_buffer);
|
||||
|
||||
Reference in New Issue
Block a user