mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-11 06:09:08 -07:00
merge manually formatted stuff too
This commit is contained in:
@@ -79,7 +79,7 @@ size_t cli_read_timeout(Cli* cli, uint8_t* buffer, size_t size, uint32_t timeout
|
||||
bool cli_is_connected(Cli* cli) {
|
||||
furi_check(cli);
|
||||
if(cli->session != NULL) {
|
||||
return (cli->session->is_connected());
|
||||
return cli->session->is_connected();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ static bool browser_filter_by_name(BrowserWorker* browser, FuriString* name, boo
|
||||
if(is_folder) {
|
||||
// Skip assets folders (if enabled)
|
||||
if(browser->skip_assets) {
|
||||
return ((furi_string_cmp_str(name, ASSETS_DIR) == 0) ? (false) : (true));
|
||||
return (furi_string_cmp_str(name, ASSETS_DIR) == 0) ? (false) : (true);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ static bool browser_folder_load_chunked(
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
return (items_cnt == count);
|
||||
return items_cnt == count;
|
||||
}
|
||||
|
||||
// Load all files at once, may cause memory overflow so need to limit that to about 400 files
|
||||
@@ -571,7 +571,7 @@ void file_browser_worker_folder_enter(BrowserWorker* browser, FuriString* path,
|
||||
|
||||
bool file_browser_worker_is_in_start_folder(BrowserWorker* browser) {
|
||||
furi_check(browser);
|
||||
return (furi_string_cmp(browser->path_start, browser->path_current) == 0);
|
||||
return furi_string_cmp(browser->path_start, browser->path_current) == 0;
|
||||
}
|
||||
|
||||
void file_browser_worker_folder_exit(BrowserWorker* browser) {
|
||||
|
||||
@@ -157,7 +157,7 @@ void menu_free(Menu* menu) {
|
||||
|
||||
View* menu_get_view(Menu* menu) {
|
||||
furi_check(menu);
|
||||
return (menu->view);
|
||||
return menu->view;
|
||||
}
|
||||
|
||||
void menu_add_item(
|
||||
|
||||
@@ -136,7 +136,7 @@ static char get_selected_char(TextInputModel* model) {
|
||||
}
|
||||
|
||||
static bool char_is_lowercase(char letter) {
|
||||
return (letter >= 0x61 && letter <= 0x7A);
|
||||
return letter >= 0x61 && letter <= 0x7A;
|
||||
}
|
||||
|
||||
static char char_to_uppercase(const char letter) {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
#include <flipper_application/flipper_application.h>
|
||||
#include <loader/firmware_api/firmware_api.h>
|
||||
|
||||
#define TAG "Loader"
|
||||
#define TAG "Loader"
|
||||
|
||||
#define LOADER_MAGIC_THREAD_VALUE 0xDEADBEEF
|
||||
|
||||
// helpers
|
||||
|
||||
@@ -31,7 +31,7 @@ float locale_fahrenheit_to_celsius(float temp_f) {
|
||||
}
|
||||
|
||||
float locale_celsius_to_fahrenheit(float temp_c) {
|
||||
return (temp_c * 1.8f + 32.f);
|
||||
return temp_c * 1.8f + 32.f;
|
||||
}
|
||||
|
||||
void locale_format_time(
|
||||
|
||||
@@ -143,17 +143,16 @@ static void notification_apply_notification_leds(NotificationApp* app, const uin
|
||||
|
||||
// settings
|
||||
uint8_t notification_settings_get_display_brightness(NotificationApp* app, uint8_t value) {
|
||||
return (value * app->settings.display_brightness);
|
||||
return value * app->settings.display_brightness;
|
||||
}
|
||||
|
||||
static uint8_t notification_settings_get_rgb_led_brightness(NotificationApp* app, uint8_t value) {
|
||||
return (value * app->settings.led_brightness);
|
||||
return value * app->settings.led_brightness;
|
||||
}
|
||||
|
||||
static uint32_t notification_settings_display_off_delay_ticks(NotificationApp* app) {
|
||||
return (
|
||||
(float)(app->settings.display_off_delay_ms) /
|
||||
(1000.0f / furi_kernel_get_tick_frequency()));
|
||||
return (float)(app->settings.display_off_delay_ms) /
|
||||
(1000.0f / furi_kernel_get_tick_frequency());
|
||||
}
|
||||
|
||||
// generics
|
||||
|
||||
@@ -232,7 +232,7 @@ bool rpc_pb_stream_read(pb_istream_t* istream, pb_byte_t* buf, size_t count) {
|
||||
rpc_debug_print_data("INPUT", buf, bytes_received);
|
||||
#endif
|
||||
|
||||
return (count == bytes_received);
|
||||
return count == bytes_received;
|
||||
}
|
||||
|
||||
static bool rpc_pb_content_callback(pb_istream_t* stream, const pb_field_t* field, void** arg) {
|
||||
|
||||
@@ -40,5 +40,5 @@ const char* filesystem_api_error_get_desc(FS_Error error_id) {
|
||||
|
||||
bool file_info_is_dir(const FileInfo* file_info) {
|
||||
furi_check(file_info);
|
||||
return (file_info->flags & FSF_DIRECTORY);
|
||||
return file_info->flags & FSF_DIRECTORY;
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ static void storage_cli_write(Cli* cli, FuriString* path, FuriString* args) {
|
||||
fflush(stdout);
|
||||
read_index++;
|
||||
|
||||
if(((read_index % buffer_size) == 0)) {
|
||||
if((read_index % buffer_size) == 0) {
|
||||
size_t written_size = storage_file_write(file, buffer, buffer_size);
|
||||
|
||||
if(written_size != buffer_size) {
|
||||
|
||||
@@ -929,12 +929,12 @@ File* storage_file_alloc(Storage* storage) {
|
||||
|
||||
bool storage_file_is_open(File* file) {
|
||||
furi_check(file);
|
||||
return (file->type != FileTypeClosed);
|
||||
return file->type != FileTypeClosed;
|
||||
}
|
||||
|
||||
bool storage_file_is_dir(File* file) {
|
||||
furi_check(file);
|
||||
return (file->type == FileTypeOpenDir);
|
||||
return file->type == FileTypeOpenDir;
|
||||
}
|
||||
|
||||
void storage_file_free(File* file) {
|
||||
|
||||
@@ -337,7 +337,7 @@ static bool storage_ext_file_open(
|
||||
|
||||
file->internal_error_id = f_open(file_data, path, _mode);
|
||||
file->error_id = storage_ext_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_ext_file_close(void* ctx, File* file) {
|
||||
@@ -347,7 +347,7 @@ static bool storage_ext_file_close(void* ctx, File* file) {
|
||||
file->error_id = storage_ext_parse_error(file->internal_error_id);
|
||||
free(file_data);
|
||||
storage_set_storage_file_data(file, NULL, storage);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
@@ -392,7 +392,7 @@ static bool
|
||||
}
|
||||
|
||||
file->error_id = storage_ext_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static uint64_t storage_ext_file_tell(void* ctx, File* file) {
|
||||
@@ -416,7 +416,7 @@ static bool storage_ext_file_truncate(void* ctx, File* file) {
|
||||
|
||||
file->internal_error_id = f_truncate(file_data);
|
||||
file->error_id = storage_ext_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ static bool storage_ext_file_sync(void* ctx, File* file) {
|
||||
|
||||
file->internal_error_id = f_sync(file_data);
|
||||
file->error_id = storage_ext_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ static bool storage_ext_dir_open(void* ctx, File* file, const char* path) {
|
||||
storage_set_storage_file_data(file, file_data, storage);
|
||||
file->internal_error_id = f_opendir(file_data, path);
|
||||
file->error_id = storage_ext_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_ext_dir_close(void* ctx, File* file) {
|
||||
@@ -474,7 +474,7 @@ static bool storage_ext_dir_close(void* ctx, File* file) {
|
||||
file->internal_error_id = f_closedir(file_data);
|
||||
file->error_id = storage_ext_parse_error(file->internal_error_id);
|
||||
free(file_data);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_ext_dir_read(
|
||||
@@ -505,7 +505,7 @@ static bool storage_ext_dir_read(
|
||||
file->error_id = FSE_NOT_EXIST;
|
||||
}
|
||||
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_ext_dir_rewind(void* ctx, File* file) {
|
||||
@@ -514,7 +514,7 @@ static bool storage_ext_dir_rewind(void* ctx, File* file) {
|
||||
|
||||
file->internal_error_id = f_readdir(file_data, NULL);
|
||||
file->error_id = storage_ext_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
/******************* Common FS Functions *******************/
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
#include <furi_hal.h>
|
||||
#include <toolbox/path.h>
|
||||
|
||||
#define TAG "StorageInt"
|
||||
#define TAG "StorageInt"
|
||||
|
||||
#define STORAGE_PATH STORAGE_INT_PATH_PREFIX
|
||||
#define LFS_CLEAN_FINGERPRINT 0
|
||||
|
||||
@@ -287,7 +288,7 @@ static bool storage_int_check_for_free_space(StorageData* storage) {
|
||||
lfs_size_t free_space =
|
||||
(lfs_data->config.block_count - result) * lfs_data->config.block_size;
|
||||
|
||||
return (free_space > LFS_RESERVED_PAGES_COUNT * furi_hal_flash_get_page_size());
|
||||
return free_space > LFS_RESERVED_PAGES_COUNT * furi_hal_flash_get_page_size();
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -344,7 +345,7 @@ static bool storage_int_file_open(
|
||||
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_int_file_close(void* ctx, File* file) {
|
||||
@@ -360,7 +361,7 @@ static bool storage_int_file_close(void* ctx, File* file) {
|
||||
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
lfs_handle_free(handle);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
@@ -430,7 +431,7 @@ static bool
|
||||
}
|
||||
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static uint64_t storage_int_file_tell(void* ctx, File* file) {
|
||||
@@ -475,7 +476,7 @@ static bool storage_int_file_truncate(void* ctx, File* file) {
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
}
|
||||
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_int_file_sync(void* ctx, File* file) {
|
||||
@@ -490,7 +491,7 @@ static bool storage_int_file_sync(void* ctx, File* file) {
|
||||
}
|
||||
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static uint64_t storage_int_file_size(void* ctx, File* file) {
|
||||
@@ -557,7 +558,7 @@ static bool storage_int_dir_open(void* ctx, File* file, const char* path) {
|
||||
}
|
||||
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_int_dir_close(void* ctx, File* file) {
|
||||
@@ -573,7 +574,7 @@ static bool storage_int_dir_close(void* ctx, File* file) {
|
||||
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
lfs_handle_free(handle);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_int_dir_read(
|
||||
@@ -614,7 +615,7 @@ static bool storage_int_dir_read(
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
}
|
||||
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
static bool storage_int_dir_rewind(void* ctx, File* file) {
|
||||
@@ -629,7 +630,7 @@ static bool storage_int_dir_rewind(void* ctx, File* file) {
|
||||
}
|
||||
|
||||
file->error_id = storage_int_parse_error(file->internal_error_id);
|
||||
return (file->error_id == FSE_OK);
|
||||
return file->error_id == FSE_OK;
|
||||
}
|
||||
|
||||
/******************* Common FS Functions *******************/
|
||||
|
||||
Reference in New Issue
Block a user