From: Manfred Steiner Date: Sat, 30 Sep 2023 15:36:10 +0000 (+0200) Subject: merge witch master-sx, conflicts resolved X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=8a82411fe2c0cd71529685398d3f26f431518974;p=sx%2Fsimavr.git merge witch master-sx, conflicts resolved --- 8a82411fe2c0cd71529685398d3f26f431518974 diff --cc examples/simuc/src/main.cpp index 040fbf3,575165b..f7fde57 --- a/examples/simuc/src/main.cpp +++ b/examples/simuc/src/main.cpp @@@ -204,23 -199,13 +204,29 @@@ int main (int argc, char **argv) if (errno == 1) { return 1; } ++<<<<<<< HEAD + printf("----------------------------------------------------------------------\n"); + printf("available commands:\n"); + printf(" b (break), c (continue), s (stack), r (reset), p (power), q (quit)\n"); + printf("----------------------------------------------------------------------\n"); ++======= + printf("--------------------------------------------------------------------\n"); + printf("available commands: i (interrupt), c (continue), s (stack), r (reset), q (quit)\n"); + printf("--------------------------------------------------------------------\n"); ++>>>>>>> master-sx printf("init done - press key to start\n"); - getchar(); - printf("--------------------------------------------------------------------\n"); - start(); + char c = getchar(); + getchar(); // remove line feed from stdin + printf("----------------------------------------------------------------------\n"); + + switch (c) { + case 'b': start(CommandBreak, NULL); break; + case 's': start(CommandStack, NULL); break; + case 'r': start(CommandReset, NULL); break; + case 'p': start(CommandPower, NULL); break; + case 'q': return 0; + default: start(ReadyForNewCommand, NULL); break; + } // int cnt = 0; char *line = NULL; @@@ -238,7 -223,7 +244,11 @@@ // } if (getline(&line, &size, stdin) > 0) { ++<<<<<<< HEAD + const char *commands[] = { "quit", "break", "continue", "stack", "reset", "power" }; ++======= + const char *commands[] = { "quit", "interrupt", "continue", "stack", "reset" }; ++>>>>>>> master-sx try { int foundIndex = -1; int foundCnt = 0; @@@ -310,4 -295,4 +320,4 @@@ usleep(10000); return 0; --} ++} diff --cc examples/simuc/src/simavr/simavr.h index ff391bc,0184f5b..141084a --- a/examples/simuc/src/simavr/simavr.h +++ b/examples/simuc/src/simavr/simavr.h @@@ -93,10 -91,10 +93,10 @@@ public struct SimAvrEvent waitForEvent (); const char *eventText (EnumSimAvrEvent event); --public: ++public: void load (struct StartParameters *params); void shutdown (); - void start (); + void start (EnumSimAvrCommand cmd, void *param); void stop (); void addEvent (int event); void setUartDumpEnabled (bool enabled); @@@ -137,4 -134,4 +137,4 @@@ private --#endif // SIMAVR_H ++#endif // SIMAVR_H