flipperzero-firmware/core/app.cpp
coreglitch 1759787334
Furi (#24)
* furiac start and thread create implementation"

* create and kill task

* rename debug, add header

* remove write.c

* kill itself

* furi exit/switch

* success switch and exit

* WIP furi records

* add furi record interface

* rename furi app control file

* record implementation in progress

* wip furi implementation

* add automatic tests for FURI AC

* differ build tests

* small changes

* FURI record tests description

* change furi statuses

* FURI record test blank

* exit after all application ends

* delay: print then wait

* fix FURI implementatnion building

* pipe record test

* concurrent access

* uncomplete mute-test

* update FURI documentation
2020-08-24 18:31:22 +03:00

29 lines
775 B
C++

#include "flipper.h"
#include <stdio.h>
extern "C" {
#include "startup.h"
#include "furi.h"
#include "debug.h"
}
extern "C" void app() {
// FURI startup
FuriApp* handlers[sizeof(FLIPPER_STARTUP)/sizeof(FLIPPER_STARTUP[0])];
for(size_t i = 0; i < sizeof(FLIPPER_STARTUP)/sizeof(FLIPPER_STARTUP[0]); i++) {
handlers[i] = furiac_start(FLIPPER_STARTUP[i].app, FLIPPER_STARTUP[i].name, NULL);
}
bool is_alive = false;
do {
is_alive = false;
for(size_t i = 0; i < sizeof(FLIPPER_STARTUP)/sizeof(FLIPPER_STARTUP[0]); i++) {
if(handlers[i]->handler != NULL) {
is_alive = true;
}
}
delay(500);
// TODO add deferred event queue here
} while(is_alive);
}