You've already forked TEF6686_ESP32
Added basic touch events
This commit is contained in:
@@ -5,6 +5,6 @@
|
||||
|
||||
// #define HAS_AIR_BAND // uncomment to enable Air Band(Make sure you have Air Band extend board)
|
||||
// #define CHINA_PORTABLE // uncomment for China Portable build (Simplified Chinese)
|
||||
// #define DEEPELEC_DP_66X // uncomment for DEEPELEC Portable DP-66X build (Simplified Chinese)
|
||||
#define DEEPELEC_DP_66X // uncomment for DEEPELEC Portable DP-66X build (Simplified Chinese)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,3 +2,29 @@
|
||||
#include "language.h"
|
||||
#include "constants.h"
|
||||
#include "config.h"
|
||||
|
||||
void doTouchEvent(uint16_t x, uint16_t y) {
|
||||
if (!menu && !advancedRDS && !seek && !afscreen) { // Normal radio mode
|
||||
if (x > 0 && x < 320 && y > 180 && y < 240 && band < BAND_GAP) { // -----------------
|
||||
leave = true;
|
||||
BuildAdvancedRDS(); // Switch to Advanced RDS View
|
||||
return;
|
||||
} else if (x > 60 && x < 240 && y > 40 && y < 100) {
|
||||
doBandToggle(); // Toggle bands
|
||||
return;
|
||||
} else if (x > 0 && x < 30 && y > 25 && y < 90) {
|
||||
doTuneMode(); // Toggle tune mode
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!menu && advancedRDS && !seek && !afscreen) { // Advanced RDS mode
|
||||
if (x > 0 && x < 320 && y > 180 && y < 240) { // -----------------
|
||||
leave = true;
|
||||
BuildDisplay();
|
||||
SelectBand();
|
||||
ScreensaverTimerReopen(); // Switch to normal radio view
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
src/touch.h
15
src/touch.h
@@ -6,4 +6,19 @@
|
||||
|
||||
extern TFT_eSPI tft;
|
||||
|
||||
extern bool advancedRDS;
|
||||
extern bool afscreen;
|
||||
extern bool leave;
|
||||
extern bool menu;
|
||||
extern bool seek;
|
||||
extern byte band;
|
||||
|
||||
void doTouchEvent(uint16_t x, uint16_t y);
|
||||
|
||||
extern void ScreensaverTimerReopen();
|
||||
extern void BuildDisplay();
|
||||
extern void SelectBand();
|
||||
extern void BuildAdvancedRDS();
|
||||
extern void doBandToggle();
|
||||
extern void doTuneMode();
|
||||
#endif
|
||||
Reference in New Issue
Block a user