LacunaSpace / basicmac

BasicMAC LoRaWAN stack that supports (but is not limited to) Arduino
Other
75 stars 18 forks source link

SX126x: Make using DIO2/DIO3 to control TXRX/TCXO optional #17

Closed matthijskooijman closed 4 years ago

matthijskooijman commented 4 years ago

This fixes #9 by making DIO3 control optional.

This is a breaking change (the default changes, boards with a TCXO now need to change their pinmaps), as documented in the README.

See commit messages for details.

matthijskooijman commented 4 years ago

I've added a commit to also make DIO2-controls-txrx optional in the same way as DIO3-controls-tcxo, plus some related improvements.

ricaun commented 4 years ago

Congratulation @matthijskooijman the DIO3-controls-tcxo features are working perfectly on my board, On my case the board do not have the dio3 pin connected on the SX126X, The .tcxo = LMIC_UNUSED_PIN, works perfect and with the .tcxo = LMIC_CONTROLLED_BY_DIO3, config the board crashes (wrong config dumdum).

And I like the LMIC_regionCode function, make it easier to find the code region on the main code. You should change the example and make more generic like this...

u1_t os_getRegion (void) { return LMIC_regionCode(0); } // Get the first code region

Great work!

matthijskooijman commented 4 years ago

@ricaun Thanks for testing, good to hear it works :-)

You should change the example and make more generic like this...

Excellent suggestion, I pushed it to master right away. Thanks!