Skip to content

Commit

Permalink
[RF24 wrapper] use rf24_gpio_pin_t and RF24_PIN_INVALID (#28)
Browse files Browse the repository at this point in the history
This is actually an overlooked follow up to nRF24/RF24#898

The problematic inconsistency was primarily affecting builds with the RPi driver.
  • Loading branch information
2bndy5 committed Dec 5, 2023
1 parent 89403ef commit f9afd8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pyRF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RF24Wrapper : public RF24
{

public:
RF24Wrapper(uint16_t _ce_pin, uint16_t _csn_pin, uint32_t _spi_speed = 10000000) : RF24(_ce_pin, _csn_pin, _spi_speed)
RF24Wrapper(rf24_gpio_pin_t _ce_pin, rf24_gpio_pin_t _csn_pin, uint32_t _spi_speed = 10000000) : RF24(_ce_pin, _csn_pin, _spi_speed)
{
}

Expand Down Expand Up @@ -851,7 +851,7 @@ PYBIND11_MODULE(rf24, m)
// *****************************************************************************
// ************************** functions that have overloads

.def(py::init<uint8_t, uint8_t, uint32_t>(), R"docstr(
.def(py::init<rf24_gpio_pin_t, rf24_gpio_pin_t, uint32_t>(), R"docstr(
__init__(ce_pin: int, csn_pin: int, spi_speed: int = 10000000)
__init__(spi_speed: int = 10000000)

Expand All @@ -861,7 +861,7 @@ PYBIND11_MODULE(rf24, m)
:param int csn_pin: The pin number connected to the radio's CSN pin.
:param int spi_speed: The SPI bus speed (in Hz). Defaults to 10 MHz when not specified.
)docstr",
py::arg("ce_pin") = 0xFFFF, py::arg("csn_pin") = 0xFFFF, py::arg("spi_speed") = 10000000)
py::arg("ce_pin") = RF24_PIN_INVALID, py::arg("csn_pin") = RF24_PIN_INVALID, py::arg("spi_speed") = 10000000)

// *****************************************************************************

Expand All @@ -885,7 +885,7 @@ PYBIND11_MODULE(rf24, m)

// *****************************************************************************

.def("begin", static_cast<bool (RF24Wrapper::*)(uint16_t, uint16_t)>(&RF24Wrapper::begin), R"docstr(
.def("begin", static_cast<bool (RF24Wrapper::*)(rf24_gpio_pin_t, rf24_gpio_pin_t)>(&RF24Wrapper::begin), R"docstr(
If configuring the radio's CE & CSN pins dynamically, then the respective pin numbers must be passed to this function.

:param int ce_pin: The pin number connected to the radio's CE pin.
Expand Down

0 comments on commit f9afd8b

Please sign in to comment.