[sx127x] Fix FIFO read corruption (#15114)

This commit is contained in:
Jonathan Swoboda
2026-03-24 10:04:27 -10:00
committed by GitHub
parent 22bc47da23
commit 8751f348c8
+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();
}