Hackathone session: bugfixes and documentation update (#869)

* ReadMe: update flashing scripts section
* Furi: add record exists method to record store.
* FuriHal: early OS init and i2c timeouts based on os ticks.
* Storage: replace malloc with furi_alloc, fix errors found by pvs.
* iButton: properly handle shutdown in cli search command
* SubGhz: proper argument type in sscanf and incorrect position of logging in switch.
This commit is contained in:
あく
2021-12-05 14:47:02 +03:00
committed by GitHub
parent 4b8653e061
commit 98bc190ac4
14 changed files with 200 additions and 132 deletions

View File

@@ -255,7 +255,6 @@ void onewire_cli_search(Cli* cli) {
printf("Search finished\r\n");
onewire.reset_search();
done = true;
return;
} else {
printf("Found: ");
for(uint8_t i = 0; i < 8; i++) {

View File

@@ -377,7 +377,7 @@ static FS_Error storage_process_common_rename(Storage* app, const char* old, con
StorageType type_old = storage_get_type_by_path(old);
StorageType type_new = storage_get_type_by_path(new);
if(storage_type_is_not_valid(type_old) || storage_type_is_not_valid(type_old)) {
if(storage_type_is_not_valid(type_old) || storage_type_is_not_valid(type_new)) {
ret = FSE_INVALID_NAME;
} else {
if(type_old != type_new) {

View File

@@ -512,7 +512,7 @@ static FS_Error storage_ext_common_fs_info(
/******************* Init Storage *******************/
void storage_ext_init(StorageData* storage) {
SDData* sd_data = malloc(sizeof(SDData));
SDData* sd_data = furi_alloc(sizeof(SDData));
sd_data->fs = &USERFatFS;
sd_data->path = "0:/";
sd_data->sd_was_present = true;

View File

@@ -102,13 +102,13 @@ static void subghz_cli_command_rx_carrier(Cli* cli, string_t args, void* context
static void subghz_cli_command_tx(Cli* cli, string_t args, void* context) {
uint32_t frequency = 433920000;
uint32_t key = 0x0074BADE;
size_t repeat = 10;
uint32_t repeat = 10;
if(string_size(args)) {
int ret = sscanf(string_get_cstr(args), "%lx %lu %u", &key, &frequency, &repeat);
int ret = sscanf(string_get_cstr(args), "%lx %lu %lu", &key, &frequency, &repeat);
if(ret != 3) {
printf(
"sscanf returned %d, key: %lx, frequency: %lu, repeat: %u\r\n",
"sscanf returned %d, key: %lx, frequency: %lu, repeat: %lu\r\n",
ret,
key,
frequency,
@@ -128,7 +128,7 @@ static void subghz_cli_command_tx(Cli* cli, string_t args, void* context) {
}
printf(
"Transmitting at %lu, key %lx, repeat %u. Press CTRL+C to stop\r\n",
"Transmitting at %lu, key %lx, repeat %lu. Press CTRL+C to stop\r\n",
frequency,
key,
repeat);

View File

@@ -41,8 +41,8 @@ bool subghz_get_preset_name(SubGhz* subghz, string_t preset) {
case FuriHalSubGhzPreset2FSKDev476Async:
preset_name = "FuriHalSubGhzPreset2FSKDev476Async";
break;
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unknown preset");
default:
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unknown preset");
return false;
break;
}