Skip to content

Commit

Permalink
Only init crosscore when FreeRTOS runs in multicore mode, add warning…
Browse files Browse the repository at this point in the history
…s that cross_int calls are private.
  • Loading branch information
Spritetm committed Oct 27, 2016
1 parent b14faab commit 68f39c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions components/esp32/cpu_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions components/esp32/crosscore_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions components/esp32/include/esp_crosscore_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* 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();

Expand All @@ -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);
Expand Down

0 comments on commit 68f39c1

Please sign in to comment.