Track actual GPIO values, not just the enum values (#3768)

* Track actual GPIO values, not just the enum values

* trunk
pull/3770/head
Jonathan Bennett 2024-05-02 13:39:28 -05:00 zatwierdzone przez GitHub
rodzic 71400103b3
commit 06e7d2b845
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 17 dodań i 17 usunięć

Wyświetl plik

@ -75,20 +75,20 @@ void portduinoSetup()
{
printf("Setting up Meshtastic on Portduino...\n");
int max_GPIO = 0;
int GPIO_lines[] = {cs,
irq,
busy,
reset,
txen,
rxen,
displayDC,
displayCS,
displayBacklight,
displayBacklightPWMChannel,
displayReset,
touchscreenCS,
touchscreenIRQ,
user};
configNames GPIO_lines[] = {cs,
irq,
busy,
reset,
txen,
rxen,
displayDC,
displayCS,
displayBacklight,
displayBacklightPWMChannel,
displayReset,
touchscreenCS,
touchscreenIRQ,
user};
std::string gpioChipName = "gpiochip";
settingsStrings[i2cdev] = "";
@ -281,9 +281,9 @@ void portduinoSetup()
exit(EXIT_FAILURE);
}
for (int i : GPIO_lines) {
if (i > max_GPIO)
max_GPIO = i;
for (configNames i : GPIO_lines) {
if (settingsMap[i] > max_GPIO)
max_GPIO = settingsMap[i];
}
gpioInit(max_GPIO + 1); // Done here so we can inform Portduino how many GPIOs we need.