We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8f3d23 commit 9164629Copy full SHA for 9164629
ports/espressif/mpconfigport.h
@@ -74,4 +74,11 @@
74
#define CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP (0)
75
#endif
76
77
+// Protect the background queue with a lock because both cores may modify it.
78
+#include "freertos/FreeRTOS.h"
79
+#include "freertos/task.h"
80
+extern portMUX_TYPE background_task_mutex;
81
+#define CALLBACK_CRITICAL_BEGIN (taskENTER_CRITICAL(&background_task_mutex))
82
+#define CALLBACK_CRITICAL_END (taskEXIT_CRITICAL(&background_task_mutex))
83
+
84
#endif // MICROPY_INCLUDED_ESPRESSIF_MPCONFIGPORT_H
ports/espressif/supervisor/port.c
@@ -522,3 +522,5 @@ extern void app_main(void);
522
void app_main(void) {
523
main();
524
}
525
526
+portMUX_TYPE background_task_mutex = portMUX_INITIALIZER_UNLOCKED;
0 commit comments