-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
WARDuino/src/Primitives/arduino.cpp
Lines 511 to 522 in 296fffd
| def_prim_reverse(chip_digital_write) { | |
| for (IOStateElement state : external_state) { | |
| if (!state.output) { | |
| continue; | |
| } | |
| if (state.key[0] == 'p') { | |
| invoke_primitive(m, "chip_digital_write", stoi(state.key.substr(1)), | |
| (uint32_t)state.value); | |
| } | |
| } | |
| } |
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 #250 (comment)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Scheduled