diff --git a/mendel.c b/mendel.c index 4fc1d41..019a38e 100644 --- a/mendel.c +++ b/mendel.c @@ -232,12 +232,9 @@ void init(void) { /// /// just run init(), then run an endless loop where we pass characters from the serial RX buffer to gcode_parse_char() and check the clocks #ifdef SIMULATOR -int g_argc; -char** g_argv; int main (int argc, char** argv) { - g_argc = argc; - g_argv = argv; + sim_start(argc, argv); #else int main (void) { diff --git a/simulator/simulator.c b/simulator/simulator.c index 971b172..b284902 100644 --- a/simulator/simulator.c +++ b/simulator/simulator.c @@ -27,6 +27,15 @@ volatile uint8_t DIO3_WPORT, DIO4_WPORT; +int g_argc; +char** g_argv; +void sim_start(int argc, char** argv) { + // TODO: Parse args here and open the serial port instead of saving them + // for serial_init. + // Save these for the serial_init code + g_argc = argc; + g_argv = argv; +} /* -- debugging ------------------------------------------------------------ */