File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ INC += \
94
94
-isystem esp-idf/components/esp_event/include \
95
95
-isystem esp-idf/components/esp_hw_support/include \
96
96
-isystem esp-idf/components/esp_hw_support/include/soc \
97
+ -isystem esp-idf/components/esp_ipc/include \
97
98
-isystem esp-idf/components/esp_netif/include \
98
99
-isystem esp-idf/components/esp_pm/include \
99
100
-isystem esp-idf/components/esp_ringbuf/include \
Original file line number Diff line number Diff line change 77
77
78
78
#include "esp_debug_helpers.h"
79
79
80
+ #include "esp_ipc.h"
81
+
80
82
#ifdef CONFIG_SPIRAM
81
83
#include "esp32/spiram.h"
82
84
#endif
@@ -103,14 +105,26 @@ TaskHandle_t circuitpython_task = NULL;
103
105
104
106
extern void esp_restart (void ) NORETURN ;
105
107
106
- STATIC void tick_timer_cb (void * arg ) {
108
+ STATIC void tick_on_cp_core (void * arg ) {
107
109
supervisor_tick ();
108
110
109
111
// CircuitPython's VM is run in a separate FreeRTOS task from timer callbacks. So, we have to
110
112
// notify the main task every time in case it's waiting for us.
111
113
xTaskNotifyGive (circuitpython_task );
112
114
}
113
115
116
+ // This function may happen on the PRO core when CP is on the APP core. So, make
117
+ // sure we run on the CP core.
118
+ STATIC void tick_timer_cb (void * arg ) {
119
+ #if defined(CONFIG_FREERTOS_UNICORE ) && CONFIG_FREERTOS_UNICORE
120
+ tick_on_cp_core (arg );
121
+ #else
122
+ // This only blocks until the start of the function. That's ok since the PRO
123
+ // core shouldn't care what we do.
124
+ esp_ipc_call (CONFIG_ESP_MAIN_TASK_AFFINITY , tick_on_cp_core , NULL );
125
+ #endif
126
+ }
127
+
114
128
void sleep_timer_cb (void * arg );
115
129
116
130
safe_mode_t port_init (void ) {
You can’t perform that action at this time.
0 commit comments