mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 01:08:36 -07:00
Api Symbols: replace asserts with checks (#3507)
* Api Symbols: replace asserts with checks * Api Symbols: replace asserts with checks part 2 * Update no args function signatures with void, to help compiler to track incorrect usage * More unavoidable void * Update PVS config and code to make it happy * Format sources * nfc: fix checks * dead code cleanup & include fixes Co-authored-by: gornekich <n.gorbadey@gmail.com> Co-authored-by: hedger <hedger@users.noreply.github.com> Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
@@ -133,7 +133,7 @@ static void bt_battery_level_changed_callback(const void* _event, void* context)
|
||||
}
|
||||
}
|
||||
|
||||
Bt* bt_alloc() {
|
||||
Bt* bt_alloc(void) {
|
||||
Bt* bt = malloc(sizeof(Bt));
|
||||
// Init default maximum packet size
|
||||
bt->max_packet_size = BLE_PROFILE_SERIAL_PACKET_SIZE_MAX;
|
||||
|
||||
@@ -5,7 +5,7 @@ FuriHalBleProfileBase* bt_profile_start(
|
||||
Bt* bt,
|
||||
const FuriHalBleProfileTemplate* profile_template,
|
||||
FuriHalBleProfileParams params) {
|
||||
furi_assert(bt);
|
||||
furi_check(bt);
|
||||
|
||||
// Send message
|
||||
FuriHalBleProfileBase* profile_instance = NULL;
|
||||
@@ -32,7 +32,7 @@ bool bt_profile_restore_default(Bt* bt) {
|
||||
}
|
||||
|
||||
void bt_disconnect(Bt* bt) {
|
||||
furi_assert(bt);
|
||||
furi_check(bt);
|
||||
|
||||
// Send message
|
||||
BtMessage message = {.lock = api_lock_alloc_locked(), .type = BtMessageTypeDisconnect};
|
||||
@@ -43,23 +43,23 @@ void bt_disconnect(Bt* bt) {
|
||||
}
|
||||
|
||||
void bt_set_status_changed_callback(Bt* bt, BtStatusChangedCallback callback, void* context) {
|
||||
furi_assert(bt);
|
||||
furi_check(bt);
|
||||
|
||||
bt->status_changed_cb = callback;
|
||||
bt->status_changed_ctx = context;
|
||||
}
|
||||
|
||||
void bt_forget_bonded_devices(Bt* bt) {
|
||||
furi_assert(bt);
|
||||
furi_check(bt);
|
||||
BtMessage message = {.type = BtMessageTypeForgetBondedDevices};
|
||||
furi_check(
|
||||
furi_message_queue_put(bt->message_queue, &message, FuriWaitForever) == FuriStatusOk);
|
||||
}
|
||||
|
||||
void bt_keys_storage_set_storage_path(Bt* bt, const char* keys_storage_path) {
|
||||
furi_assert(bt);
|
||||
furi_assert(bt->keys_storage);
|
||||
furi_assert(keys_storage_path);
|
||||
furi_check(bt);
|
||||
furi_check(bt->keys_storage);
|
||||
furi_check(keys_storage_path);
|
||||
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
FuriString* path = furi_string_alloc_set(keys_storage_path);
|
||||
@@ -72,8 +72,8 @@ void bt_keys_storage_set_storage_path(Bt* bt, const char* keys_storage_path) {
|
||||
}
|
||||
|
||||
void bt_keys_storage_set_default_path(Bt* bt) {
|
||||
furi_assert(bt);
|
||||
furi_assert(bt->keys_storage);
|
||||
furi_check(bt);
|
||||
furi_check(bt->keys_storage);
|
||||
|
||||
bt_keys_storage_set_file_path(bt->keys_storage, BT_KEYS_STORAGE_PATH);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user