The simulator code is compiled with different definitions than the rest of the code even when compiling the simulator. This was done originally to satisfy the compiler, but it was the wrong way to go. The result is that the main Teacup code may decide to do things one way (X_INVERT_DIR, for example) but the simulator code will do things a different way (no X_INVERT_DIR). Fix this by including the board and printer definitions also in the simulator code, and use a simple enum trick to give consistent definitions to the needed PIN definitions, safely ignoring the ones the config does not use. This requires that we include simulator.h after 'config.h' in all cases. Manage that by moving simulator.h from its previous home in arduino.h into config_wrapper.h. After this change we will be able to reliably communicate the expected state of the endstop pins from the simulator. |
||
|---|---|---|
| .. | ||
| analog_sim.c | ||
| data_recorder.c | ||
| data_recorder.h | ||
| delay_sim.c | ||
| heater_sim.c | ||
| intercom_sim.c | ||
| pff_diskio_sim.c | ||
| pff_sim.c | ||
| sd_sim.c | ||
| serial_sim.c | ||
| simulator.c | ||
| spi_sim.c | ||
| timer_ext.c | ||