mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 01:52:48 +00:00
Configure pin modes of selected pins before attempting to write to them (#4385)
This commit is contained in:
parent
5453c495e2
commit
5bbafdfd31
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user