Reading through the issue, what I understand is, we need to have a mechanism to flag an error is the rtos_i2s_slave API functions are called from the wrong tile. I think, ensuring this is the application’s responsibility; perhaps by ensuring that the rtos_i2s_struct handle is only defined on the correct tile in driver_instances.c.
The only way I can think of fixing this in the driver is by making note of the tile on which rtos_i2s_slave_init is called and asserting if the other RTOS I2S slave driver APIs, rtos_i2s_start, rtos_i2s_tx and rtos_i2s_rx are called from the other tile. The assert would fail if
the application called an rtos_i2s_start, rtos_i2s_tx and rtos_i2s_rx api function from a different tile than rtos_i2s_init() function for the I2S slave
the application called an rtos_i2s_start, rtos_i2s_tx and rtos_i2s_rx api function from a different tile than rtos_i2s_init() function for the I2S without instantiating the RPC for the I2S master.
This change assumes that the define THIS_XCORE_TILE has been defined by the application. This seems to be a standard requirement since a lot of driver code refers to THIS_XCORE_TILE for debug printing etc.
https://xmosjira.atlassian.net/browse/AP-157
Reading through the issue, what I understand is, we need to have a mechanism to flag an error is the rtos_i2s_slave API functions are called from the wrong tile. I think, ensuring this is the application’s responsibility; perhaps by ensuring that the rtos_i2s_struct handle is only defined on the correct tile in driver_instances.c.
The only way I can think of fixing this in the driver is by making note of the tile on which rtos_i2s_slave_init is called and asserting if the other RTOS I2S slave driver APIs, rtos_i2s_start, rtos_i2s_tx and rtos_i2s_rx are called from the other tile. The assert would fail if
the application called an rtos_i2s_start, rtos_i2s_tx and rtos_i2s_rx api function from a different tile than rtos_i2s_init() function for the I2S slave
the application called an rtos_i2s_start, rtos_i2s_tx and rtos_i2s_rx api function from a different tile than rtos_i2s_init() function for the I2S without instantiating the RPC for the I2S master.
This change assumes that the define THIS_XCORE_TILE has been defined by the application. This seems to be a standard requirement since a lot of driver code refers to THIS_XCORE_TILE for debug printing etc.