dbf850c434
- M5 Unit Modules library + M5 Unit Test app - Minor fixes for TodoList, TwoEleven, Snake, Brainfuck and Breakout - Fixed SerialConsole to use the uart controller as it was broken in one of the many updates - Fixed keyboard input in TwoEleven, Breakout, Magic8Ball and Snake - Bluetooth Media Keys app, supports pressing physical keys to trigger the corresponding buttonmatrix button - Epub Reader app
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#pragma once
|
|
#include "TestViewBase.h"
|
|
#include <UnitDualButton.h>
|
|
#include <tactility/drivers/gpio_controller.h>
|
|
|
|
class TestUnitDualButton final : public TestViewBase {
|
|
public:
|
|
void onStart(lv_obj_t* parent, AppHandle handle, M5UnitTest* app) override;
|
|
void onStop() override;
|
|
|
|
private:
|
|
UnitDualButton unit_;
|
|
bool connected_ = false;
|
|
|
|
// Config screen
|
|
gpio_pin_t pinA_ = 0;
|
|
gpio_pin_t pinB_ = 49;
|
|
lv_obj_t* lblPinA_ = nullptr;
|
|
lv_obj_t* lblPinB_ = nullptr;
|
|
lv_obj_t* lblError_ = nullptr;
|
|
|
|
// Test screen
|
|
lv_obj_t* circleA_ = nullptr;
|
|
lv_obj_t* circleB_ = nullptr;
|
|
lv_obj_t* circleLblA_ = nullptr;
|
|
lv_obj_t* circleLblB_ = nullptr;
|
|
|
|
lv_timer_t* timer_ = nullptr;
|
|
|
|
void buildConfigScreen(lv_obj_t* parent);
|
|
void buildTestScreen(lv_obj_t* parent);
|
|
void update();
|
|
|
|
static void onTimer(lv_timer_t* t);
|
|
static void onPinADown(lv_event_t* e);
|
|
static void onPinAUp(lv_event_t* e);
|
|
static void onPinBDown(lv_event_t* e);
|
|
static void onPinBUp(lv_event_t* e);
|
|
static void onConnect(lv_event_t* e);
|
|
};
|