Update RemoteHardwareModule.cpp (#2454)

This commit is contained in:
IhorNehrutsa 2023-05-03 14:25:03 +03:00 committed by GitHub
parent a6385a522d
commit 973b30fc0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@
static void pinModes(uint64_t mask, uint8_t mode)
{
for (uint64_t i = 0; i < NUM_GPIOS; i++) {
if (mask & (1 << i)) {
if (mask & (1ULL << i)) {
pinMode(i, mode);
}
}
@ -35,7 +35,7 @@ static uint64_t digitalReads(uint64_t mask)
// pinModes(mask, INPUT_PULLUP);
for (uint64_t i = 0; i < NUM_GPIOS; i++) {
uint64_t m = 1 << i;
uint64_t m = 1ULL << i;
if (mask & m) {
if (digitalRead(i)) {
res |= m;
@ -64,7 +64,7 @@ bool RemoteHardwareModule::handleReceivedProtobuf(const meshtastic_MeshPacket &r
screen->print("Write GPIOs\n");
for (uint8_t i = 0; i < NUM_GPIOS; i++) {
uint64_t mask = 1 << i;
uint64_t mask = 1ULL << i;
if (p.gpio_mask & mask) {
digitalWrite(i, (p.gpio_value & mask) ? 1 : 0);
}