ignored by the PICs. The host must send exactly as many bytes as are
necessary to include all of the reversal segments for each reversers
board (for every potential reversal segment, regardless of whether
-that segment is a defined segment corresponding to some actual track).
+that segment is a defined segment corresponding to some actual track;
+however a board with _no_ reversers segments used does not count).
For example, if there are 14 reversible segments (numbered 1 to 14)
then the following message
--- /dev/null
+/*
+ * realtime
+ * implementation of safety algorithm's decisions
+ */
+
+static int maxbytechange;
+static PicInsn polarityinsn= { { 0x90 }, 0 };
+
+void actual_inversions_start(void) {
+ polarityinsn.l= 0;
+}
+
+void actual_inversions_done(void) {
+ if (polarityinsn.l)
+ serial_transmit(&polarityinsn);
+}
+
+void actual_inversions_segment(SegmentNum);
my ($i,$objnum);
for ($i=0; $i<6; $i++) {
$objnum= boob2objnum($num,$i,'reverse',0);
+ fixme nreverses seems unused
$nreverses= $objnum+1 if $objnum >= $nreverses;
}
}
sub boob2objnum_reverse {
my ($boardnum,$obj,$boardtype)=@_;
+fixme need to map board num for reversers to
# Converts board and object number (in canonical pic number plus
- # and reverse0...reverse5 as seen on pinout diagrams), to
- # object number for POLARITY command numbered as shown in
+ # and reverse0...reverse5 as seen on pinout diagrams), to the
+ # segment number for POLARITY command numbered as shown in
# README.protocol.
#
# There are three basic stages:
# * We figure out which bit of which message byte the
# object corresponds to. (see reverse.asm, polarity_decode_message)
#
- # * We compute the README.protocol bit and byte number.
+ # * We compute the README.protocol segment number.
my ($cycle,$boardincycle,$cyclebasebyte,$byte,$bit);
die unless $boardtype eq 'reversers';
}
}
+sub redaction () {
+ for ($num=0, $mappednum=0; $num<@boardtype; $num++) {
+ next if $boardtype[$num] eq 'detectors';
+
+
sub nummap ($) {
my ($p) = @_;
$p =~ s/\d{1,6}/ sprintf "%06d%d",$&,$& /ge;
o("\n end\n");
}
mainread();
+redaction();
writeout();
writeasm();