8000 esp32/esp_espnow: Allocate the ESPNow singleton dynamically. · micropython/micropython@adbdc32 · GitHub
[go: up one dir, main page]

Skip to content

Commit adbdc32

Browse files
committed
esp32/esp_espnow: Allocate the ESPNow singleton dynamically.
This prevents send and recv ringbuffers being re-claimed by gc. callback_wrapper(): Use static byte string buffers for callback args. This eliminates heap allocation on each invocation of the send and receive callbacks. User callbacks must account for these re-used static buffers. Breaking change: Callbacks take two args instead of a tuple. This simplifies how we eliminate heap allocation in callback invocation. init(),deinit(): Tidy up synchronisation with ISR routines. New methods: config(): to get and set the send and recv buffer sizes and "cb_repeat" (cap on the number of packets to process on each callback()). stats(): Returns a tuple of transfer stats: (tx_packets, rx_packets, lost_tx_packets, lost_rx_packets).
1 parent 1b372b2 commit adbdc32

File tree

3 files changed

+256
-130
lines changed

3 files changed

+256
-130
lines changed

0 commit comments

Comments
 (0)
0