[riot-notifications] [RIOT-OS/RIOT] drivers/sx127x: Enforces reset pin to be defined (#11913)

Juan I Carrano notifications at github.com
Fri Jul 26 12:48:48 CEST 2019


Aside from the sensobox issue, I don't think checking for a valid config everywhere is a good design:
https://github.com/RIOT-OS/RIOT/blob/cb57c6ff1a730a740d9298c312d429cbf201e8cc/drivers/sx127x/sx127x.c#L98-L101

That code should go (i.e. it should just return without error). Otherwise, what is it guarding against? An unitialized value? Then it is highly unlikely that the value is exactly GPIO_UNDEF. If the value is GPIO_UNDEF then the user set it to that value and there must be a reason.

Following that logic, the following `#ifdefs` can go too, by allowing rx/tx_switch_pin to be undefined:
https://github.com/RIOT-OS/RIOT/blob/cb57c6ff1a730a740d9298c312d429cbf201e8cc/drivers/sx127x/sx127x.c#L105-L114

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11913#issuecomment-515407163
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190726/17044c5c/attachment.htm>


More information about the notifications mailing list