mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 12:51:22 +04: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:
@@ -86,9 +86,9 @@ SignalReader* signal_reader_alloc(const GpioPin* gpio_pin, uint32_t size) {
|
||||
}
|
||||
|
||||
void signal_reader_free(SignalReader* instance) {
|
||||
furi_assert(instance);
|
||||
furi_assert(instance->gpio_buffer);
|
||||
furi_assert(instance->bitstream_buffer);
|
||||
furi_check(instance);
|
||||
furi_check(instance->gpio_buffer);
|
||||
furi_check(instance->bitstream_buffer);
|
||||
|
||||
free(instance->gpio_buffer);
|
||||
free(instance->bitstream_buffer);
|
||||
@@ -96,13 +96,13 @@ void signal_reader_free(SignalReader* instance) {
|
||||
}
|
||||
|
||||
void signal_reader_set_pull(SignalReader* instance, GpioPull pull) {
|
||||
furi_assert(instance);
|
||||
furi_check(instance);
|
||||
|
||||
instance->pull = pull;
|
||||
}
|
||||
|
||||
void signal_reader_set_polarity(SignalReader* instance, SignalReaderPolarity polarity) {
|
||||
furi_assert(instance);
|
||||
furi_check(instance);
|
||||
|
||||
instance->polarity = polarity;
|
||||
}
|
||||
@@ -111,14 +111,14 @@ void signal_reader_set_sample_rate(
|
||||
SignalReader* instance,
|
||||
SignalReaderTimeUnit time_unit,
|
||||
uint32_t time) {
|
||||
furi_assert(instance);
|
||||
furi_check(instance);
|
||||
UNUSED(time_unit);
|
||||
|
||||
instance->tim_arr = time;
|
||||
}
|
||||
|
||||
void signal_reader_set_trigger(SignalReader* instance, SignalReaderTrigger trigger) {
|
||||
furi_assert(instance);
|
||||
furi_check(instance);
|
||||
|
||||
instance->trigger = trigger;
|
||||
}
|
||||
@@ -186,8 +186,8 @@ static void furi_hal_sw_digital_pin_dma_rx_isr(void* context) {
|
||||
}
|
||||
|
||||
void signal_reader_start(SignalReader* instance, SignalReaderCallback callback, void* context) {
|
||||
furi_assert(instance);
|
||||
furi_assert(callback);
|
||||
furi_check(instance);
|
||||
furi_check(callback);
|
||||
|
||||
instance->callback = callback;
|
||||
instance->context = context;
|
||||
@@ -306,7 +306,7 @@ void signal_reader_start(SignalReader* instance, SignalReaderCallback callback,
|
||||
}
|
||||
|
||||
void signal_reader_stop(SignalReader* instance) {
|
||||
furi_assert(instance);
|
||||
furi_check(instance);
|
||||
|
||||
furi_hal_interrupt_set_isr(SIGNAL_READER_DMA_GPIO_IRQ, NULL, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user