I would be interested to see some more complex examples for this than the ones provided[1], specifically around interrupts and DMA, both are somewhat "concurrent" resources that in C need to be managed manually, with careful use of the volatile keyword and similar.<p>For instance, UART transmit looks to be implemented using blocking IO[2]. I don't know Go very well, but it would be interesting if this could be implemented as a buffered channel [3], which would provide a nice abstraction for the hardware FIFO buffer used by the UART, and allow the CPU to be doing other things. The same could also be used for the I2S support I think, which will often be used to send much more data (streaming audio) than the UART.<p>On closer inspection, looking at the issue tracker, it appears this is already in planning, which is great [4].<p>[1] <a href="https://github.com/tinygo-org/tinygo/tree/master/src/examples" rel="nofollow">https://github.com/tinygo-org/tinygo/tree/master/src/example...</a>
[2] <a href="https://github.com/tinygo-org/tinygo/blob/515daa7d3c9af18c78fd97d43cafda7e4dec6290/src/machine/machine_stm32f103xx.go#L156-L163" rel="nofollow">https://github.com/tinygo-org/tinygo/blob/515daa7d3c9af18c78...</a>
[3] <a href="https://gobyexample.com/channel-buffering" rel="nofollow">https://gobyexample.com/channel-buffering</a>
[4] <a href="https://github.com/tinygo-org/tinygo/issues/9#issuecomment-502468619" rel="nofollow">https://github.com/tinygo-org/tinygo/issues/9#issuecomment-5...</a>