Since the rest of the document, and most other XMOS documents that had code, usually begin by posting all the code, then decompose it explaining what each line is doing, I thought this was worth pointing out.richard wrote: I'm not sure what you mean - the documentation has the code needed to reconfigure the port inline with the text. You can get the complete example by concaternating all the code in this section.
Thanks :)richard wrote: Usually the examples are also available from the HowTo tab of the xTIMEcomposer. However in this case the example isn't available yet (it's in a queue to be published). For now I've posted the complete example below:
Code: Select all
#include <xs1.h> out port p = XS1_PORT_1A; int main() { out port * movable pp = &p; buffered out port:32 * movable buffered_p; buffered_p = reconfigure_port(move(pp), buffered out port:32); *buffered_p <: 0xa0a0a0a0; pp = reconfigure_port(move(buffered_p), out port); return 0; }