mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 18:18:35 -07:00
Api Symbols: replace asserts with checks
merge ofw commit
This commit is contained in:
@@ -114,7 +114,7 @@ BleServiceBattery* ble_svc_battery_start(bool auto_update) {
|
||||
}
|
||||
|
||||
void ble_svc_battery_stop(BleServiceBattery* battery_svc) {
|
||||
furi_assert(battery_svc);
|
||||
furi_check(battery_svc);
|
||||
if(battery_svc->auto_update) {
|
||||
BatterySvcInstanceList_it_t it;
|
||||
for(BatterySvcInstanceList_it(it, instances); !BatterySvcInstanceList_end_p(it);
|
||||
|
||||
@@ -137,7 +137,7 @@ BleServiceDevInfo* ble_svc_dev_info_start(void) {
|
||||
}
|
||||
|
||||
void ble_svc_dev_info_stop(BleServiceDevInfo* dev_info_svc) {
|
||||
furi_assert(dev_info_svc);
|
||||
furi_check(dev_info_svc);
|
||||
/* Delete service characteristics */
|
||||
for(size_t i = 0; i < DevInfoSvcGattCharacteristicCount; i++) {
|
||||
ble_gatt_characteristic_delete(
|
||||
|
||||
@@ -179,7 +179,7 @@ void ble_svc_serial_set_callbacks(
|
||||
uint16_t buff_size,
|
||||
SerialServiceEventCallback callback,
|
||||
void* context) {
|
||||
furi_assert(serial_svc);
|
||||
furi_check(serial_svc);
|
||||
serial_svc->callback = callback;
|
||||
serial_svc->context = context;
|
||||
serial_svc->buff_size = buff_size;
|
||||
@@ -193,8 +193,8 @@ void ble_svc_serial_set_callbacks(
|
||||
}
|
||||
|
||||
void ble_svc_serial_notify_buffer_is_empty(BleServiceSerial* serial_svc) {
|
||||
furi_assert(serial_svc);
|
||||
furi_assert(serial_svc->buff_size_mtx);
|
||||
furi_check(serial_svc);
|
||||
furi_check(serial_svc->buff_size_mtx);
|
||||
|
||||
furi_check(furi_mutex_acquire(serial_svc->buff_size_mtx, FuriWaitForever) == FuriStatusOk);
|
||||
if(serial_svc->bytes_ready_to_receive == 0) {
|
||||
@@ -253,7 +253,7 @@ bool ble_svc_serial_update_tx(BleServiceSerial* serial_svc, uint8_t* data, uint1
|
||||
}
|
||||
|
||||
void ble_svc_serial_set_rpc_active(BleServiceSerial* serial_svc, bool active) {
|
||||
furi_assert(serial_svc);
|
||||
furi_check(serial_svc);
|
||||
ble_svc_serial_update_rpc_char(
|
||||
serial_svc, active ? SerialServiceRpcStatusActive : SerialServiceRpcStatusNotActive);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user