[FL-2520] FW build with -Wextra (#1185)

* Fixing compiler warnings with -Wextra
* More warnings suppression, WIP
* Even more warning fixes
* Added new lines at end of text files.
* Padding fix
* Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline
* Fixes for Secplus v1
* -additional warnings
* +-Wredundant-decls fixes
* FuriHal: print stack overflow task name in console
* FuriHal: add missing include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
hedger 2022-05-06 16:37:10 +03:00 committed by GitHub
parent 1ca98170d9
commit 4d6b170769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
461 changed files with 940 additions and 519 deletions

View File

@ -83,4 +83,4 @@ SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TabWidth: 4
UseTab: Never
UseTab: Never

View File

@ -43,4 +43,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache
cache-to: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache,mode=max
cache-to: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache,mode=max

View File

@ -14,4 +14,4 @@ jobs:
with:
path: assets/protobuf
branch: dev
fetch_depth: 50
fetch_depth: 50

View File

@ -149,6 +149,7 @@ const AboutDialogScreen about_screens[] = {
const size_t about_screens_count = sizeof(about_screens) / sizeof(AboutDialogScreen);
int32_t about_settings_app(void* p) {
UNUSED(p);
DialogsApp* dialogs = furi_record_open("dialogs");
DialogMessage* message = dialog_message_alloc();

View File

@ -2,9 +2,10 @@
// app enter function
extern "C" int32_t accessor_app(void* p) {
UNUSED(p);
AccessorApp* app = new AccessorApp();
app->run();
delete app;
return 255;
}
}

View File

@ -51,4 +51,4 @@ private:
OneWireHost* onewire_host;
NotificationApp* notification;
};
};

View File

@ -64,7 +64,7 @@ void AccessorAppViewManager::send_event(AccessorEvent* event) {
furi_check(result == osOK);
}
uint32_t AccessorAppViewManager::previous_view_callback(void* context) {
uint32_t AccessorAppViewManager::previous_view_callback(void*) {
if(event_queue != NULL) {
AccessorEvent event;
event.type = AccessorEvent::Type::Back;
@ -76,4 +76,4 @@ uint32_t AccessorAppViewManager::previous_view_callback(void* context) {
void AccessorAppViewManager::add_view(ViewType view_type, View* view) {
view_dispatcher_add_view(view_dispatcher, static_cast<uint32_t>(view_type), view);
}
}

View File

@ -36,4 +36,4 @@ private:
// view elements
Submenu* submenu;
Popup* popup;
};
};

View File

@ -27,4 +27,4 @@ private:
static int _wiegandType;
static unsigned long _code;
static unsigned long _codeHigh;
};
};

View File

@ -10,4 +10,4 @@ public:
virtual void on_exit(AccessorApp* app) = 0;
private:
};
};

View File

@ -6,4 +6,4 @@ public:
void on_enter(AccessorApp* app) final;
bool on_event(AccessorApp* app, AccessorEvent* event) final;
void on_exit(AccessorApp* app) final;
};
};

View File

@ -66,6 +66,7 @@ void archive_free(ArchiveApp* archive) {
}
int32_t archive_app(void* p) {
UNUSED(p);
ArchiveApp* archive = archive_alloc();
scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser);
view_dispatcher_run(archive->view_dispatcher);

View File

