Skip to content

Commit 2488153

Browse files
committed
bricks/_common/mpconfigport: Set atomic section only on embedded builds.
1 parent 4081498 commit 2488153

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bricks/_common/mpconfigport.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ typedef long mp_off_t;
141141

142142
#include "pbio_os_config.h"
143143

144+
#if PBDRV_CONFIG_STACK_EMBEDDED
144145
#define MICROPY_BEGIN_ATOMIC_SECTION() pbio_os_hook_disable_irq()
145146
#define MICROPY_END_ATOMIC_SECTION(state) pbio_os_hook_enable_irq(state)
147+
#else
148+
#define MICROPY_BEGIN_ATOMIC_SECTION() (0)
149+
#define MICROPY_END_ATOMIC_SECTION(state) (void)(state)
150+
#endif
146151

147152
#define MICROPY_VM_HOOK_LOOP \
148153
do { \

0 commit comments

Comments
 (0)