Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3847

SDK • Re: Export labels from pioasm to C code

$
0
0
Regarding the 'origin' statement, isn't that the case with .wrap too? The assembler generates code to add the loaded offset to the wrap statements, so presumably I can just add my offset to the label as well. In any case, it works for the purpose I had in mind.
Yes. pio_add_program() returns the offset at which your program has been loaded, so you just add that to your label when using it.

Useful for things like:

Code:

    pio_sm_exec(pio, SM_NO, pio_encode_jmp(offset + my_label));
to switch between two related programs (Tx and Rx for example).

Statistics: Posted by arg001 — Sat Mar 02, 2024 5:07 pm



Viewing all articles
Browse latest Browse all 3847

Trending Articles