TOPLLab / WARDuino

📟 A dynamic WebAssembly VM for embedded systems
https://topllab.github.io/WARDuino/
Mozilla Public License 2.0
80 stars 7 forks source link

Add platform independent reversible code #263

Open tolauwae opened 1 week ago

tolauwae commented 1 week ago

https://github.com/TOPLLab/WARDuino/blob/296fffd6ac38af2ada80ff7ffc4bc9ea046f793a/src/Primitives/arduino.cpp#L511-L522

This code will likely be the same for all chip_digital_write primitives, regardless of platform. Since you are just invoking the primitive.

(in fact this will the strategy for most primitives)

I think we can generalize this and move to a reversibility file to avoid code duplication. In will make implementing the reversibility for other primitives easier as well.

_Originally posted by @tolauwae in https://github.com/TOPLLab/WARDuino/pull/250#discussion_r1736111001_