Skip to content

Commit

Permalink
Update RemoteHardwareModule.cpp (#2454)
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorNehrutsa committed May 3, 2023
1 parent a6385a5 commit 973b30f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/RemoteHardwareModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 973b30f

Please sign in to comment.