mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-08 13:41:28 +00:00
Track actual GPIO values, not just the enum values (#3768)
* Track actual GPIO values, not just the enum values * trunk
This commit is contained in:
parent
71400103b3
commit
06e7d2b845
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user