mattdibi / redox-w-firmware

Firmware for nordic MCUs used in the Redox wireless keyboard

Repository from Github https://github.commattdibi/redox-w-firmwareRepository from Github https://github.commattdibi/redox-w-firmware

Is the wrong data payload being put into fifo 1 ?

LucidityCrash opened this issue · comments

nrf_gzll_add_packet_to_tx_fifo(1, data_payload_left, TX_PAYLOAD_LENGTH);

Shouldn't this be nrf_gzll_add_packet_to_tx_fifo(1, data_payload_right, TX_PAYLOAD_LENGTH); ?

Hi,
good question! Looking at that part of the code I would say the same but I looked through the various Mitosis implementation and it stays like that.
Unfortunately I left my Redox wireless at work and I cannot test your suggestion right now. I'll try to give it a shot in the following days...

Indeed, and given that it is only used right at the beginning of main, and at that time both data_payload_left and data_payload_right are the same (and empty), and only on line 288 is an ack sent and that uses the pipe variable and the ack payload, I'm not exactly sure what the 2 lines 102, and 103 actually do.

Finally I had time to test it... sorry for the delay.

I updated only the receiver code with the following:

diff --git a/redox-w-receiver-basic/main.c b/redox-w-receiver-basic/main.c
index f12287b..82fc500 100644
--- a/redox-w-receiver-basic/main.c
+++ b/redox-w-receiver-basic/main.c
@@ -100,7 +100,7 @@ int main(void)
     // Load data into TX queue
     ack_payload[0] = 0x55;
     nrf_gzll_add_packet_to_tx_fifo(0, data_payload_left, TX_PAYLOAD_LENGTH);
-    nrf_gzll_add_packet_to_tx_fifo(1, data_payload_left, TX_PAYLOAD_LENGTH);
+    nrf_gzll_add_parcket_to_tx_fifo(1, data_payload_right, TX_PAYLOAD_LENGTH);
 
     // Enable Gazell to start sending over the air
     nrf_gzll_enable();

and it works exactly the same.
I'll update the code leaving this correction in.