@ -7,8 +7,8 @@ static const char* known_apps[] = {
};
ArchiveAppTypeEnum archive_get_app_type(const char* path) {
for(size_t i = 0; i < SIZEOF_ARRAY(known_apps); i++) {
if(strncmp(path, known_apps[i], strlen(known_apps[i])) != STRING_FAILURE) {
for(size_t i = 0; i < COUNT_OF(known_apps); i++) {
if(strncmp(path, known_apps[i], strlen(known_apps[i])) == 0) {
return i;
}
}
@ -16,6 +16,7 @@ ArchiveAppTypeEnum archive_get_app_type(const char* path) {
}
bool archive_app_is_available(void* context, const char* path) {
UNUSED(context);
furi_assert(path);
ArchiveAppTypeEnum app = archive_get_app_type(path);

View File

@ -11,7 +11,7 @@ static const ArchiveFileTypeEnum app_file_types[] = {
[ArchiveAppTypeUnknown] = ArchiveFileTypeUnknown,
};
static inline const ArchiveFileTypeEnum archive_get_app_filetype(ArchiveAppTypeEnum app) {
static inline ArchiveFileTypeEnum archive_get_app_filetype(ArchiveAppTypeEnum app) {
return app_file_types[app];
}

View File

@ -6,7 +6,8 @@
bool archive_is_item_in_array(ArchiveBrowserViewModel* model, uint32_t idx) {
size_t array_size = files_array_size(model->files);
if((idx >= model->array_offset + array_size) || (idx < model->array_offset)) {
if((idx >= (uint32_t)model->array_offset + array_size) ||
(idx < (uint32_t)model->array_offset)) {
return false;
}
@ -20,12 +21,14 @@ void archive_update_offset(ArchiveBrowserView* browser) {
browser->view, (ArchiveBrowserViewModel * model) {
uint16_t bounds = model->item_cnt > 3 ? 2 : model->item_cnt;
if(model->item_cnt > 3 && model->item_idx >= model->item_cnt - 1) {
if((model->item_cnt > 3u) && ((uint32_t)model->item_idx >= (model->item_cnt - 1))) {
model->list_offset = model->item_idx - 3;
} else if(model->list_offset < model->item_idx - bounds) {
model->list_offset = CLAMP(model->item_idx - 2, model->item_cnt - bounds, 0);
model->list_offset =
CLAMP((uint32_t)model->item_idx - 2, model->item_cnt - bounds, 0u);
} else if(model->list_offset > model->item_idx - bounds) {
model->list_offset = CLAMP(model->item_idx - 1, model->item_cnt - bounds, 0);
model->list_offset =
CLAMP((uint32_t)model->item_idx - 1, model->item_cnt - bounds, 0u);
}
return true;
@ -77,7 +80,7 @@ void archive_set_item_count(ArchiveBrowserView* browser, uint32_t count) {
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
model->item_cnt = count;
model->item_idx = CLAMP(model->item_idx, model->item_cnt - 1, 0);
model->item_idx = CLAMP((uint32_t)model->item_idx, model->item_cnt - 1, 0u);
return false;
});
archive_update_offset(browser);
@ -94,7 +97,7 @@ void archive_file_array_rm_selected(ArchiveBrowserView* browser) {
model->item_idx - model->array_offset,
model->item_idx - model->array_offset + 1);
model->item_cnt--;
model->item_idx = CLAMP(model->item_idx, model->item_cnt - 1, 0);
model->item_idx = CLAMP((uint32_t)model->item_idx, model->item_cnt - 1, 0u);
items_cnt = model->item_cnt;
return false;
});
@ -113,14 +116,14 @@ void archive_file_array_swap(ArchiveBrowserView* browser, int8_t dir) {
browser->view, (ArchiveBrowserViewModel * model) {
ArchiveFile_t temp;
size_t array_size = files_array_size(model->files) - 1;
uint8_t swap_idx = CLAMP(model->item_idx + dir, array_size, 0);
uint8_t swap_idx = CLAMP((size_t)(model->item_idx + dir), array_size, 0u);
if(model->item_idx == 0 && dir < 0) {
ArchiveFile_t_init(&temp);
files_array_pop_at(&temp, model->files, array_size);
files_array_push_at(model->files, model->item_idx, temp);
ArchiveFile_t_clear(&temp);
} else if(model->item_idx == array_size && dir > 0) {
} else if(((uint32_t)model->item_idx == array_size) && (dir > 0)) {
ArchiveFile_t_init(&temp);
files_array_pop_at(&temp, model->files, 0);
files_array_push_at(model->files, array_size, temp);
@ -157,7 +160,7 @@ bool archive_file_array_load(ArchiveBrowserView* browser, int8_t dir) {
} else {
offset_new = model->item_idx - FILE_LIST_BUF_LEN / 4 * 1;
}
offset_new = CLAMP(offset_new, model->item_cnt - FILE_LIST_BUF_LEN, 0);
offset_new = CLAMP((uint32_t)offset_new, model->item_cnt - FILE_LIST_BUF_LEN, 0u);
}
return false;
});
@ -196,7 +199,7 @@ ArchiveFile_t* archive_get_file_at(ArchiveBrowserView* browser, size_t idx) {
with_view_model(
browser->view, (ArchiveBrowserViewModel * model) {
idx = CLAMP(idx - model->array_offset, files_array_size(model->files), 0);
idx = CLAMP(idx - model->array_offset, files_array_size(model->files), 0u);
selected = files_array_size(model->files) ? files_array_get(model->files, idx) : NULL;
return false;
});
@ -247,6 +250,7 @@ void archive_set_tab(ArchiveBrowserView* browser, ArchiveTabEnum tab) {
});
}
void archive_set_last_tab(ArchiveBrowserView* browser, ArchiveTabEnum tab) {
UNUSED(tab); // FIXME?
furi_assert(browser);
with_view_model(

View File

@ -42,7 +42,7 @@ static const ArchiveFileTypeEnum known_type[] = {
[ArchiveTabBrowser] = ArchiveFileTypeUnknown,
};
static inline const ArchiveFileTypeEnum archive_get_tab_filetype(ArchiveTabEnum tab) {
static inline ArchiveFileTypeEnum archive_get_tab_filetype(ArchiveTabEnum tab) {
return known_type[tab];
}

View File

@ -54,7 +54,7 @@ void archive_set_file_type(ArchiveFile_t* file, FileInfo* file_info, const char*
} else {
furi_assert(file_info);
for(size_t i = 0; i < SIZEOF_ARRAY(known_ext); i++) {
for(size_t i = 0; i < COUNT_OF(known_ext); i++) {
if((known_ext[i][0] == '?') || (known_ext[i][0] == '*')) continue;
if(string_search_str(file->name, known_ext[i], 0) != STRING_FAILURE) {
if(i == ArchiveFileTypeBadUsb) {

View File

@ -31,6 +31,7 @@ static void archive_loader_callback(const void* message, void* context) {
}
static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selected) {
UNUSED(browser);
Loader* loader = furi_record_open("loader");
LoaderStatus status;

View File

@ -106,17 +106,17 @@ static void draw_list(Canvas* canvas, ArchiveBrowserViewModel* model) {
size_t array_size = files_array_size(model->files);
bool scrollbar = model->item_cnt > 4;
for(size_t i = 0; i < MIN(model->item_cnt, MENU_ITEMS); ++i) {
for(uint32_t i = 0; i < MIN(model->item_cnt, MENU_ITEMS); ++i) {
string_t str_buff;
char cstr_buff[MAX_NAME_LEN];
size_t idx = CLAMP(i + model->list_offset, model->item_cnt, 0);
int32_t idx = CLAMP((uint32_t)(i + model->list_offset), model->item_cnt, 0u);
uint8_t x_offset = (model->move_fav && model->item_idx == idx) ? MOVE_OFFSET : 0;
ArchiveFileTypeEnum file_type = ArchiveFileTypeLoading;
if(archive_is_item_in_array(model, idx)) {
ArchiveFile_t* file =
files_array_get(model->files, CLAMP(idx - model->array_offset, array_size - 1, 0));
ArchiveFile_t* file = files_array_get(
model->files, CLAMP(idx - model->array_offset, (int32_t)(array_size - 1), 0));
strlcpy(cstr_buff, string_get_cstr(file->name), string_size(file->name) + 1);
archive_trim_file_path(cstr_buff, archive_is_known_app(file->type));
string_init_set_str(str_buff, cstr_buff);
@ -216,7 +216,7 @@ static bool is_file_list_load_required(ArchiveBrowserViewModel* model) {
}
if(((model->array_offset + array_size) < model->item_cnt) &&
(model->item_idx > (model->array_offset + array_size - FILE_LIST_BUF_LEN / 4))) {
(model->item_idx > (int32_t)(model->array_offset + array_size - FILE_LIST_BUF_LEN / 4))) {
return true;
}
@ -376,4 +376,4 @@ void browser_free(ArchiveBrowserView* browser) {
view_free(browser->view);
free(browser);
}
}

View File

@ -13,8 +13,8 @@
#define MAX_NAME_LEN 255
#define MAX_EXT_LEN 6
#define FRAME_HEIGHT 12
#define MENU_ITEMS 4
#define MOVE_OFFSET 5
#define MENU_ITEMS 4u
#define MOVE_OFFSET 5u
typedef enum {
ArchiveTabFavorites,

View File

@ -31,10 +31,13 @@ void bad_usb_scene_file_select_on_enter(void* context) {
}
bool bad_usb_scene_file_select_on_event(void* context, SceneManagerEvent event) {
UNUSED(context);
UNUSED(event);
// BadUsbApp* bad_usb = context;
return false;
}
void bad_usb_scene_file_select_on_exit(void* context) {
UNUSED(context);
// BadUsbApp* bad_usb = context;
}

View File

@ -142,6 +142,7 @@ void bad_usb_set_ok_callback(BadUsb* bad_usb, BadUsbOkCallback callback, void* c
furi_assert(callback);
with_view_model(
bad_usb->view, (BadUsbModel * model) {
UNUSED(model);
bad_usb->callback = callback;
bad_usb->context = context;
return true;

View File

@ -13,6 +13,9 @@ static const char* bt_cli_address_types[] = {
};
static void bt_cli_command_hci_info(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
string_t buffer;
string_init(buffer);
furi_hal_bt_dump_state(buffer);
@ -21,6 +24,7 @@ static void bt_cli_command_hci_info(Cli* cli, string_t args, void* context) {
}
static void bt_cli_command_carrier_tx(Cli* cli, string_t args, void* context) {
UNUSED(context);
int channel = 0;
int power = 0;
@ -47,6 +51,7 @@ static void bt_cli_command_carrier_tx(Cli* cli, string_t args, void* context) {
}
static void bt_cli_command_carrier_rx(Cli* cli, string_t args, void* context) {
UNUSED(context);
int channel = 0;
do {
@ -72,6 +77,7 @@ static void bt_cli_command_carrier_rx(Cli* cli, string_t args, void* context) {
}
static void bt_cli_command_packet_tx(Cli* cli, string_t args, void* context) {
UNUSED(context);
int channel = 0;
int pattern = 0;
int datarate = 1;
@ -115,6 +121,7 @@ static void bt_cli_command_packet_tx(Cli* cli, string_t args, void* context) {
}
static void bt_cli_command_packet_rx(Cli* cli, string_t args, void* context) {
UNUSED(context);
int channel = 0;
int datarate = 1;
@ -152,6 +159,8 @@ static void bt_cli_scan_callback(GapAddress address, void* context) {
}
static void bt_cli_command_scan(Cli* cli, string_t args, void* context) {
UNUSED(context);
UNUSED(args);
osMessageQueueId_t queue = osMessageQueueNew(20, sizeof(GapAddress), NULL);
furi_hal_bt_start_scan(bt_cli_scan_callback, queue);
@ -189,6 +198,7 @@ static void bt_cli_print_usage() {
}
static void bt_cli(Cli* cli, string_t args, void* context) {
UNUSED(context);
furi_record_open("bt");
string_t cmd;

View File

@ -19,10 +19,12 @@ void bt_debug_submenu_callback(void* context, uint32_t index) {
}
uint32_t bt_debug_exit(void* context) {
UNUSED(context);
return VIEW_NONE;
}
uint32_t bt_debug_start_view(void* context) {
UNUSED(context);
return BtDebugAppViewSubmenu;
}
@ -94,6 +96,7 @@ void bt_debug_app_free(BtDebugApp* app) {
}
int32_t bt_debug_app(void* p) {
UNUSED(p);
if(furi_hal_bt_get_radio_stack() != FuriHalBtStackHciLayer) {
FURI_LOG_E(TAG, "Incorrect radio stack, replace with HciLayer for tests.");
DialogsApp* dialogs = furi_record_open("dialogs");

View File

@ -141,7 +141,7 @@ BtCarrierTest* bt_carrier_test_alloc() {
param = bt_test_param_add(
bt_carrier_test->bt_test,
"Mode",
SIZEOF_ARRAY(bt_param_mode),
COUNT_OF(bt_param_mode),
bt_carrier_test_mode_changed,
bt_carrier_test);
bt_test_set_current_value_index(param, 0);
@ -151,7 +151,7 @@ BtCarrierTest* bt_carrier_test_alloc() {
param = bt_test_param_add(
bt_carrier_test->bt_test,
"Channel",
SIZEOF_ARRAY(bt_param_channel),
COUNT_OF(bt_param_channel),
bt_carrier_test_channel_changed,
bt_carrier_test);
bt_test_set_current_value_index(param, 0);
@ -162,7 +162,7 @@ BtCarrierTest* bt_carrier_test_alloc() {
param = bt_test_param_add(
bt_carrier_test->bt_test,
"Power",
SIZEOF_ARRAY(bt_param_power),
COUNT_OF(bt_param_power),
bt_carrier_test_param_channel,
bt_carrier_test);
bt_test_set_current_value_index(param, 0);

View File

@ -109,7 +109,7 @@ BtPacketTest* bt_packet_test_alloc() {
param = bt_test_param_add(
bt_packet_test->bt_test,
"Mode",
SIZEOF_ARRAY(bt_param_mode),
COUNT_OF(bt_param_mode),
bt_packet_test_mode_changed,
bt_packet_test);
bt_test_set_current_value_index(param, 0);
@ -119,7 +119,7 @@ BtPacketTest* bt_packet_test_alloc() {
param = bt_test_param_add(
bt_packet_test->bt_test,
"Channel",
SIZEOF_ARRAY(bt_param_channel),
COUNT_OF(bt_param_channel),
bt_packet_test_channel_changed,
bt_packet_test);
bt_test_set_current_value_index(param, 0);
@ -129,7 +129,7 @@ BtPacketTest* bt_packet_test_alloc() {
param = bt_test_param_add(
bt_packet_test->bt_test,
"Data rate",
SIZEOF_ARRAY(bt_param_data_rate),
COUNT_OF(bt_param_data_rate),
bt_packet_test_param_channel,
bt_packet_test);
bt_test_set_current_value_index(param, 0);

View File

@ -33,10 +33,12 @@ void bt_hid_dialog_callback(DialogExResult result, void* context) {
}
uint32_t bt_hid_exit_confirm_view(void* context) {
UNUSED(context);
return BtHidViewExitConfirm;
}
uint32_t bt_hid_exit(void* context) {
UNUSED(context);
return VIEW_NONE;
}
@ -139,6 +141,7 @@ void bt_hid_app_free(BtHid* app) {
}
int32_t bt_hid_app(void* p) {
UNUSED(p);
// Switch profile to Hid
BtHid* app = bt_hid_app_alloc();
bt_set_status_changed_callback(app->bt, bt_hid_connection_status_changed_callback, app);

View File

@ -76,6 +76,7 @@ void bt_settings_app_free(BtSettingsApp* app) {
}
extern int32_t bt_settings_app(void* p) {
UNUSED(p);
BtSettingsApp* app = bt_settings_app_alloc();
view_dispatcher_run(app->view_dispatcher);
bt_settings_save(&app->settings);

View File

@ -130,10 +130,12 @@ void cli_motd() {
}
void cli_nl(Cli* cli) {
UNUSED(cli);
printf("\r\n");
}
void cli_prompt(Cli* cli) {
UNUSED(cli);
printf("\r\n>: %s", string_get_cstr(cli->line));
fflush(stdout);
}
@ -451,6 +453,7 @@ void cli_session_close(Cli* cli) {
}
int32_t cli_srv(void* p) {
UNUSED(p);
Cli* cli = cli_alloc();
// Init basic cli commands

View File

@ -12,6 +12,8 @@
#define CLI_DATE_FORMAT "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %d"
void cli_command_device_info_callback(const char* key, const char* value, bool last, void* context) {
UNUSED(context);
UNUSED(last);
printf("%-24s: %s\r\n", key, value);
}
@ -20,11 +22,14 @@ void cli_command_device_info_callback(const char* key, const char* value, bool l
* This command is intended to be used by humans
*/
void cli_command_device_info(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(args);
furi_hal_info_get(cli_command_device_info_callback, context);
}
void cli_command_help(Cli* cli, string_t args, void* context) {
(void)args;
UNUSED(args);
UNUSED(context);
printf("Commands we have:");
// Command count
@ -62,6 +67,9 @@ void cli_command_help(Cli* cli, string_t args, void* context) {
}
void cli_command_date(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(context);
FuriHalRtcDateTime datetime = {0};
if(string_size(args) > 0) {
@ -135,6 +143,8 @@ void cli_command_log_tx_callback(const uint8_t* buffer, size_t size, void* conte
}
void cli_command_log(Cli* cli, string_t args, void* context) {
UNUSED(args);
UNUSED(context);
StreamBufferHandle_t ring = xStreamBufferCreate(CLI_COMMAND_LOG_RING_SIZE, 1);
uint8_t buffer[CLI_COMMAND_LOG_BUFFER_SIZE];
@ -152,6 +162,8 @@ void cli_command_log(Cli* cli, string_t args, void* context) {
}
void cli_command_vibro(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(context);
if(!string_cmp(args, "0")) {
NotificationApp* notification = furi_record_open("notification");
notification_message_block(notification, &sequence_reset_vibro);
@ -166,6 +178,8 @@ void cli_command_vibro(Cli* cli, string_t args, void* context) {
}
void cli_command_debug(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(context);
if(!string_cmp(args, "0")) {
furi_hal_rtc_reset_flag(FuriHalRtcFlagDebug);
loader_update_menu();
@ -180,6 +194,8 @@ void cli_command_debug(Cli* cli, string_t args, void* context) {
}
void cli_command_led(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(context);
// Get first word as light name
NotificationMessage notification_led_message;
string_t light_name;
@ -233,6 +249,7 @@ void cli_command_led(Cli* cli, string_t args, void* context) {
}
void cli_command_gpio_set(Cli* cli, string_t args, void* context) {
UNUSED(context);
char pin_names[][4] = {
"PC0",
"PC1",
@ -313,6 +330,8 @@ void cli_command_gpio_set(Cli* cli, string_t args, void* context) {
return;
}
}
#else
UNUSED(cli);
#endif
LL_GPIO_SetPinMode(gpio[num].port, gpio[num].pin, LL_GPIO_MODE_OUTPUT);
@ -325,6 +344,10 @@ void cli_command_gpio_set(Cli* cli, string_t args, void* context) {
}
void cli_command_ps(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
const uint8_t threads_num_max = 32;
osThreadId_t threads_id[threads_num_max];
uint8_t thread_num = osThreadEnumerate(threads_id, threads_num_max);
@ -344,6 +367,10 @@ void cli_command_ps(Cli* cli, string_t args, void* context) {
}
void cli_command_free(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
printf("Free heap size: %d\r\n", memmgr_get_free_heap());
printf("Total heap size: %d\r\n", memmgr_get_total_heap());
printf("Minimum heap size: %d\r\n", memmgr_get_minimum_free_heap());
@ -351,10 +378,18 @@ void cli_command_free(Cli* cli, string_t args, void* context) {
}
void cli_command_free_blocks(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
memmgr_heap_printf_free_blocks();
}
void cli_command_i2c(Cli* cli, string_t args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
furi_hal_i2c_acquire(&furi_hal_i2c_handle_external);
printf("Scanning external i2c on PC0(SCL)/PC1(SDA)\r\n"
"Clock: 100khz, 7bit address\r\n"
@ -391,4 +426,4 @@ void cli_commands_init(Cli* cli) {
cli_add_command(cli, "led", CliCommandFlagDefault, cli_command_led, NULL);
cli_add_command(cli, "gpio_set", CliCommandFlagDefault, cli_command_gpio_set, NULL);
cli_add_command(cli, "i2c", CliCommandFlagDefault, cli_command_i2c, NULL);
}
}

View File

@ -2,4 +2,4 @@
#include "cli_i.h"
void cli_commands_init(Cli* cli);
void cli_commands_init(Cli* cli);

View File

@ -86,6 +86,7 @@ static void cli_vcp_deinit() {
}
static int32_t vcp_worker(void* context) {
UNUSED(context);
bool tx_idle = true;
size_t missed_rx = 0;
uint8_t last_tx_pkt_len = 0;
@ -148,7 +149,7 @@ static int32_t vcp_worker(void* context) {
if(len > 0) {
furi_check(
xStreamBufferSend(vcp->rx_stream, vcp->data_buffer, len, osWaitForever) ==
len);
(size_t)len);
}
} else {
#ifdef CLI_VCP_DEBUG
@ -275,16 +276,19 @@ static void cli_vcp_tx(const uint8_t* buffer, size_t size) {
}
static void cli_vcp_tx_stdout(void* _cookie, const char* data, size_t size) {
UNUSED(_cookie);
cli_vcp_tx((const uint8_t*)data, size);
}
static void vcp_state_callback(void* context, uint8_t state) {
UNUSED(context);
if(state == 0) {
osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtDisconnect);
}
}
static void vcp_on_cdc_control_line(void* context, uint8_t state) {
UNUSED(context);
// bit 0: DTR state, bit 1: RTS state
bool dtr = state & (1 << 0);
@ -296,11 +300,13 @@ static void vcp_on_cdc_control_line(void* context, uint8_t state) {
}
static void vcp_on_cdc_rx(void* context) {
UNUSED(context);
uint32_t ret = osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtRx);
furi_check((ret & osFlagsError) == 0);
}
static void vcp_on_cdc_tx_complete(void* context) {
UNUSED(context);
osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtTx);
}

View File

@ -164,6 +164,7 @@ void crypto_cli_decrypt(Cli* cli, string_t args) {
}
void crypto_cli_has_key(Cli* cli, string_t args) {
UNUSED(cli);
int key_slot = 0;
uint8_t iv[16];
@ -185,6 +186,7 @@ void crypto_cli_has_key(Cli* cli, string_t args) {
}
void crypto_cli_store_key(Cli* cli, string_t args) {
UNUSED(cli);
int key_slot = 0;
int key_size = 0;
string_t key_type;
@ -277,6 +279,7 @@ void crypto_cli_store_key(Cli* cli, string_t args) {
}
static void crypto_cli(Cli* cli, string_t args, void* context) {
UNUSED(context);
string_t cmd;
string_init(cmd);

View File

@ -27,6 +27,7 @@ static void blink_test_update(void* ctx) {
}
static void blink_test_draw_callback(Canvas* canvas, void* ctx) {
UNUSED(ctx);
canvas_clear(canvas);
canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 2, 10, "Blink application");
@ -41,6 +42,7 @@ static void blink_test_input_callback(InputEvent* input_event, void* ctx) {
}
int32_t blink_test_app(void* p) {
UNUSED(p);
osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(BlinkEvent), NULL);
// Configure view port

View File

@ -70,10 +70,12 @@ static void display_test_submenu_callback(void* context, uint32_t index) {
}
static uint32_t display_test_previous_callback(void* context) {
UNUSED(context);
return DisplayTestViewSubmenu;
}
static uint32_t display_test_exit_callback(void* context) {
UNUSED(context);
return VIEW_NONE;
}
@ -210,6 +212,7 @@ void display_test_free(DisplayTest* instance) {
}
int32_t display_test_run(DisplayTest* instance) {
UNUSED(instance);
view_dispatcher_switch_to_view(instance->view_dispatcher, DisplayTestViewSubmenu);
view_dispatcher_run(instance->view_dispatcher);
@ -217,6 +220,8 @@ int32_t display_test_run(DisplayTest* instance) {
}
int32_t display_test_app(void* p) {
UNUSED(p);
DisplayTest* instance = display_test_alloc();
int32_t ret = display_test_run(instance);

View File

@ -13,6 +13,7 @@ struct ViewDisplayTest {
};
static void view_display_test_draw_callback_intro(Canvas* canvas, void* _model) {
UNUSED(_model);
canvas_draw_str(canvas, 12, 24, "Use < and > to switch tests");
canvas_draw_str(canvas, 12, 36, "Use ^ and v to switch size");
canvas_draw_str(canvas, 32, 48, "Use (o) to flip");

View File

@ -60,6 +60,7 @@ static void keypad_test_input_callback(InputEvent* input_event, void* ctx) {
}
int32_t keypad_test_app(void* p) {
UNUSED(p);
osMessageQueueId_t event_queue = osMessageQueueNew(32, sizeof(InputEvent), NULL);
furi_check(event_queue);

View File

@ -70,6 +70,7 @@ static void text_box_test_input_callback(InputEvent* input_event, void* ctx) {
}
int32_t text_box_test_app(void* p) {
UNUSED(p);
osMessageQueueId_t event_queue = osMessageQueueNew(32, sizeof(InputEvent), NULL);
furi_check(event_queue);
@ -90,7 +91,7 @@ int32_t text_box_test_app(void* p) {
Gui* gui = furi_record_open("gui");
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
uint32_t test_renders_num = SIZEOF_ARRAY(text_box_test_render);
uint32_t test_renders_num = COUNT_OF(text_box_test_render);
InputEvent event;
while(osMessageQueueGet(event_queue, &event, NULL, osWaitForever) == osOK) {
TextBoxTestState* state = acquire_mutex_block(&state_mutex);

View File

@ -80,11 +80,13 @@ static void uart_echo_view_draw_callback(Canvas* canvas, void* _model) {
}
static bool uart_echo_view_input_callback(InputEvent* event, void* context) {
bool consumed = false;
return consumed;
UNUSED(event);
UNUSED(context);
return false;
}
static uint32_t uart_echo_exit(void* context) {
UNUSED(context);
return VIEW_NONE;
}
@ -170,7 +172,10 @@ static int32_t uart_echo_worker(void* context) {
notification_message(app->notification, &sequence_notification);
with_view_model(
app->view, (UartDumpModel * model) { return true; });
app->view, (UartDumpModel * model) {
UNUSED(model);
return true;
});
}
}
@ -261,6 +266,7 @@ static void uart_echo_app_free(UartEchoApp* app) {
}
int32_t uart_echo_app(void* p) {
UNUSED(p);
UartEchoApp* app = uart_echo_app_alloc();
view_dispatcher_run(app->view_dispatcher);
uart_echo_app_free(app);

View File

@ -18,6 +18,7 @@ typedef struct {
} UsbMouseEvent;
static void usb_mouse_render_callback(Canvas* canvas, void* ctx) {
UNUSED(ctx);
canvas_clear(canvas);
canvas_set_font(canvas, FontPrimary);
@ -37,6 +38,7 @@ static void usb_mouse_input_callback(InputEvent* input_event, void* ctx) {
}
int32_t usb_mouse_app(void* p) {
UNUSED(p);
osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(UsbMouseEvent), NULL);
furi_check(event_queue);
ViewPort* view_port = view_port_alloc();

View File

@ -51,6 +51,7 @@ void usb_test_submenu_callback(void* context, uint32_t index) {
}
uint32_t usb_test_exit(void* context) {
UNUSED(context);
return VIEW_NONE;
}
@ -113,6 +114,7 @@ void usb_test_app_free(UsbTestApp* app) {
}
int32_t usb_test_app(void* p) {
UNUSED(p);
UsbTestApp* app = usb_test_app_alloc();
view_dispatcher_run(app->view_dispatcher);

View File

@ -6,6 +6,7 @@
#include <notification/notification_messages.h>
void vibro_test_draw_callback(Canvas* canvas, void* ctx) {
UNUSED(ctx);
canvas_clear(canvas);
canvas_set_font(canvas, FontPrimary);
canvas_draw_str(canvas, 2, 10, "Vibro application");
@ -22,6 +23,7 @@ void vibro_test_input_callback(InputEvent* input_event, void* ctx) {
}
int32_t vibro_test_app(void* p) {
UNUSED(p);
osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(InputEvent), NULL);
// Configure view port

View File

@ -364,6 +364,7 @@ static bool animation_manager_is_valid_idle_animation(
static StorageAnimation*
animation_manager_select_idle_animation(AnimationManager* animation_manager) {
UNUSED(animation_manager);
StorageAnimationList_t animation_list;
StorageAnimationList_init(animation_list);
animation_storage_fill_animation_list(&animation_list);

View File

@ -130,7 +130,7 @@ void animation_storage_fill_animation_list(StorageAnimationList_t* animation_lis
flipper_format_free(file);
// add hard-coded animations
for(int i = 0; i < dolphin_internal_size; ++i) {
for(size_t i = 0; i < dolphin_internal_size; ++i) {
StorageAnimationList_push_back(*animation_list, (StorageAnimation*)&dolphin_internal[i]);
}
@ -142,7 +142,7 @@ StorageAnimation* animation_storage_find_animation(const char* name) {
furi_assert(strlen(name));
StorageAnimation* storage_animation = NULL;
for(int i = 0; i < dolphin_blocking_size; ++i) {
for(size_t i = 0; i < dolphin_blocking_size; ++i) {
if(!strcmp(dolphin_blocking[i].manifest_info.name, name)) {
storage_animation = (StorageAnimation*)&dolphin_blocking[i];
break;
@ -150,7 +150,7 @@ StorageAnimation* animation_storage_find_animation(const char* name) {
}
if(!storage_animation) {
for(int i = 0; i < dolphin_internal_size; ++i) {
for(size_t i = 0; i < dolphin_internal_size; ++i) {
if(!strcmp(dolphin_internal[i].manifest_info.name, name)) {
storage_animation = (StorageAnimation*)&dolphin_internal[i];
break;
@ -365,7 +365,7 @@ static bool animation_storage_load_bubbles(BubbleAnimation* animation, FlipperFo
animation->frame_bubble_sequences =
malloc(sizeof(FrameBubble*) * animation->frame_bubble_sequences_count);
uint32_t current_slot = 0;
int32_t current_slot = 0;
for(int i = 0; i < animation->frame_bubble_sequences_count; ++i) {
FURI_CONST_ASSIGN_PTR(
animation->frame_bubble_sequences[i], malloc(sizeof(FrameBubble)));
@ -374,7 +374,7 @@ static bool animation_storage_load_bubbles(BubbleAnimation* animation, FlipperFo
const FrameBubble* bubble = animation->frame_bubble_sequences[0];
int8_t index = -1;
for(;;) {
if(!flipper_format_read_uint32(ff, "Slot", &current_slot, 1)) break;
if(!flipper_format_read_int32(ff, "Slot", &current_slot, 1)) break;
if((current_slot != 0) && (index == -1)) break;
if(current_slot == index) {

View File

@ -33,6 +33,7 @@ static void desktop_loader_callback(const void* message, void* context) {
}
static void desktop_lock_icon_callback(Canvas* canvas, void* context) {
UNUSED(context);
furi_assert(canvas);
canvas_draw_icon(canvas, 0, 0, &I_Lock_8x8);
}
@ -298,6 +299,7 @@ static bool desktop_is_first_start() {
}
int32_t desktop_srv(void* p) {
UNUSED(p);
Desktop* desktop = desktop_alloc();
bool loaded = LOAD_DESKTOP_SETTINGS(&desktop->settings);

View File

@ -53,4 +53,5 @@ bool desktop_settings_scene_pin_disable_on_event(void* context, SceneManagerEven
}
void desktop_settings_scene_pin_disable_on_exit(void* context) {
UNUSED(context);
}

View File

@ -18,6 +18,7 @@ static void pin_error_back_callback(void* context) {
}
static void pin_error_done_callback(const PinCode* pin_code, void* context) {
UNUSED(pin_code);
furi_assert(context);
DesktopSettingsApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_EXIT);

View File

@ -41,4 +41,5 @@ bool desktop_settings_scene_pin_setup_howto_on_event(void* context, SceneManager
}
void desktop_settings_scene_pin_setup_howto_on_exit(void* context) {
UNUSED(context);
}

View File

@ -47,5 +47,6 @@ bool desktop_scene_fault_on_event(void* context, SceneManagerEvent event) {
}
void desktop_scene_fault_on_exit(void* context) {
UNUSED(context);
furi_hal_rtc_set_fault_data(0);
}

View File

@ -50,4 +50,5 @@ bool desktop_scene_first_start_on_event(void* context, SceneManagerEvent event)
}
void desktop_scene_first_start_on_exit(void* context) {
UNUSED(context);
}

View File

@ -81,4 +81,5 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
}
void desktop_scene_lock_menu_on_exit(void* context) {
UNUSED(context);
}

View File

@ -109,4 +109,5 @@ bool desktop_scene_locked_on_event(void* context, SceneManagerEvent event) {
}
void desktop_scene_locked_on_exit(void* context) {
UNUSED(context);
}

View File

@ -43,4 +43,5 @@ bool desktop_scene_pin_timeout_on_event(void* context, SceneManagerEvent event)
}
void desktop_scene_pin_timeout_on_exit(void* context) {
UNUSED(context);
}

View File

@ -51,6 +51,8 @@ static void desktop_view_pin_timeout_timer_callback(TimerHandle_t timer) {
}
static bool desktop_view_pin_timeout_input(InputEvent* event, void* context) {
UNUSED(event);
UNUSED(context);
return true;
}

View File

@ -11,6 +11,7 @@ static DialogsApp* dialogs_app_alloc() {
}
static void dialogs_app_process_message(DialogsApp* app, DialogsAppMessage* message) {
UNUSED(app);
switch(message->command) {
case DialogsAppCommandFileOpen:
message->return_data->bool_value =
@ -25,6 +26,7 @@ static void dialogs_app_process_message(DialogsApp* app, DialogsAppMessage* mess
}
int32_t dialogs_srv(void* p) {
UNUSED(p);
DialogsApp* app = dialogs_app_alloc();
furi_record_create("dialogs", app);

View File

@ -132,4 +132,4 @@ void dialog_message_show_storage_error(DialogsApp* context, const char* error_te
#ifdef __cplusplus
}
#endif
#endif

View File

@ -70,4 +70,4 @@ void dialog_message_show_storage_error(DialogsApp* context, const char* error_te
dialog_message_set_buttons(message, "Back", NULL, NULL);
dialog_message_show(context, message);
dialog_message_free(message);
}
}

View File

@ -12,4 +12,4 @@ struct DialogsApp {
#ifdef __cplusplus
}
#endif
#endif

View File

@ -43,4 +43,4 @@ typedef struct {
#ifdef __cplusplus
}
#endif
#endif

View File

@ -9,4 +9,4 @@ bool dialogs_app_process_module_file_select(const DialogsAppMessageDataFileSelec
#ifdef __cplusplus
}
#endif
#endif

View File

@ -9,4 +9,4 @@ DialogMessageButton dialogs_app_process_module_message(const DialogsAppMessageDa
#ifdef __cplusplus
}
#endif
#endif

View File

@ -95,4 +95,4 @@ void view_holder_update(View* view, void* context);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -118,6 +118,7 @@ void dolphin_event_send_wait(Dolphin* dolphin, DolphinEvent* event) {
}
void dolphin_event_release(Dolphin* dolphin, DolphinEvent* event) {
UNUSED(dolphin);
if(event->flag) {
osEventFlagsSet(event->flag, DOLPHIN_LOCK_EVENT_FLAG);
}
@ -149,6 +150,7 @@ static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin) {
}
int32_t dolphin_srv(void* p) {
UNUSED(p);
Dolphin* dolphin = dolphin_alloc();
furi_record_create("dolphin", dolphin);

View File

@ -12,7 +12,7 @@ typedef struct {
uint32_t flags;
uint32_t icounter;
uint32_t butthurt;
int32_t butthurt;
uint64_t timestamp;
} DolphinStoreData;

View File

@ -90,6 +90,7 @@ static void render_callback(Canvas* canvas, void* ctx) {
}
int32_t passport_app(void* p) {
UNUSED(p);
osSemaphoreId_t semaphore = osSemaphoreNew(1, 0, NULL);
furi_assert(semaphore);

View File

@ -95,6 +95,7 @@ void gpio_app_free(GpioApp* app) {
}
int32_t gpio_app(void* p) {
UNUSED(p);
GpioApp* gpio_app = gpio_app_alloc();
view_dispatcher_run(gpio_app->view_dispatcher);

View File

@ -19,9 +19,12 @@ void gpio_scene_test_on_enter(void* context) {
}
bool gpio_scene_test_on_event(void* context, SceneManagerEvent event) {
UNUSED(context);
UNUSED(event);
return false;
}
void gpio_scene_test_on_exit(void* context) {
UNUSED(context);
gpio_item_configure_all_pins(GpioModeAnalog);
}

View File

@ -28,12 +28,9 @@ static const uint32_t baudrate_list[] = {
};
bool gpio_scene_usb_uart_cfg_on_event(void* context, SceneManagerEvent event) {
//GpioApp* app = context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
}
return consumed;
UNUSED(context);
UNUSED(event);
return false;
}
static void line_vcp_cb(VariableItem* item) {

View File

@ -101,6 +101,7 @@ static void usb_uart_vcp_init(UsbUartBridge* usb_uart, uint8_t vcp_ch) {
}
static void usb_uart_vcp_deinit(UsbUartBridge* usb_uart, uint8_t vcp_ch) {
UNUSED(usb_uart);
furi_hal_cdc_set_callbacks(vcp_ch, NULL, NULL);
FURI_LOG_I("", "Deinit %d", vcp_ch);
if(vcp_ch != 0) {
@ -120,6 +121,7 @@ static void usb_uart_serial_init(UsbUartBridge* usb_uart, uint8_t uart_ch) {
}
static void usb_uart_serial_deinit(UsbUartBridge* usb_uart, uint8_t uart_ch) {
UNUSED(usb_uart);
furi_hal_uart_set_irq_cb(uart_ch, NULL, NULL);
if(uart_ch == FuriHalUartIdUSART1)
furi_hal_console_enable();
@ -143,7 +145,7 @@ static void usb_uart_set_baudrate(UsbUartBridge* usb_uart, uint32_t baudrate) {
static void usb_uart_update_ctrl_lines(UsbUartBridge* usb_uart) {
if(usb_uart->cfg.flow_pins != 0) {
furi_assert((usb_uart->cfg.flow_pins - 1) < (sizeof(flow_pins) / sizeof(flow_pins[0])));
furi_assert((size_t)(usb_uart->cfg.flow_pins - 1) < COUNT_OF(flow_pins));
uint8_t state = furi_hal_cdc_get_ctrl_line_state(usb_uart->cfg.vcp_ch);
furi_hal_gpio_write(flow_pins[usb_uart->cfg.flow_pins - 1][0], !(state & USB_CDC_BIT_RTS));
@ -171,7 +173,7 @@ static int32_t usb_uart_worker(void* context) {
usb_uart_serial_init(usb_uart, usb_uart->cfg.uart_ch);
usb_uart_set_baudrate(usb_uart, usb_uart->cfg.baudrate);
if(usb_uart->cfg.flow_pins != 0) {
furi_assert((usb_uart->cfg.flow_pins - 1) < (sizeof(flow_pins) / sizeof(flow_pins[0])));
furi_assert((size_t)(usb_uart->cfg.flow_pins - 1) < COUNT_OF(flow_pins));
furi_hal_gpio_init_simple(
flow_pins[usb_uart->cfg.flow_pins - 1][0], GpioModeOutputPushPull);
furi_hal_gpio_init_simple(
@ -238,9 +240,7 @@ static int32_t usb_uart_worker(void* context) {
flow_pins[usb_uart->cfg.flow_pins - 1][1], GpioModeAnalog);
}
if(usb_uart->cfg_new.flow_pins != 0) {
furi_assert(
(usb_uart->cfg_new.flow_pins - 1) <
(sizeof(flow_pins) / sizeof(flow_pins[0])));
furi_assert((size_t)(usb_uart->cfg_new.flow_pins - 1) < COUNT_OF(flow_pins));
furi_hal_gpio_init_simple(
flow_pins[usb_uart->cfg_new.flow_pins - 1][0], GpioModeOutputPushPull);
furi_hal_gpio_init_simple(
@ -318,14 +318,18 @@ static void vcp_on_cdc_rx(void* context) {
}
static void vcp_state_callback(void* context, uint8_t state) {
UNUSED(context);
UNUSED(state);
}
static void vcp_on_cdc_control_line(void* context, uint8_t state) {
UNUSED(state);
UsbUartBridge* usb_uart = (UsbUartBridge*)context;
osThreadFlagsSet(furi_thread_get_thread_id(usb_uart->thread), WorkerEvtCtrlLineSet);
}
static void vcp_on_line_config(void* context, struct usb_cdc_line_coding* config) {
UNUSED(config);
UsbUartBridge* usb_uart = (UsbUartBridge*)context;
osThreadFlagsSet(furi_thread_get_thread_id(usb_uart->thread), WorkerEvtLineCfgSet);
}

View File

@ -123,6 +123,7 @@ void gpio_test_set_ok_callback(GpioTest* gpio_test, GpioTestOkCallback callback,
furi_assert(callback);
with_view_model(
gpio_test->view, (GpioTestModel * model) {
UNUSED(model);
gpio_test->callback = callback;
gpio_test->context = context;
return false;

View File

@ -130,6 +130,7 @@ void gpio_usb_uart_set_callback(GpioUsbUart* usb_uart, GpioUsbUartCallback callb
with_view_model(
usb_uart->view, (GpioUsbUartModel * model) {
UNUSED(model);
usb_uart->callback = callback;
usb_uart->context = context;
return false;

View File

@ -469,6 +469,7 @@ Gui* gui_alloc() {
}
int32_t gui_srv(void* p) {
UNUSED(p);
Gui* gui = gui_alloc();
furi_record_create("gui", gui);

View File

@ -10,4 +10,4 @@ uint8_t icon_get_height(const Icon* instance) {
const uint8_t* icon_get_data(const Icon* instance) {
return instance->frames[0];
}
}

View File

@ -39,4 +39,4 @@ const uint8_t* icon_get_data(const Icon* instance);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -331,7 +331,7 @@ void button_menu_set_selected_item(ButtonMenu* button_menu, uint32_t index) {
ButtonMenuItemArray_it_t it;
for(ButtonMenuItemArray_it(it, model->items); !ButtonMenuItemArray_end_p(it);
ButtonMenuItemArray_next(it), ++item_position) {
if(ButtonMenuItemArray_cref(it)->index == index) {
if((uint32_t)ButtonMenuItemArray_cref(it)->index == index) {
model->position = item_position;
break;
}

View File

@ -215,8 +215,8 @@ static void button_panel_view_draw_callback(Canvas* canvas, void* _model) {
static void button_panel_process_down(ButtonPanel* button_panel) {
with_view_model(
button_panel->view, (ButtonPanelModel * model) {
size_t new_selected_item_x = model->selected_item_x;
size_t new_selected_item_y = model->selected_item_y;
uint16_t new_selected_item_x = model->selected_item_x;
uint16_t new_selected_item_y = model->selected_item_y;
size_t i;
if(new_selected_item_y >= (model->reserve_y - 1)) return false;
@ -291,8 +291,8 @@ static void button_panel_process_left(ButtonPanel* button_panel) {
static void button_panel_process_right(ButtonPanel* button_panel) {
with_view_model(
button_panel->view, (ButtonPanelModel * model) {
size_t new_selected_item_x = model->selected_item_x;
size_t new_selected_item_y = model->selected_item_y;
uint16_t new_selected_item_x = model->selected_item_x;
uint16_t new_selected_item_y = model->selected_item_y;
size_t i;
if(new_selected_item_x >= (model->reserve_x - 1)) return false;

View File

@ -66,4 +66,4 @@ void byte_input_set_header_text(ByteInput* byte_input, const char* text);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -6,10 +6,13 @@ struct EmptyScreen {
};
static void empty_screen_view_draw_callback(Canvas* canvas, void* _model) {
UNUSED(_model);
canvas_clear(canvas);
}
static bool empty_screen_view_input_callback(InputEvent* event, void* context) {
UNUSED(event);
UNUSED(context);
return false;
}

View File

@ -38,4 +38,4 @@ View* empty_screen_get_view(EmptyScreen* empty_screen);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -28,4 +28,4 @@ void file_select_set_selected_file(FileSelect* file_select, const char* filename
#ifdef __cplusplus
}
#endif
#endif

View File

@ -34,6 +34,7 @@ static void loading_draw_callback(Canvas* canvas, void* _model) {
}
static bool loading_input_callback(InputEvent* event, void* context) {
UNUSED(event);
furi_assert(context);
return true;
}

View File

@ -87,7 +87,7 @@ static void text_box_insert_endline(Canvas* canvas, TextBoxModel* model) {
model->scroll_num = line_num - 4;
model->scroll_pos = line_num - 5;
} else {
model->scroll_num = MAX(line_num - 4, 0);
model->scroll_num = MAX(line_num - 4, 0u);
model->scroll_pos = 0;
}
}

View File

@ -122,15 +122,15 @@ static const TextInputKey* get_row(uint8_t row_index) {
return row;
}
static const char get_selected_char(TextInputModel* model) {
static char get_selected_char(TextInputModel* model) {
return get_row(model->selected_row)[model->selected_column].text;
}
static const bool char_is_lowercase(char letter) {
static bool char_is_lowercase(char letter) {
return (letter >= 0x61 && letter <= 0x7A);
}
static const char char_to_uppercase(const char letter) {
static char char_to_uppercase(const char letter) {
if(isalpha(letter)) {
return (letter - 0x20);
} else {
@ -260,6 +260,7 @@ static void text_input_view_draw_callback(Canvas* canvas, void* _model) {
}
static void text_input_handle_up(TextInput* text_input, TextInputModel* model) {
UNUSED(text_input);
if(model->selected_row > 0) {
model->selected_row--;
if(model->selected_column > get_row_size(model->selected_row) - 6) {
@ -269,6 +270,7 @@ static void text_input_handle_up(TextInput* text_input, TextInputModel* model) {
}
static void text_input_handle_down(TextInput* text_input, TextInputModel* model) {
UNUSED(text_input);
if(model->selected_row < keyboard_row_count - 1) {
model->selected_row++;
if(model->selected_column > get_row_size(model->selected_row) - 4) {
@ -278,6 +280,7 @@ static void text_input_handle_down(TextInput* text_input, TextInputModel* model)
}
static void text_input_handle_left(TextInput* text_input, TextInputModel* model) {
UNUSED(text_input);
if(model->selected_column > 0) {
model->selected_column--;
} else {
@ -286,6 +289,7 @@ static void text_input_handle_left(TextInput* text_input, TextInputModel* model)
}
static void text_input_handle_right(TextInput* text_input, TextInputModel* model) {
UNUSED(text_input);
if(model->selected_column < get_row_size(model->selected_row) - 1) {
model->selected_column++;
} else {

View File

@ -19,4 +19,4 @@ bool validator_is_file_callback(const char* text, string_t error, void* context)
#ifdef __cplusplus
}
#endif
#endif

View File

@ -364,6 +364,7 @@ void variable_item_list_set_enter_callback(
furi_assert(callback);
with_view_model(
variable_item_list->view, (VariableItemListModel * model) {
UNUSED(model);
variable_item_list->callback = callback;
variable_item_list->context = context;
return false;

View File

@ -126,6 +126,7 @@ void view_commit_model(View* view, bool update) {
}
void view_icon_animation_callback(IconAnimation* instance, void* context) {
UNUSED(instance);
furi_assert(context);
View* view = context;
if(view->update_callback) {

View File

@ -7,4 +7,4 @@ extern "C" int32_t ibutton_app(void* p) {
delete app;
return 255;
}
}

View File

@ -141,4 +141,4 @@ private:
bool load_key_data(string_t key_path);
void make_app_folder();
};
};

View File

@ -240,6 +240,7 @@ void ibutton_cli_emulate(Cli* cli, string_t args) {
};
static void ibutton_cli(Cli* cli, string_t args, void* context) {
UNUSED(context);
string_t cmd;
string_init(cmd);
@ -268,6 +269,7 @@ void onewire_cli_print_usage() {
};
static void onewire_cli_search(Cli* cli) {
UNUSED(cli);
OneWireHost* onewire = onewire_host_alloc();
uint8_t address[8];
bool done = false;
@ -297,6 +299,7 @@ static void onewire_cli_search(Cli* cli) {
}
void onewire_cli(Cli* cli, string_t args, void* context) {
UNUSED(context);
string_t cmd;
string_init(cmd);
@ -311,4 +314,4 @@ void onewire_cli(Cli* cli, string_t args, void* context) {
}
string_clear(cmd);
}
}

View File

@ -24,6 +24,7 @@ public:
// payload
union {
uint32_t dummy;
uint32_t menu_index;
DialogExResult dialog_result;
GuiButtonType widget_button_result;

View File

@ -129,7 +129,7 @@ void iButtonAppViewManager::send_event(iButtonEvent* event) {
furi_check(result == osOK);
}
uint32_t iButtonAppViewManager::previous_view_callback(void* context) {
uint32_t iButtonAppViewManager::previous_view_callback(void*) {
if(event_queue != NULL) {
iButtonEvent event;
event.type = iButtonEvent::Type::EventTypeBack;
@ -137,4 +137,4 @@ uint32_t iButtonAppViewManager::previous_view_callback(void* context) {
}
return VIEW_IGNORE;
}
}

View File

@ -48,4 +48,4 @@ private:
Gui* gui;
uint32_t previous_view_callback(void* context);
};
};

View File

@ -9,4 +9,4 @@ public:
private:
uint32_t submenu_item_selected = 0;
};
};

View File

@ -50,4 +50,4 @@ void iButtonSceneAddValue::on_exit(iButtonApp* app) {
byte_input_set_result_callback(byte_input, NULL, NULL, NULL, NULL, 0);
byte_input_set_header_text(byte_input, {0});
}
}

View File

@ -10,4 +10,4 @@ public:
private:
uint8_t new_key_data[IBUTTON_KEY_DATA_SIZE] = {};
};
};

View File

@ -6,4 +6,4 @@ public:
void on_enter(iButtonApp* app) final;
bool on_event(iButtonApp* app, iButtonEvent* event) final;
void on_exit(iButtonApp* app) final;
};
};

View File

@ -44,4 +44,4 @@ void iButtonSceneDeleteSuccess::on_exit(iButtonApp* app) {
popup_disable_timeout(popup);
popup_set_context(popup, NULL);
popup_set_callback(popup, NULL);
}
}

View File

@ -6,4 +6,4 @@ public:
void on_enter(iButtonApp* app) final;
bool on_event(iButtonApp* app, iButtonEvent* event) final;
void on_exit(iButtonApp* app) final;
};
};

View File

@ -6,7 +6,10 @@ static void emulate_callback(void* context, bool emulated) {
furi_assert(context);
if(emulated) {
iButtonApp* app = static_cast<iButtonApp*>(context);
iButtonEvent event = {.type = iButtonEvent::Type::EventTypeWorkerEmulated};
iButtonEvent event = {
.payload = {.worker_write_result = iButtonWorkerWriteOK},
.type = iButtonEvent::Type::EventTypeWorkerEmulated,
};
app->get_view_manager()->send_event(&event);
}
}

View File

@ -6,4 +6,4 @@ public:
void on_enter(iButtonApp* app) final;
bool on_event(iButtonApp* app, iButtonEvent* event) final;
void on_exit(iButtonApp* app) final;
};
};

Some files were not shown because too many files have changed in this diff Show More