< 0 000 0100 (ENQ) WAGGLED Pin changed according to WAGGLE
< 0 0100 PPP (20+) POINTED Point change done using capacitor P
< 0 0101 PPP (28+) CHARGED Point capacitor P is now charged
+ < 0 00000 00 NUL Junk, prob because layout turned off
< 0 00000 FF NMRADONE Have processed F NMRADATA message(s)
< 0000 1010 (LF) } debugging output 0x0a (newline) and
void on_pic_nmradone(const PicInsnInfo *pii, const PicInsn *pi, int objnum) {
- if (!objnum) die("PIC sent NUL!");
+ assert(objnum);
if (sta_state == Sta_Run || sta_state == Sta_Manual)
while (objnum--)
retransmit_something();
timefor_ping(0);
}
+static void sta_startup_manual(void) {
+ waggle_startup_manual();
+ retransmit_start();
+ oprintf(UPO, "stastate %s\n", stastatelist[sta_state]);
+}
+
void sta_startup(void) {
- if (sta_state != Sta_Manual) {
- sta_goto(Sta_Flush);
- } else {
- waggle_startup_manual();
- retransmit_start();
- }
+ if (sta_state == Sta_Manual) sta_startup_manual();
+ else sta_goto(Sta_Flush);
}
+
void sta_finalising_done(void) { sta_goto(Sta_Run); }
static void sta_goto(StartupState new_state) {
pii->input_fn(pii,buf,obj);
}
+void on_pic_nul(const PicInsnInfo *pii, const PicInsn *pi, int objnum) {
+ /* layout turned off, probably */
+ if (sta_state == Sta_Manual) return;
+ enco_pic_off(&piob);
+ serial_transmit(&piob);
+ sta_goto(Sta_Flush);
+ return;
+}
+
void on_pic_pong(const PicInsnInfo *pii, const PicInsn *pi, int objnum) {
if (sta_state == Sta_Manual)
return;