Merge pull request #884 from cyberman54/development

Development
This commit is contained in:
Verkehrsrot 2022-08-04 13:53:20 +02:00 committed by GitHub
commit f91e69760f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -7,6 +7,10 @@
#include "display.h" #include "display.h"
#include "payload.h" #include "payload.h"
#ifndef BUTTON_ACTIVEHIGH
#define BUTTON_ACTIVEHIGH 0
#endif
void button_init(int pin); void button_init(int pin);
void readButton(); void readButton();

View File

@ -60,6 +60,10 @@
#define MY_DISPLAY_BGCOLOR TFT_BLACK #define MY_DISPLAY_BGCOLOR TFT_BLACK
#endif #endif
#ifndef TOUCH_CS
#define TOUCH_CS NOT_A_PIN
#endif
#endif #endif
// setup display hardware type, default is OLED 128x64 // setup display hardware type, default is OLED 128x64

View File

@ -11,10 +11,10 @@ static const char TAG[] = __FILE__;
static Button *b = NULL; static Button *b = NULL;
void button_init(int pin) { void button_init(int pin) {
#ifdef BUTTON_PULLDOWN #ifdef BUTTON_PULLUP
b = new Button(pin);
#else
b = new ButtonPullup(pin); b = new ButtonPullup(pin);
#else
b = new Button(pin, !BUTTON_ACTIVEHIGH);
#endif #endif
// attach events to the button // attach events to the button