rp-hal icon indicating copy to clipboard operation
rp-hal copied to clipboard

The entry point of a PIO program may not be its first instruction.

Open ithinuel opened this issue 3 years ago • 2 comments

Should there be a ways to skip this when the entry point is not the first instruction of the program (eg I2C)? https://github.com/rp-rs/rp-hal/blob/9d56062e447957f7304c31cbe7153abfe70a4f28/rp2040-hal/src/pio.rs#L1476-L1484

ithinuel avatar Nov 17 '21 21:11 ithinuel

Surely we always need a jump? But maybe we could take an offset to add to the program start (which is in the variable offset above).

thejpster avatar Nov 20 '21 20:11 thejpster

The resolution of that offset isn't trivial as on some program it may be the start of the program (so be the offset of the program in the memory) or be a label somewhere in the program itself (ie an entry_point or a wrap_target). I haven't thought too much about that but maybe using an Option<&Label> (provided the Label is bound).

ithinuel avatar Nov 20 '21 21:11 ithinuel