Fix FuriString oplist (init move) (#1894)
* FuriString, Infrared: fix oplist and drop string_t. * Elf loader: log size * Comment fix * API: furi_hal_console_init
This commit is contained in:
@@ -9,12 +9,11 @@
|
||||
#include "infrared_signal.h"
|
||||
#include "infrared_brute_force.h"
|
||||
|
||||
#include "m-dict.h"
|
||||
#include "m-string.h"
|
||||
#include <m-dict.h>
|
||||
|
||||
#define INFRARED_CLI_BUF_SIZE 10
|
||||
|
||||
DICT_DEF2(dict_signals, string_t, STRING_OPLIST, int, M_DEFAULT_OPLIST)
|
||||
DICT_DEF2(dict_signals, FuriString*, FURI_STRING_OPLIST, int, M_DEFAULT_OPLIST)
|
||||
|
||||
enum RemoteTypes { TV = 0, AC = 1 };
|
||||
|
||||
@@ -416,7 +415,7 @@ static void infrared_cli_list_remote_signals(enum RemoteTypes remote_type) {
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
FlipperFormat* ff = flipper_format_buffered_file_alloc(storage);
|
||||
dict_signals_t signals_dict;
|
||||
string_t key;
|
||||
FuriString* key;
|
||||
const char* remote_file = NULL;
|
||||
bool success = false;
|
||||
int max = 1;
|
||||
@@ -433,7 +432,7 @@ static void infrared_cli_list_remote_signals(enum RemoteTypes remote_type) {
|
||||
}
|
||||
|
||||
dict_signals_init(signals_dict);
|
||||
string_init(key);
|
||||
key = furi_string_alloc();
|
||||
|
||||
success = flipper_format_buffered_file_open_existing(ff, remote_file);
|
||||
if(success) {
|
||||
@@ -441,7 +440,7 @@ static void infrared_cli_list_remote_signals(enum RemoteTypes remote_type) {
|
||||
signal_name = furi_string_alloc();
|
||||
printf("Valid signals:\r\n");
|
||||
while(flipper_format_read_string(ff, "name", signal_name)) {
|
||||
string_set_str(key, furi_string_get_cstr(signal_name));
|
||||
furi_string_set_str(key, furi_string_get_cstr(signal_name));
|
||||
int* v = dict_signals_get(signals_dict, key);
|
||||
if(v != NULL) {
|
||||
(*v)++;
|
||||
@@ -453,12 +452,12 @@ static void infrared_cli_list_remote_signals(enum RemoteTypes remote_type) {
|
||||
dict_signals_it_t it;
|
||||
for(dict_signals_it(it, signals_dict); !dict_signals_end_p(it); dict_signals_next(it)) {
|
||||
const struct dict_signals_pair_s* pair = dict_signals_cref(it);
|
||||
printf("\t%s\r\n", string_get_cstr(pair->key));
|
||||
printf("\t%s\r\n", furi_string_get_cstr(pair->key));
|
||||
}
|
||||
furi_string_free(signal_name);
|
||||
}
|
||||
|
||||
string_clear(key);
|
||||
furi_string_free(key);
|
||||
dict_signals_clear(signals_dict);
|
||||
flipper_format_free(ff);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
Reference in New Issue
Block a user