]> granicus.if.org Git - esp-idf/commitdiff
Only init crosscore when FreeRTOS runs in multicore mode, add warnings that cross_int...
authorJeroen Domburg <git@j0h.nl>
Thu, 27 Oct 2016 08:50:28 +0000 (16:50 +0800)
committerJeroen Domburg <git@j0h.nl>
Thu, 27 Oct 2016 08:50:28 +0000 (16:50 +0800)
components/esp32/cpu_start.c
components/esp32/crosscore_int.c
components/esp32/include/esp_crosscore_int.h

index 0c94f39e301680113196de16130841a9bb338def..bfc751d4539eab7e39df35a28b7d2427df4f2863 100644 (file)
@@ -147,7 +147,9 @@ void start_cpu0_default(void)
     uart_div_modify(0, (APB_CLK_FREQ << 4) / 115200);
     ets_setup_syscalls();
     do_global_ctors();
+#if !CONFIG_FREERTOS_UNICORE
     esp_crosscore_int_init();
+#endif
     esp_ipc_init();
     spi_flash_init();
     xTaskCreatePinnedToCore(&main_task, "main",
index 56fe6fe9a7130176e2f0768b2c64a70961b84d31..78287d405e6f875ca9ef26d5ccfafaf4ee09d39c 100644 (file)
@@ -49,8 +49,8 @@ static void esp_crosscore_isr(void *arg) {
     //A pointer to the correct reason array item is passed to this ISR.
     volatile uint32_t *myReason=arg;
 #else
-    //Does not work yet, the interrupt code needs work to understand two separate interrupt and argument
-    //tables...
+    //The previous line does not work yet, the interrupt code needs work to understand two separate interrupt and argument
+    //tables... this is a valid but slightly less optimal replacement.
     volatile uint32_t *myReason=&reason[xPortGetCoreID()];
 #endif
     //Clear the interrupt first.
index ca5f3901ee61845b1f0f3ed220d11eee0f7a0ffc..0e4b2b83853514176ed08795a3dd1915c5597bcb 100644 (file)
  * Initialize the crosscore interrupt system for this CPU.
  * This needs to be called once on every CPU that is used
  * by FreeRTOS.
+ *
+ * If multicore FreeRTOS support is enabled, this will be
+ * called automatically by the startup code and should not
+ * be called manually.
  */
 void esp_crosscore_int_init();
 
@@ -28,6 +32,9 @@ void esp_crosscore_int_init();
  * currently running task in favour of a higher-priority task
  * that presumably just woke up.
  *
+ * This is used internally by FreeRTOS in multicore mode
+ * and should not be called by the user.
+ *
  * @param coreID Core that should do the yielding
  */
 void esp_crosscore_int_send_yield(int coreId);