[FL-872] Furi, API-HAL, App-Loader cleanup and improvements (#334)
* Furi: replace obsolete furiac_exit with osThreadExit, drop obsolete apis and test. Rename systemd to flipper and move to separate file, cleanup. ApiHal: Rename timebase to os and move freertos hooks there, move insomnia api to power module. * Furi: new thread helper * Furi: cleanup thread documentation * Flipper, AppLoader: update to use FuriThread. Update tasks signatures to match FuriThreadCallback signature. * F4: rename API_HAL_TIMEBASE_DEBUG to API_HAL_OS_DEBUG * Applications: rename FuriApplication to FlipperApplication, use FuriThreadCallback signature for apps. * C++ app template sample, new exit method
This commit is contained in:
@@ -23,7 +23,7 @@ void AppiButton::run() {
|
||||
gpio_init(red_led_record, GpioModeOutputOpenDrain);
|
||||
gpio_init(green_led_record, GpioModeOutputOpenDrain);
|
||||
|
||||
api_hal_timebase_insomnia_enter();
|
||||
api_hal_power_insomnia_enter();
|
||||
app_ready();
|
||||
|
||||
AppiButtonEvent event;
|
||||
@@ -35,9 +35,9 @@ void AppiButton::run() {
|
||||
event.value.input.key == InputKeyBack) {
|
||||
view_port_enabled_set(view_port, false);
|
||||
gui_remove_view_port(gui, view_port);
|
||||
api_hal_timebase_insomnia_exit();
|
||||
api_hal_power_insomnia_exit();
|
||||
|
||||
osThreadExit();
|
||||
return;
|
||||
}
|
||||
|
||||
if(event.value.input.type == InputTypeShort &&
|
||||
@@ -174,7 +174,8 @@ void AppiButton::switch_to_mode(uint8_t mode_index) {
|
||||
}
|
||||
|
||||
// app enter function
|
||||
extern "C" void app_ibutton(void* p) {
|
||||
extern "C" int32_t app_ibutton(void* p) {
|
||||
AppiButton* app = new AppiButton();
|
||||
app->run();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user