@@ -57,7 +57,9 @@ static void espnow_check_for_deinit(espnow_obj_t *self) {
5757//| """Allocate and initialize `ESPNow` instance as a singleton.
5858//|
5959//| :param int buffer_size: The size of the internal ring buffer. Default: 526 bytes.
60- //| :param int phy_rate: The ESP-NOW physical layer rate. Default: 1 Mbps."""
60+ //| :param int phy_rate: The ESP-NOW physical layer rate. Default: 1 Mbps.
61+ //| `wifi_phy_rate_t <https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/api-reference/network/esp_wifi.html#_CPPv415wifi_phy_rate_t>`_
62+ //| """
6163//| ...
6264STATIC mp_obj_t espnow_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
6365 enum { ARG_buffer_size , ARG_phy_rate };
@@ -71,7 +73,7 @@ STATIC mp_obj_t espnow_make_new(const mp_obj_type_t *type, size_t n_args, size_t
7173
7274 espnow_obj_t * self = MP_STATE_PORT (espnow_singleton );
7375
74- if (self != NULL ) {
76+ if (! common_hal_espnow_deinited ( self ) ) {
7577 mp_raise_RuntimeError (translate ("Already running" ));
7678 }
7779
@@ -244,7 +246,9 @@ MP_PROPERTY_GETTER(espnow_buffer_size_obj,
244246 (mp_obj_t )& espnow_get_buffer_size_obj );
245247
246248//| phy_rate: int
247- //| """The ESP-NOW physical layer rate."""
249+ //| """The ESP-NOW physical layer rate.
250+ //| `wifi_phy_rate_t <https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/api-reference/network/esp_wifi.html#_CPPv415wifi_phy_rate_t>`_
251+ //| """
248252//|
249253STATIC mp_obj_t espnow_get_phy_rate (const mp_obj_t self_in ) {
250254 espnow_obj_t * self = MP_OBJ_TO_PTR (self_in );
0 commit comments