Skip to content

Commit 74b102b

Browse files
committed
esp32/mpconfigport.h: Provide ATOMIC_SECTION macros.
1 parent 05520cb commit 74b102b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

esp32/mpconfigport.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@ extern const struct _mp_obj_module_t mp_module_network;
206206
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
207207
#define MP_SSIZE_MAX (0x7fffffff)
208208

209+
// Note: these "critical nested" macros do not ensure cross-CPU exclusion,
210+
// the only disable interrupts on the current CPU. To full manage exclusion
211+
// one should use portENTER_CRITICAL/portEXIT_CRITICAL instead.
212+
#include "freertos/FreeRTOS.h"
213+
#define MICROPY_BEGIN_ATOMIC_SECTION() portENTER_CRITICAL_NESTED()
214+
#define MICROPY_END_ATOMIC_SECTION(state) portEXIT_CRITICAL_NESTED(state)
215+
209216
#if MICROPY_PY_THREAD
210217
#define MICROPY_EVENT_POLL_HOOK \
211218
do { \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy