grbl/grbl — pull request #438 by ashelly (2014-07-05 13:58:43+00:00)
Title: Rework simulator in dev branch

This is a rework of the simulator to get it to run in the dev branch, and to allow it to run in approximate realtime. A design goal was to reduce the linkage and code duplication between the true Grbl code and the hardware simulation. The sim no longer duplicates main or the serial functions. There is now a tick-accurate simulation of the timer modules that runs in a separate thread. Keyboard input is non-blocking, so the Grbl code now runs in parallel with the simulated interrupts. There is an EEPROM simulator for adjusting the configuration. There are minimal hooks into the main code - they only exist for visibility into the planner, used for printing block output.

I've tried to ensure the output is as close as possible to the original sim. It accepts the same command line arguments as the original version, but has additional options (-h to view usage). Sim.bat successfully produces the HelloWorld.nc plot.

I've tested mainly on Linux (Ubuntu 12.04) and briefly on Windows w/ Mingw. Set "PLATFORM" in the makefile to select the correct environment.