keyplus icon indicating copy to clipboard operation
keyplus copied to clipboard

Add better buffering for nRF24 matrix transmissions

Open ahtn opened this issue 6 years ago • 0 comments

The nRF24 has an internal FIFO for storing up to 3 packets. Currently when sending a matrix packet, the code doesn't check if the FIFO is full. So if RF packets are not transmitted fast enough (could easily happen if there is other RF interference), then packets will be dropped.

Instead the code should check if the FIFO is full, and if it is, it should use a separate FIFO on the microcontroller to hold packets and add them to the nRF24 FIFO when space becomes available.

Another potential issue that may arise from buffering, is the receiver may try to apply several matrix packets at a time. In the worst case, this could cause keys to be missed (it applies a key down and key up at the same time), so it might be beneficial for the receiver to read one matrix packet at a time and send any USB keycodes that are generated before moving to the next packet.

Relevant code

ahtn avatar Mar 27 '18 02:03 ahtn