Merge remote-tracking branch 'OFW/dev' into dev

This commit is contained in:
MX 2024-04-30 22:31:39 +03:00
commit 1736a8a7c2
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
5 changed files with 12 additions and 26 deletions

View file

@ -218,19 +218,15 @@ void dallas_ds1971_render_uid(FuriString* result, const iButtonProtocolData* pro
void dallas_ds1971_render_data(FuriString* result, const iButtonProtocolData* protocol_data) {
const DS1971ProtocolData* data = protocol_data;
FuriString* data_string = furi_string_alloc();
furi_string_cat_printf(result, "\e#Memory Data\n--------------------\n");
pretty_format_bytes_hex_canonical(
data_string,
result,
DS1971_DATA_BYTE_COUNT,
PRETTY_FORMAT_FONT_MONOSPACE,
data->eeprom_data,
DS1971_EEPROM_DATA_SIZE);
furi_string_cat_printf(result, "\e#Memory Data\n--------------------\n");
furi_string_cat_printf(result, "%s", furi_string_get_cstr(data_string));
furi_string_free(data_string);
}
void dallas_ds1971_render_brief_data(FuriString* result, const iButtonProtocolData* protocol_data) {

View file

@ -191,19 +191,15 @@ void dallas_ds1992_render_uid(FuriString* result, const iButtonProtocolData* pro
void dallas_ds1992_render_data(FuriString* result, const iButtonProtocolData* protocol_data) {
const DS1992ProtocolData* data = protocol_data;
FuriString* data_string = furi_string_alloc();
furi_string_cat_printf(result, "\e#Memory Data\n--------------------\n");
pretty_format_bytes_hex_canonical(
data_string,
result,
DS1992_DATA_BYTE_COUNT,
PRETTY_FORMAT_FONT_MONOSPACE,
data->sram_data,
DS1992_SRAM_DATA_SIZE);
furi_string_cat_printf(result, "\e#Memory Data\n--------------------\n");
furi_string_cat_printf(result, "%s", furi_string_get_cstr(data_string));
furi_string_free(data_string);
}
void dallas_ds1992_render_brief_data(FuriString* result, const iButtonProtocolData* protocol_data) {

View file

@ -217,19 +217,14 @@ void dallas_ds1996_render_uid(FuriString* result, const iButtonProtocolData* pro
void dallas_ds1996_render_data(FuriString* result, const iButtonProtocolData* protocol_data) {
const DS1996ProtocolData* data = protocol_data;
FuriString* data_string = furi_string_alloc();
furi_string_cat_printf(result, "\e#Memory Data\n--------------------\n");
pretty_format_bytes_hex_canonical(
data_string,
result,
DS1996_DATA_BYTE_COUNT,
PRETTY_FORMAT_FONT_MONOSPACE,
data->sram_data,
DS1996_SRAM_DATA_SIZE);
furi_string_cat_printf(result, "\e#Memory Data\n--------------------\n");
furi_string_cat_printf(result, "%s", furi_string_get_cstr(data_string));
furi_string_free(data_string);
}
void dallas_ds1996_render_brief_data(FuriString* result, const iButtonProtocolData* protocol_data) {

View file

@ -28,8 +28,7 @@ void pretty_format_bytes_hex_canonical(
const size_t line_length = (line_prefix ? strlen(line_prefix) : 0) + 4 * num_places + 2;
/* Reserve memory in adance in order to avoid unnecessary reallocs */
furi_string_reset(result);
furi_string_reserve(result, line_count * line_length);
furi_string_reserve(result, furi_string_size(result) + line_count * line_length);
for(size_t i = 0; i < data_size; i += num_places) {
if(line_prefix) {

View file

@ -203,7 +203,7 @@ void protocol_dict_render_uid(ProtocolDict* dict, FuriString* result, size_t pro
ProtocolRenderData fn = dict->base[protocol_index]->render_uid;
if(fn) {
return fn(dict->data[protocol_index], result);
fn(dict->data[protocol_index], result);
}
}
@ -212,7 +212,7 @@ void protocol_dict_render_data(ProtocolDict* dict, FuriString* result, size_t pr
ProtocolRenderData fn = dict->base[protocol_index]->render_data;
if(fn) {
return fn(dict->data[protocol_index], result);
fn(dict->data[protocol_index], result);
}
}
@ -221,7 +221,7 @@ void protocol_dict_render_brief_data(ProtocolDict* dict, FuriString* result, siz
ProtocolRenderData fn = dict->base[protocol_index]->render_brief_data;
if(fn) {
return fn(dict->data[protocol_index], result);
fn(dict->data[protocol_index], result);
}
}