Skip to content

Commit 07ecadb

Browse files
committed
SX126x: driver: fix getStats shift operations
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
1 parent d6a623d commit 07ecadb

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
@@ -362,9 +362,9 @@ void sx126x_getStats(uint16_t* nbPktReceived, uint16_t* nbPktCrcError, uint16_t*
362362
{
363363
uint8_t buf[7];
364364
sx126x_transfer(0x10, buf, 7);
365-
*nbPktReceived = (buf[1] >> 8) | buf[2];
366-
*nbPktCrcError = (buf[3] >> 8) | buf[4];
367-
*nbPktHeaderErr = (buf[5] >> 8) | buf[6];
365+
*nbPktReceived = (buf[1] << 8) | buf[2];
366+
*nbPktCrcError = (buf[3] << 8) | buf[4];
367+
*nbPktHeaderErr = (buf[5] << 8) | buf[6];
368368
}
369369

370370
void sx126x_resetStats()

0 commit comments

Comments
 (0)