Skip to content

Commit 95bd265

Browse files
authored
Small Lightning Driver Fixes (#358)
1 parent 699f329 commit 95bd265

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

general/src/as3935.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ uint8_t as3935_read(as3935_t *as3935, uint8_t reg)
2929

3030
// HAL SPI wants an 8 bit array of length 2 for tx_data
3131
HAL_StatusTypeDef status = HAL_SPI_TransmitReceive(
32-
as3935->hspi, (uint8_t *)&tx_data, &rx_buf, 2, HAL_MAX_DELAY);
32+
as3935->hspi, (uint8_t *)&tx_data, rx_buf, 2, HAL_MAX_DELAY);
3333

3434
if (status != HAL_OK) {
3535
return 0xFF;
@@ -164,7 +164,7 @@ uint32_t as3935_get_energy(as3935_t *as3935)
164164
}
165165

166166
// combine the three values. Only read the first 5 bits for energy_mm
167-
energy = ((energy_mm & 0b11111) << 16) | (energy_m << 8) | energy_l;
167+
energy = ((energy_mm & 0x1F) << 16) | (energy_m << 8) | energy_l;
168168

169169
return energy;
170170
}

0 commit comments

Comments
 (0)