mirror of
https://github.com/0015/ThatProject.git
synced 2026-01-12 09:17:42 +03:00
25 lines
435 B
C++
25 lines
435 B
C++
#include "ButtonCont.h"
|
|
#define RIGHT_BUTTON_PIN 35
|
|
|
|
static ButtonCont* instance = NULL;
|
|
|
|
void released(Button2& btn) {
|
|
instance->released_cb();
|
|
}
|
|
|
|
ButtonCont::ButtonCont() {}
|
|
|
|
ButtonCont::ButtonCont(FuncPtrVoid f) {
|
|
instance = this;
|
|
button = new Button2(RIGHT_BUTTON_PIN);
|
|
button->setReleasedHandler(released);
|
|
released_cb = f;
|
|
}
|
|
|
|
ButtonCont::~ButtonCont() {
|
|
delete button;
|
|
}
|
|
|
|
void ButtonCont::loop() {
|
|
button->loop();
|
|
} |