Appstart and applist from serial (#1736)

* Start app, and list fixed ones.
* Add ext app support
This commit is contained in:
Totoo 2024-01-07 18:56:09 +01:00 committed by GitHub
parent 4b93e78dd9
commit 9d7e06c255
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 304 additions and 10 deletions

View file

@ -40,7 +40,7 @@
#include "diskio.h"
#include "lfsr_random.hpp"
#include "sd_card.hpp"
#include "external_app.hpp"
#include <vector>
#include <utility>
@ -57,6 +57,12 @@ enum modal_t {
ABORT
};
struct AppInfoConsole {
const char* appCallName;
const char* appFriendlyName;
const app_location_t appLocation;
};
class NavigationView : public View {
public:
std::function<void(const View&)> on_view_changed{};
@ -99,6 +105,8 @@ class NavigationView : public View {
* Returns true if the handler was bound successfully. */
bool set_on_pop(std::function<void()> on_pop);
static std::vector<AppInfoConsole> fixedAppListFC; // fixed app list for console. vector, so can be incomplete and still iterateable
bool StartAppByName(const char* name); // Starts a View (app) by name stored in fixedAppListFC. This is to start apps from console
private:
struct ViewState {
std::unique_ptr<View> view;
@ -321,6 +329,8 @@ class SystemView : public View {
void toggle_overlay();
void paint_overlay();
NavigationView* get_navigation_view();
private:
uint8_t overlay_active{0};