/*---------- adjucts ----------*/
static void adj_updated_cmd(AdjunctsAddr *a, int ix, Nmra *n /*destroyed*/) {
- assert(a->rn[ix].pi.l);
- retransmit_relaxed_cancel(&a->rn[ix]);
+ if (a->rn[ix].pi.l)
+ retransmit_relaxed_cancel(&a->rn[ix]);
retransmit_relaxed_queue(&a->rn[ix], n);
+ assert(a->rn[ix].pi.l);
}
static void adj_updated_funcs(AdjunctsAddr *a, int ix,
void adjuncts_start_xmit(void) {
AdjunctsAddr **ap;
- Nmra n;
- int ix, ai;
+ int ai;
for (ai=0,ap=adjaddrs; ai<n_adjaddrs; ai++,ap++) {
AdjunctsAddr *a= *ap;
- for (ix=0; ix<ADJUNCTSADDR_TRANSMITS; ix++) {
- RetransmitRelaxedNode *rn= &a->rn[ix];
- if (!rn->pi.l) {
- enco_nmra_idle(&n);
- retransmit_relaxed_queue(rn,&n);
- }
- }
adjuncts_updated(a);
}
}
* retransmit.c only; as a special exception, caller may edit pi
* directly. Normally, though, pi is set by supplying an NMRA
* command to one of the _queue functions; iff the Nmra* is
- * non-null, _queue will add an NMRA checksum and update pi.
+ * non-null, _queue will add an NMRA checksum (modifying *n)
+ * and update pi (which always results in a nonzero pi.l).
*/
struct RetransmitRelaxedNode {
PicInsn pi;