@@ -57,7 +57,9 @@ static void espnow_check_for_deinit(espnow_obj_t *self) {
57
57
//| """Allocate and initialize `ESPNow` instance as a singleton.
58
58
//|
59
59
//| :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
+ //| """
61
63
//| ...
62
64
STATIC 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 ) {
63
65
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
71
73
72
74
espnow_obj_t * self = MP_STATE_PORT (espnow_singleton );
73
75
74
- if (self != NULL ) {
76
+ if (! common_hal_espnow_deinited ( self ) ) {
75
77
mp_raise_RuntimeError (translate ("Already running" ));
76
78
}
77
79
@@ -244,7 +246,9 @@ MP_PROPERTY_GETTER(espnow_buffer_size_obj,
244
246
(mp_obj_t )& espnow_get_buffer_size_obj );
245
247
246
248
//| 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
+ //| """
248
252
//|
249
253
STATIC mp_obj_t espnow_get_phy_rate (const mp_obj_t self_in ) {
250
254
espnow_obj_t * self = MP_OBJ_TO_PTR (self_in );
0 commit comments