Skip to content

Commit b46acc0

Browse files
authored
Merge pull request #13 from Noltari/sx126x-driver-fix-getStats
SX126x: driver: fix getStats shift operations
2 parents 927ca6e + 07ecadb commit b46acc0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SX126x_driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ void sx126x_getStats(uint16_t* nbPktReceived, uint16_t* nbPktCrcError, uint16_t*
348348
{
349349
uint8_t buf[7];
350350
sx126x_transfer(0x10, buf, 7);
351-
*nbPktReceived = (buf[1] >> 8) | buf[2];
352-
*nbPktCrcError = (buf[3] >> 8) | buf[4];
353-
*nbPktHeaderErr = (buf[5] >> 8) | buf[6];
351+
*nbPktReceived = (buf[1] << 8) | buf[2];
352+
*nbPktCrcError = (buf[3] << 8) | buf[4];
353+
*nbPktHeaderErr = (buf[5] << 8) | buf[6];
354354
}
355355

356356
void sx126x_resetStats()

0 commit comments

Comments
 (0)