Skip to content

Commit

Permalink
Merge branch 'meshtastic:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
markbirss authored Aug 4, 2024
2 parents 82cdb06 + 5bbafdf commit a93e508
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/RemoteHardwareModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ bool RemoteHardwareModule::handleReceivedProtobuf(const meshtastic_MeshPacket &r
// Print notification to LCD screen
screen->print("Write GPIOs\n");

pinModes(p.gpio_mask, OUTPUT);
for (uint8_t i = 0; i < NUM_GPIOS; i++) {
uint64_t mask = 1ULL << i;
if (p.gpio_mask & mask) {
digitalWrite(i, (p.gpio_value & mask) ? 1 : 0);
}
}
pinModes(p.gpio_mask, OUTPUT);

break;
}
Expand Down
6 changes: 5 additions & 1 deletion src/platform/portduino/PortduinoGlue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <Utility.h>
#include <assert.h>
#include <time.h>

#include "PortduinoGlue.h"
#include "linux/gpio/LinuxGPIOPin.h"
Expand Down Expand Up @@ -134,6 +135,9 @@ void portduinoSetup()
return;
}

// Rather important to set this, if not running simulated.
randomSeed(time(NULL));

try {
if (yamlConfig["Logging"]) {
if (yamlConfig["Logging"]["LogLevel"].as<std::string>("info") == "trace") {
Expand Down Expand Up @@ -382,4 +386,4 @@ int initGPIOPin(int pinNum, const std::string gpioChipName)
#else
return ERRNO_OK;
#endif
}
}

0 comments on commit a93e508

Please sign in to comment.