Restoring state after abort during remap
(too old to reply)
John Morris
2017-03-30 17:55:22 UTC
Raw Message
During execution, remap functions may alter machine state such as interp
modal states or HAL pins (via M62-M68). These functions may then
restore previous state before returning.

If a remap is aborted mid-execution, any cleanup code is also aborted.
There is currently no way to ensure that the machine is not left in an
unexpected or inconsistent state.

A first idea to address this is, alongside the current `prolog`, `body`
and `epilog` functions, to add an additional `cleanup` or `except` remap
function, guaranteed to always execute, even after an abort. How this
would work in the context of the running interpreter, I can't yet say.

Have others noticed this problem before, and think it's important to
address? It would be great to hear of examples others have encountered
and ideas for solutions. If there's interest, I would be happy to
collaborate on and share a solution in this forum.