[sx127x] Fix FIFO read corruption (#15114)

This commit is contained in:
Jonathan Swoboda
2026-03-24 16:04:27 -04:00
committed by Jesse Hills
parent d9788aaefc
commit 2f2c7ac393
+6 -2
View File
@@ -38,14 +38,18 @@ void SX127x::write_register_(uint8_t reg, uint8_t value) {
void SX127x::read_fifo_(std::vector<uint8_t> &packet) {
this->enable();
this->write_byte(REG_FIFO & 0x7F);
this->read_array(packet.data(), packet.size());
for (auto &byte : packet) {
byte = this->transfer_byte(0x00);
}
this->disable();
}
void SX127x::write_fifo_(const std::vector<uint8_t> &packet) {
this->enable();
this->write_byte(REG_FIFO | 0x80);
this->write_array(packet.data(), packet.size());
for (const auto &byte : packet) {
this->transfer_byte(byte);
}
this->disable();
}