mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
Fixed a zero allocation error when reading an iso15693 nfc tag with no additional blocks. (#3229)
Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
parent
04cead1fc5
commit
c6a14e1a67
1 changed files with 23 additions and 21 deletions
|
@ -108,28 +108,30 @@ Iso15693_3Error iso15693_3_poller_activate(Iso15693_3Poller* instance, Iso15693_
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read blocks: Optional command
|
if(system_info->block_count > 0) {
|
||||||
simple_array_init(data->block_data, system_info->block_count * system_info->block_size);
|
// Read blocks: Optional command
|
||||||
ret = iso15693_3_poller_read_blocks(
|
simple_array_init(
|
||||||
instance,
|
data->block_data, system_info->block_count * system_info->block_size);
|
||||||
simple_array_get_data(data->block_data),
|
ret = iso15693_3_poller_read_blocks(
|
||||||
system_info->block_count,
|
instance,
|
||||||
system_info->block_size);
|
simple_array_get_data(data->block_data),
|
||||||
if(ret != Iso15693_3ErrorNone) {
|
system_info->block_count,
|
||||||
ret = iso15693_3_poller_filter_error(ret);
|
system_info->block_size);
|
||||||
break;
|
if(ret != Iso15693_3ErrorNone) {
|
||||||
|
ret = iso15693_3_poller_filter_error(ret);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get block security status: Optional command
|
||||||
|
simple_array_init(data->block_security, system_info->block_count);
|
||||||
|
|
||||||
|
ret = iso15693_3_poller_get_blocks_security(
|
||||||
|
instance, simple_array_get_data(data->block_security), system_info->block_count);
|
||||||
|
if(ret != Iso15693_3ErrorNone) {
|
||||||
|
ret = iso15693_3_poller_filter_error(ret);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get block security status: Optional command
|
|
||||||
simple_array_init(data->block_security, system_info->block_count);
|
|
||||||
|
|
||||||
ret = iso15693_3_poller_get_blocks_security(
|
|
||||||
instance, simple_array_get_data(data->block_security), system_info->block_count);
|
|
||||||
if(ret != Iso15693_3ErrorNone) {
|
|
||||||
ret = iso15693_3_poller_filter_error(ret);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
} while(false);
|
} while(false);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue