arduino-LoRa icon indicating copy to clipboard operation
arduino-LoRa copied to clipboard

Add setRxSingleTimeout(...)

Open marius-ne opened this issue 3 years ago • 3 comments

Dear LoRa Contributors,

first, thanks for your wonderful work! I implemented your library myself and was very happy with it, except that you couldn't change the timeout for the Rx Single Mode. So I went ahead and added that.

I hope you are happy with my contribution.

Best regards Marius

marius-ne avatar May 11 '22 07:05 marius-ne

Setting a timeout of 1023 symbols with a symbol duration of 1.024 ms (2^SF / BW) would result in a maximum timeout of approximately 1 second (precisely 1.048 s). After that the Timeout Interrupt would be triggered.

marius-ne avatar May 11 '22 07:05 marius-ne

Just one nitpick. REG_MODEM_CONFIG_2 contains only two bits of the timeout, ie bits 9 and 1 in position 1 and 0. You should probably do something like this to be on the safe side:

writeRegister(REG_MODEM_CONFIG_2, readRegister(REG_MODEM_CONFIG_2) | ((symbols >> 8)&0x03));

Kongduino avatar May 11 '22 07:05 Kongduino

I think that's cared for by the input check, the maximum value is 10 bits long, so the other values in REG_MODEM_CONFIG_2 will not be affected.

marius-ne avatar May 11 '22 07:05 marius-ne