furi_check - a new way to asserting (#204)

* hal-related task_is_isr_context function
* furi_check implementation
* change application to use furi_check
* add second level of assertion
* add TODO about ISR context
* Applications: refactor furi_check and furi_assert.
* Apploader: propwer widget usage. Menu: check on furi resource request.
* refactor furi_check

Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
Co-authored-by: coreglitch <mail@s3f.ru>
This commit is contained in:
DrZlo13
2020-10-29 09:27:17 +03:00
committed by GitHub
parent c9b921f6ce
commit 8aeafd8179
24 changed files with 292 additions and 136 deletions

View File

@@ -1,6 +1,5 @@
#include "irukagotchi.h"
#include <assert.h>
#include <flipper_v2.h>
#include <gui/gui.h>
@@ -46,7 +45,7 @@ Irukagotchi* irukagotchi_alloc() {
widget_input_callback_set(irukagotchi->widget, irukagotchi_input_callback, irukagotchi);
irukagotchi->menu_vm = furi_open("menu");
assert(irukagotchi->menu_vm);
furi_check(irukagotchi->menu_vm);
return irukagotchi;
}
@@ -55,9 +54,9 @@ void irukagotchi_task() {
Irukagotchi* irukagotchi = irukagotchi_alloc();
FuriRecordSubscriber* gui_record = furi_open_deprecated("gui", false, false, NULL, NULL, NULL);
assert(gui_record);
furi_check(gui_record);
GuiApi* gui = furi_take(gui_record);
assert(gui);
furi_check(gui);
gui->add_widget(gui, irukagotchi->widget, GuiLayerNone);
furi_commit(gui_record);