projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make serial test simpler
[fw/altos]
/
s51
/
s51-main.c
diff --git
a/s51/s51-main.c
b/s51/s51-main.c
index 27ed571aca68eb360f5267d8aaff33d27ee55720..96429988d5f4c16662d71667d3a669c98ecf7928 100644
(file)
--- a/
s51/s51-main.c
+++ b/
s51/s51-main.c
@@
-31,6
+31,7
@@
static double freq = 11059200;
char *s51_prompt = "> ";
struct ccdbg *s51_dbg;
int s51_interrupted = 0;
char *s51_prompt = "> ";
struct ccdbg *s51_dbg;
int s51_interrupted = 0;
+int s51_monitor = 0;
static FILE *s51_input;
static FILE *s51_output;
static FILE *s51_input;
static FILE *s51_output;
@@
-54,7
+55,7
@@
main(int argc, char **argv)
char *endptr;
struct sigvec vec, ovec;
char *endptr;
struct sigvec vec, ovec;
- while ((opt = getopt(argc, argv, "PVvHht:X:c:r:Z:s:S:p:")) != -1) {
+ while ((opt = getopt(argc, argv, "PVvHh
m
t:X:c:r:Z:s:S:p:")) != -1) {
switch (opt) {
case 't':
cpu = optarg;
switch (opt) {
case 't':
cpu = optarg;
@@
-100,6
+101,9
@@
main(int argc, char **argv)
case 'h':
usage ();
break;
case 'h':
usage ();
break;
+ case 'm':
+ s51_monitor = 1;
+ break;
}
}
if (s51_port) {
}
}
if (s51_port) {
@@
-146,7
+150,7
@@
main(int argc, char **argv)
perror("fdopen");
exit(1);
}
perror("fdopen");
exit(1);
}
- vec.sv_handler =
s51_sigint
;
+ vec.sv_handler =
SIG_IGN
;
vec.sv_mask = 0;
vec.sv_flags = 0;
sigvec(SIGINT, &vec, &ovec);
vec.sv_mask = 0;
vec.sv_flags = 0;
sigvec(SIGINT, &vec, &ovec);
@@
-174,10
+178,8
@@
s51_printf(char *format, ...)
va_start(ap, format);
vfprintf(s51_output, format, ap);
va_start(ap, format);
vfprintf(s51_output, format, ap);
-#if 1
- if (s51_port)
+ if (s51_monitor)
vfprintf(stdout, format, ap);
vfprintf(stdout, format, ap);
-#endif
va_end(ap);
}
va_end(ap);
}
@@
-197,10
+199,8
@@
s51_read_line(char *line, int len)
s51_putc('\0');
fflush(s51_output);
ret = fgets(line, len, s51_input) != NULL;
s51_putc('\0');
fflush(s51_output);
ret = fgets(line, len, s51_input) != NULL;
-#if 1
- if (s51_port)
+ if (s51_monitor)
printf("> %s", line);
printf("> %s", line);
-#endif
fflush(stdout);
return ret;
}
fflush(stdout);
return ret;
}