qprintf("\n");
}
-void ouhexo(const char *word, const Byte *command, int length) {
+void ouhex(const char *word, const Byte *command, int length) {
qouhex(word,command,length, ouprintf);
}
-void ouhexi(const char *word, const Byte *command, int length) {
+void ouhex_nosim(const char *word, const Byte *command, int length) {
qouhex(word,command,length, ouprintf_only);
}
}
if (!suppress && picio_send_noise >= 2)
- ouhexo("picioh out", pi->d, pi->l);
+ ouhex("picioh out", pi->d, pi->l);
/* note that the serial port is still in nonblocking mode. if
* we ever buffer up far enough that the kernel wants to make us
void oupicio(const char *dirn, const PicInsnInfo *pii, int obj, int v,
void (*qprintf)(const char *fmt, ...));
-void ouhexi(const char *word, const Byte *command, int length);
-void ouhexo(const char *word, const Byte *command, int length);
+void ouhex(const char *word, const Byte *command, int length);
+void ouhex_nosim(const char *word, const Byte *command, int length);
void serial_transmit(const PicInsn *pi);
void command_doline(ParseState *ps, CommandInput *cmdi_arg);
/*---------- ping ----------*/
static int pong_seq;
-static TimeoutEvent ping_toev= { .pclass=toev_fast_pclass, .pinst="ping" };
+static TimeoutEvent ping_toev= { .pinst="ping" };
static void timedout_ping(TimeoutEvent *toev) {
assert(sta_state >= Sta_Ping);
enco_pic_ping(&piob, pong_seq ^ PING_PONG_PATTERN);
serial_transmit(&piob);
ping_toev.callback= timedout_ping;
+ ping_toev.pclass= "startup";
toev_start(&ping_toev);
}
assert(buf->l > 0);
if (sta_state == Sta_Flush) {
- ouhexi("picioh in junk", buf->d, buf->l);
+ ouhex("picioh in junk", buf->d, buf->l);
toev_start(&sta_toev);
return; /* junk absolutely everything */
}
if (PICMSG_AAARGH_P(buf->d[0])) {
- ouhexi("picioh in aaargh", buf->d, buf->l);
+ ouhex("picioh in aaargh", buf->d, buf->l);
die("PIC sent us AAARGH!");
}
if (PICMSG_HELLO_P(buf->d[0])) {
- ouhexi("picioh in hello", buf->d, 1);
+ ouhex("picioh in hello", buf->d, 1);
if (sta_state != Sta_Manual)
sta_goto(Sta_Flush);
buf->l= 1;
return;
}
if (sta_state == Sta_Off) {
- ouhexi("picioh in off", buf->d, 1);
+ ouhex("picioh in off", buf->d, 1);
buf->l= 1;
return;
}
goto found_end;
if (buf->l == sizeof(buf->d)) {
- ouhexi("picioh in toolong", buf->d, buf->l);
+ ouhex("picioh in toolong", buf->d, buf->l);
die("PIC sent packet too long");
}
buf->l= 0; /* message not yet finished, so consume nothing */
suppress= pii && pii->noiselevel > picio_send_noise;
if (!suppress && picio_send_noise >= 2)
- ouhexi("picioh in msg", buf->d, buf->l);
+ ouhex_nosim("picioh in msg", buf->d, buf->l);
if (simlog_full || sta_state < Sta_Settling ||
!((pii->opcode==PICMSG_NMRADONE && obj==1) ||
ping_toev.duration= 1000;
ping_toev.callback= timefor_ping;
+ ping_toev.pclass= toev_fast_pclass;
toev_start(&ping_toev);
if (sta_state == Sta_Ping)