Add GPIO edge for Native Trackball/Joystick (#7212)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
pull/7216/head
Jonathan Bennett 2025-07-03 06:53:27 -05:00 zatwierdzone przez GitHub
rodzic 81828c6244
commit b02e58521d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
4 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -22,5 +22,5 @@ Input:
TrackballLeft: 5
TrackballRight: 26
TrackballPress: 13
TrackballDirection: FALLING
# User: 21

Wyświetl plik

@ -4,8 +4,13 @@
#include "mesh/NodeDB.h"
#ifndef TB_DIRECTION
#if ARCH_PORTDUINO
#include "PortduinoGlue.h"
#define TB_DIRECTION (PinStatus) settingsMap[tbDirection]
#else
#define TB_DIRECTION RISING
#endif
#endif
class TrackballInterruptBase : public Observable<const InputEvent *>, public concurrency::OSThread
{

Wyświetl plik

@ -642,6 +642,11 @@ bool loadConfig(const char *configPath)
settingsMap[tbLeftPin] = yamlConfig["Input"]["TrackballLeft"].as<int>(RADIOLIB_NC);
settingsMap[tbRightPin] = yamlConfig["Input"]["TrackballRight"].as<int>(RADIOLIB_NC);
settingsMap[tbPressPin] = yamlConfig["Input"]["TrackballPress"].as<int>(RADIOLIB_NC);
if (yamlConfig["Input"]["TrackballDirection"].as<std::string>("RISING") == "RISING") {
settingsMap[tbDirection] = 4;
} else if (yamlConfig["Input"]["TrackballDirection"].as<std::string>("RISING") == "FALLING") {
settingsMap[tbDirection] = 3;
}
}
if (yamlConfig["Webserver"]) {

Wyświetl plik

@ -63,6 +63,7 @@ enum configNames {
tbLeftPin,
tbRightPin,
tbPressPin,
tbDirection,
spidev,
spiSpeed,
i2cdev,