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;
// }
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;
usleep(10000);
return 0;
--}
++}
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);
--#endif // SIMAVR_H
++#endif // SIMAVR_H