arch/xtensa/esp32_spi&i2c: Get the CPU index when attaching an

interrupt.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche 2021-08-02 10:37:30 +02:00 committed by Xiang Xiao
parent 5588bc4ef6
commit 3e44c347fd
3 changed files with 9 additions and 0 deletions

View File

@ -1569,6 +1569,9 @@ FAR struct i2c_master_s *esp32_i2cbus_initialize(int port)
return NULL;
}
/* Set up to receive peripheral interrupts on the current CPU */
config->cpu = up_cpu_index();
up_disable_irq(priv->cpuint);
esp32_attach_peripheral(config->cpu, config->periph, priv->cpuint);

View File

@ -1473,6 +1473,9 @@ FAR struct spi_dev_s *esp32_spibus_initialize(int port)
return NULL;
}
/* Set up to receive peripheral interrupts on the current CPU */
priv->config->cpu = up_cpu_index();
up_disable_irq(priv->cpuint);
esp32_attach_peripheral(priv->config->cpu,
priv->config->periph,

View File

@ -1306,6 +1306,9 @@ FAR struct spi_slave_ctrlr_s *esp32_spislv_ctrlr_initialize(int port)
return NULL;
}
/* Set up to receive peripheral interrupts on the current CPU */
priv->config->cpu = up_cpu_index();
up_disable_irq(priv->cpuint);
esp32_attach_peripheral(priv->config->cpu,
priv->config->periph,