xmos / fwk_rtos

RTOS Framework
Other
8 stars 20 forks source link

flag RTOS I2S APIs called from the wrong tile #205

Closed shuchitak closed 11 months ago

shuchitak commented 11 months ago

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

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.