tinyvision-ai-inc / pico-ice-sdk

Firmware and software support for the pico-ice board
MIT License
47 stars 13 forks source link

Make async callback ice_smem_read/write_async parameter #16

Closed alastairpatrick closed 1 year ago

alastairpatrick commented 1 year ago

Make smem module thead safe. Allow RTOS to block during async serial memory operation. Allow async callback to immediately chain another async op.

alastairpatrick commented 1 year ago

Locking isn't an RTOS feature. I've removed all mention of RTOS from the comments to avoid confusion. The purpose of locking is to provide software based arbitration of the serial memory bus between both cores (but not between ARM cores and FPGA).

I think it would be possible for a higher level module to do this, or at least it would be with a few simpler modifications to ice_smem and am open to that. It would mean that ice_smem would generally be unsafe to use on both cores at the same time.