8 #include <IInputDevice.h>
9 #include <IUniversalInputCallback.h>
10 #include <UniversalInputTypes.h>
17 #define MAX_NUM_APPS 16
19 #define BACKLIGHT_STATE_FULL 2
20 #define BACKLIGHT_STATE_DIM 1
21 #define BACKLIGHT_STATE_OFF 0
43 uint8_t
appIdx(
char *name);
64 return m_apps[m_activeAppIdx];
74 void updateBacklightOutput();
80 uint8_t m_activeAppIdx;
85 uint8_t m_backlightStatus;
86 uint32_t m_lastBacklightFeedTime;
void handleUniversalInputEvent(inputtype_t type, IInputDevice *device)
Handles a state change of an input device.
Definition: AppManager.cpp:213
App * activeApp()
Gets the active application.
Definition: AppManager.h:62
uint8_t addApp(App *app)
Adds an application to the manager.
Definition: AppManager.cpp:52
#define MAX_NUM_APPS
Maximum number of apps that can be registered with the manager.
Definition: AppManager.h:17
Used to manage several applications on the badge.
Definition: AppManager.h:30
App * app(uint8_t idx)
Gets an application given it's index.
Definition: AppManager.h:51
AppManager(Dilbert *badge)
Creates a new application manager.
Definition: AppManager.cpp:12
void run()
Runs the loop of the active application.
Definition: AppManager.cpp:168
Dilbert badge
Badge driver.
Definition: main.cpp:35
Main hardware abstraction class.
Definition: Dilbert.h:17
bool activateAppByName(char *name)
Activates an application given it's name.
Definition: AppManager.cpp:73
void begin()
Initialises the application manager.
Definition: AppManager.cpp:29
size_t numApps() const
Gets the number of applications in the manager.
Definition: AppManager.cpp:136
bool activateAppByIdx(uint8_t idx)
Activates an application given it's index.
Definition: AppManager.cpp:84
uint8_t appIdx(char *name)
Gets the index of an app given it's name.
Definition: AppManager.cpp:105
Used to encapsulate an individual application.
Definition: App.h:15
void feedBacklight(uint8_t status=BACKLIGHT_STATE_FULL)
Ensures that the backlight stays on, otherwise it is susceptible to the timeouts set in SystemConfigD...
Definition: AppManager.cpp:152