1+ /*
2+ * Arduios
3+ * by John´s Project
4+ *
5+ * Arduios is like a operating system for the arduino,
6+ * it enables you to use a sketch in different use cases,
7+ * without having to upload a new one every time.
8+ *
9+ * You can easily write an app by including "kernel.h",
10+ * extending and implementing the methods of the App class
11+ * and registering it in the apps array here.
12+ * (App class is in "kernel.h")
13+ *
14+ * If you need docs just take a look into the '.h' files.
15+ * ----------------------------------------------------------
16+ * https://github.com/JohnsProject/Arduios
17+ * ----------------------------------------------------------
18+ *
19+ * This is the bootloader of the Arduios, it loads the kernel
20+ * and is the place where your apps should be registered.
21+ */
122#ifndef __KERNEL_H_INCLUDED__
223#define __KERNEL_H_INCLUDED__
324
@@ -21,17 +42,18 @@ class App {
2142extern struct Kernel {
2243
2344 struct Registry {
24- App **apps ;
25- uint8_t appsCount ;
45+ const static uint8_t MAX_APPS = 10 ;
46+ const App *apps[MAX_APPS] ;
2647 uint8_t currentApp;
2748 } registry;
2849
50+ void addApp (App &app);
2951 // method used to load an app from the registry by its index
3052 void loadApp (uint8_t app_index);
3153 // method used to load an app from the registry by its name
3254 void loadApp (String app_name);
3355 // method called by the bootloader once when the kernel is loaded
34- void setup (App *apps[], uint8_t appsCount );
56+ void setup ();
3557 // method constantly called by the bootloader
3658 void loop ();
3759} kernel;
0 commit comments