mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 01:16:55 +00:00
Pick up support for more than 64 GPIO lines under Portduino
This commit is contained in:
parent
ec92f7a5a3
commit
5095efc55f
@ -1,6 +1,6 @@
|
|||||||
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
||||||
[portduino_base]
|
[portduino_base]
|
||||||
platform = https://github.com/meshtastic/platform-native.git#659e49346aa33008b150dfb206b1817ddabc7132
|
platform = https://github.com/meshtastic/platform-native.git#784007630ca43b4811c6637606440588bb5acf39
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
|
@ -76,7 +76,21 @@ void portduinoCustomInit()
|
|||||||
void portduinoSetup()
|
void portduinoSetup()
|
||||||
{
|
{
|
||||||
printf("Setting up Meshtastic on Portduino...\n");
|
printf("Setting up Meshtastic on Portduino...\n");
|
||||||
gpioInit();
|
int max_GPIO = 0;
|
||||||
|
int GPIO_lines[] = {cs,
|
||||||
|
irq,
|
||||||
|
busy,
|
||||||
|
reset,
|
||||||
|
txen,
|
||||||
|
rxen,
|
||||||
|
displayDC,
|
||||||
|
displayCS,
|
||||||
|
displayBacklight,
|
||||||
|
displayBacklightPWMChannel,
|
||||||
|
displayReset,
|
||||||
|
touchscreenCS,
|
||||||
|
touchscreenIRQ,
|
||||||
|
user};
|
||||||
|
|
||||||
std::string gpioChipName = "gpiochip";
|
std::string gpioChipName = "gpiochip";
|
||||||
settingsStrings[i2cdev] = "";
|
settingsStrings[i2cdev] = "";
|
||||||
@ -245,6 +259,13 @@ void portduinoSetup()
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i : GPIO_lines) {
|
||||||
|
if (i > max_GPIO)
|
||||||
|
max_GPIO = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
gpioInit(max_GPIO + 1); // Done here so we can inform Portduino how many GPIOs we need.
|
||||||
|
|
||||||
// Need to bind all the configured GPIO pins so they're not simulated
|
// Need to bind all the configured GPIO pins so they're not simulated
|
||||||
if (settingsMap.count(cs) > 0 && settingsMap[cs] != RADIOLIB_NC) {
|
if (settingsMap.count(cs) > 0 && settingsMap[cs] != RADIOLIB_NC) {
|
||||||
if (initGPIOPin(settingsMap[cs], gpioChipName) != ERRNO_OK) {
|
if (initGPIOPin(settingsMap[cs], gpioChipName) != ERRNO_OK) {
|
||||||
|
Loading…
Reference in New Issue
Block a user