JF002 / cfRFM69

RFM69 driver library for ESP32/Arduino
MIT License
7 stars 2 forks source link

Issues found when using library cfRFM69@0.1.2 in platformIO #1

Open cregganna opened 4 years ago

cregganna commented 4 years ago

Hi,

I love the simplicity of your library and the effort you have put in to coding up the registers and values but I found one or two issues when using it for Receiving Packets and analysing a 433MHz Transmitter I had.

I would like to suggest some edits for bugs that I have found and fixed.

Issues found in Version 0.1.2 as exposed in platformIO library: https://platformio.org/lib/show/6161/cfRFM69

  1. SetListenMode() was using the wrong register (Registers::PacketConfig instead of Registers::ListenSettings)
  2. I have implemented a `ReadFIFO() function that allows one to take advantage the more efficient multi-byte read of the FIFO rather than calling multiple ReadRegister(0x00)
  3. ReadMaskWriteRegister was not applying the mask correctly to preserve the existing bits in the register.
  4. I found that in certain config setters the bit twiddling was not correct and I have recoded the following methods to use the now fixed ReadMaskWriteRegister instead.
    SetOperatingMode()
    AbortListen()
    EnableListen()
    EnableSequencer()

I can either issue a pull request or post you a diff.

Many thanks for the excellent work in this library.

TJ

JF002 commented 4 years ago

Hi!

Thanks for your interest in this project! I'm not working on it for now, but any improvement is always welcomed. I mainly used this library to emit data, but not receive, that's probably why you found more issue on this part of the code.

If you want to contribute to the project, I would suggest you to create a pull-request, I'll review it and eventually merge it in the project!

FYI, version 0.1.2 from the Library of Platform.io correspond to the current state of the Master branch of the project.

Thanks!