Is there a single debug terminal for multiple objects?
evanh Posts: 14,263
edited 2022-09-11 02:57 in PASM/Spin (P1)
Using FullDuplexSerial to emit debug prints from concurrent running objects like what can be achieved with Spin2's built-in Debug() but on the Prop1 instead. I'm guessing it would be a single instance of FullDuplexSerial. Has anyone done this? Is there any examples?
I remember this one:
It's quite old, so there may be newer better solutions.
Cool! Thanks .... reading it ... huh, so basically it's FullDuplexSerial with the VAR section replaced with a DAT section. I'm guessing it's not particularly safe code without any locks on the buffer indexing ... but then it's only for terminal prints.
The 4-port objects also keep the tx and rx buffers in DAT, so multiple instances share those same buffers. One port can be assigned for DEBUG, but as with SerialMirror, there are no built-in access locks on any of the ports.