mirror of
https://github.com/0015/ThatProject.git
synced 2026-01-13 01:37:43 +03:00
OTA Solution - Build your own OTA platform (2/2, ESP32 OTA Application)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#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();
|
||||
}
|
||||
Reference in New Issue
Block a user