Simplify app registration with TactilityCpp (#7)
- Simplified app registration with a C++ wrapper for the TactilityC. - Rename the various app classes from `Application` to more specific names like `Calculator` etc.
This commit is contained in:
committed by
GitHub
parent
e1579d3cbd
commit
b39bd6b6f5
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <TactilityCpp/App.h>
|
||||
|
||||
#include <tt_app.h>
|
||||
#include <tt_mutex.h>
|
||||
#include <tt_timer.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <vector>
|
||||
|
||||
class Gpio final : public App {
|
||||
|
||||
std::vector<lv_obj_t*> pinWidgets;
|
||||
std::vector<bool> pinStates;
|
||||
TimerHandle timer;
|
||||
MutexHandle mutex;
|
||||
|
||||
static lv_obj_t* createGpioRowWrapper(lv_obj_t* parent);
|
||||
static void onTimer(void* parameter);
|
||||
|
||||
public:
|
||||
|
||||
void onCreate(AppHandle app) override;
|
||||
void onDestroy(AppHandle app) override;
|
||||
void onShow(AppHandle context, lv_obj_t* parent) override;
|
||||
void onHide(AppHandle context) override;
|
||||
|
||||
void startTask();
|
||||
void stopTask();
|
||||
|
||||
void updatePinStates();
|
||||
void updatePinWidgets();
|
||||
};
|
||||
Reference in New Issue
Block a user