From e58b256cc95740df9b6be8703b94d9b8621ef3ee Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 29 Dec 2005 00:41:03 +0000 Subject: [PATCH] reserve /^ [^ ;]/ for statements inserted for debugging purposes --- cebpic/manypics.make | 2 +- detpic/common.inc | 10 +++++----- detpic/detect.asm | 8 ++++---- detpic/detect.inc | 14 +++++++------- detpic/energy.asm | 8 ++++---- detpic/energy.fin | 20 ++++++++++---------- detpic/final.inc | 32 ++++++++++++++++---------------- detpic/i2clib.asm | 20 ++++++++++---------- detpic/i2clib.inc | 34 +++++++++++++++++----------------- detpic/make-panicworthy | 4 ++-- detpic/mascan.asm | 12 ++++++------ detpic/mascan.fin | 12 ++++++------ detpic/misc.asm | 6 +++--- detpic/misc.fin | 6 +++--- detpic/nmra-stream.asm | 8 ++++---- detpic/nmra-stream.fin | 10 +++++----- detpic/panic.asm | 6 +++--- detpic/panic.fin | 18 +++++++++--------- detpic/points.asm | 10 +++++----- detpic/points.fin | 26 +++++++++++++------------- detpic/program.asm | 6 +++--- detpic/program.fin | 6 +++--- detpic/reverse.asm | 10 +++++----- detpic/reverse.fin | 12 ++++++------ detpic/serout.asm | 6 +++--- detpic/serout.fin | 12 ++++++------ detpic/tick.asm | 8 ++++---- detpic/tick.fin | 4 ++-- detpic/variables.asm | 8 ++++---- detpic/vectors.fin | 8 ++++---- iwjpictest/syncwrite.asm | 6 +++--- layout/data2safety | 24 ++++++++++++------------ 32 files changed, 188 insertions(+), 188 deletions(-) diff --git a/cebpic/manypics.make b/cebpic/manypics.make index fe43038..c08e485 100644 --- a/cebpic/manypics.make +++ b/cebpic/manypics.make @@ -84,7 +84,7 @@ morse+auto.inc: $(CEBPIC)morse-generator morse.messages BEGIN { print "; autogenerated - do not edit\n"; } \ next unless m/^(\w+)\s/; \ next if m/^\w+\s+(?:equ|udata|udata_acs)\s+/; \ - print " extern $$1\n" or die $$!; \ + print " extern $$1\n" or die $$!; \ ' <$< $o %+morse.asm: $(CEBPIC)morse-generator morse.messages %+program.map diff --git a/detpic/common.inc b/detpic/common.inc index b512906..4efa996 100644 --- a/detpic/common.inc +++ b/detpic/common.inc @@ -203,12 +203,12 @@ load_tblptr macro value mov_lw value >> 8 mov_wf TBLPTRH - if value > 0xffff + if value > 0xffff mov_lw value >> 16 mov_wf TBLPTRU - else + else clr_f TBLPTRU - endif + endif endm load_perpic_tblptr macro flash_map_base, perpic_entry_size @@ -239,7 +239,7 @@ load_perpic_tblptr macro flash_map_base, perpic_entry_size ; and is 0 1 2 3 4 5 6 7. Generally p__ ; are equ'd for this. - radix hex + radix hex p0_cdu_enable equ 5b p0_rs232_fcin equ 4b p0_booster_shutdown equ 2b @@ -253,7 +253,7 @@ pall_pt0reverse equ 7b p0_spare0 equ 0a p0_booster_dirn equ 0c p0_booster_pwm equ 1c - radix dec + radix dec ; ; LAT* may be subject to read-modify-write, see below diff --git a/detpic/detect.asm b/detpic/detect.asm index ca6aca8..f5553e6 100644 --- a/detpic/detect.asm +++ b/detpic/detect.asm @@ -7,7 +7,7 @@ ; FSR2 is used as readout pointer - include common.inc + include common.inc ; I2C protocol is as follows: ; @@ -59,7 +59,7 @@ max_messages equ 4 - udata_acs + udata_acs unattendedl res 1 ; counts up; each det loop it is unattendedh res 1 ; incremented by no. of bytes of pc in @@ -162,7 +162,7 @@ slave_add_short_message ;---------- backgroundloop_again macro backgroundloop_whatever - local branchposition + local branchposition inc_f_ifnz unattendedl bra backgroundloop_whatever mov_lw branchposition - backgroundloop_whatever @@ -426,4 +426,4 @@ read_detection_head_master_badmore panic morse_DM ;====================================================================== - include final.inc + include final.inc diff --git a/detpic/detect.inc b/detpic/detect.inc index a882223..9d18003 100644 --- a/detpic/detect.inc +++ b/detpic/detect.inc @@ -1,7 +1,7 @@ - extern detect_local_init - extern detect_slave_init - extern slave_add_short_message - extern read_detection_head_master - extern backgroundloop_master - extern backgroundloop_reversers - extern backgroundloop_detectors + extern detect_local_init + extern detect_slave_init + extern slave_add_short_message + extern read_detection_head_master + extern backgroundloop_master + extern backgroundloop_reversers + extern backgroundloop_detectors diff --git a/detpic/energy.asm b/detpic/energy.asm index 59aa76b..b1429c4 100644 --- a/detpic/energy.asm +++ b/detpic/energy.asm @@ -1,7 +1,7 @@ ;====================================================================== ; TRACK POWER AND SHORT CIRCUIT - include common.inc + include common.inc settling_timeout equ 10000 ; us @@ -10,12 +10,12 @@ stopflash_timeout equ 25000 ; us retry_timeout equ 50000 ; us persist_timeout equ 90000 ; us - udata_acs + udata_acs settling res 1 ; all counters are 0 if stopped stop_wait res 1 ; or otherwise count down retry_wait res 1 - code + code ;====================================================================== ; @@ -213,4 +213,4 @@ power_panichook return ;====================================================================== - include final.inc + include final.inc diff --git a/detpic/energy.fin b/detpic/energy.fin index 0855246..8a7d95a 100644 --- a/detpic/energy.fin +++ b/detpic/energy.fin @@ -1,10 +1,10 @@ - extern command_power - extern power_polarising_init - extern power_polarising_tick - extern power_polarising_begin - extern power_polarising_settling - extern power_fault_init - extern power_fault_intrl - extern power_fault_tick - extern power_fault_tickdiv - extern power_panichook + extern command_power + extern power_polarising_init + extern power_polarising_tick + extern power_polarising_begin + extern power_polarising_settling + extern power_fault_init + extern power_fault_intrl + extern power_fault_tick + extern power_fault_tickdiv + extern power_panichook diff --git a/detpic/final.inc b/detpic/final.inc index 24a2dab..e28c80b 100644 --- a/detpic/final.inc +++ b/detpic/final.inc @@ -1,18 +1,18 @@ - include ../iwjpictest/syncwrite.inc - include detect.inc - include energy.fin - include i2clib+panic.inc - include mascan.fin - include misc.fin - include nmra-stream.fin - include panic.fin - include points.fin - include program.fin - include reverse.fin - include routines-led.fin - include serout.fin - include tick.fin - include variables+vars.fin - include vectors.fin + include ../iwjpictest/syncwrite.inc + include detect.inc + include energy.fin + include i2clib+panic.inc + include mascan.fin + include misc.fin + include nmra-stream.fin + include panic.fin + include points.fin + include program.fin + include reverse.fin + include routines-led.fin + include serout.fin + include tick.fin + include variables+vars.fin + include vectors.fin end diff --git a/detpic/i2clib.asm b/detpic/i2clib.asm index 2fb1cb0..7b05905 100644 --- a/detpic/i2clib.asm +++ b/detpic/i2clib.asm @@ -3,14 +3,14 @@ ; ; See i2clib.asm for documentation of the interface to this file. - include /usr/share/gputils/header/p18f458.inc - radix dec - include ../iwjpictest/insn-aliases.inc + include /usr/share/gputils/header/p18f458.inc + radix dec + include ../iwjpictest/insn-aliases.inc - include ../iwjpictest/clockvaries.inc - include panic.inc - include morse+auto.inc - include i2clib.incm + include ../iwjpictest/clockvaries.inc + include panic.inc + include morse+auto.inc + include i2clib.incm ;====================================================================== ; NOTATION @@ -493,7 +493,7 @@ s_event_bad ;====================================================================== - include panic.fin - include i2clib.inc + include panic.fin + include i2clib.inc - end + end diff --git a/detpic/i2clib.inc b/detpic/i2clib.inc index 99f8006..296b115 100644 --- a/detpic/i2clib.inc +++ b/detpic/i2clib.inc @@ -63,7 +63,7 @@ ; COMMON ADMINISTRATIVE ROUTINES ;-------------------- - extern i2cm_init + extern i2cm_init ; ; Initialises the i2c system for use by a master PIC. Must be called ; exactly once, which must be before any other i2c?_... function. @@ -74,7 +74,7 @@ ; State Not-in-use Idle (as master) ;-------------------- - extern i2cs_init + extern i2cs_init ; ; Initialises the i2c system for use by a slave PIC. Must be called ; exactly once, which must be before any other i2c?_... function. @@ -87,9 +87,9 @@ ; W slave number any ;-------------------- - extern i2cm_interrupt - extern i2cm_interrupt_definite - extern i2cs_interrupt + extern i2cm_interrupt + extern i2cm_interrupt_definite + extern i2cs_interrupt ; ; Must be called by the main program's interrupt handler; ; high-priority for the slave or low-priority for the master. @@ -155,7 +155,7 @@ ; `-------------------------------------' ;-------------------- - extern i2cmu_done + extern i2cmu_done ; Called to notify that the previous conversation with the slave has ; been finished as requested. The i2c system is now available and @@ -173,7 +173,7 @@ ; MASTER - WRITES (ie, transmission of data to the slave) ;-------------------- - extern i2cm_write_start + extern i2cm_write_start ; ; Requests that a slave be contacted for writing. When communication ; has been established, i2cmu_write_next_byte will be called. @@ -182,7 +182,7 @@ ; State Idle/Reading-Wait Writing-Setup ; W slave number any - extern i2cmu_write_next_byte + extern i2cmu_write_next_byte ; ; Called to notify the main program that we are now ready to transmit ; a byte to the slave that we're currently talking to. This may be @@ -219,7 +219,7 @@ ; MASTER - READS (ie, reception of data from the slave) ;-------------------- - extern i2cm_read_start + extern i2cm_read_start ; ; Requests that a slave be contacted for reading. When communication ; has been established and the first byte received, @@ -229,7 +229,7 @@ ; State Idle/Reading-Wait Reading-Busy ; W slave number any - extern i2cmu_read_got_byte + extern i2cmu_read_got_byte ; ; Called to notify the main program that a byte has been recieved from ; the slave PIC. The byte value is supplied. Communication with the @@ -241,7 +241,7 @@ ; State Reading Reading-Wait ; W data from slave - extern i2cm_read_another + extern i2cm_read_another ; ; Requests that the communication with the slave continue and another ; byte be read. When this is complete, i2cmu_read_got_byte will be @@ -250,7 +250,7 @@ ; At call On return ; State Reading-Wait Reading-Busy - extern i2cm_read_done + extern i2cm_read_done ; ; Requests that reading from the slave be terminated. When the ; conversation is finished and the bus and i2c controller are free @@ -293,7 +293,7 @@ ; SLAVE - WRITES (ie, reception of data from the master) ;-------------------- - extern i2csu_write_begin + extern i2csu_write_begin ; ; Called to notify the main program that the master PIC has selected this ; slave to talk to, for writing. There is no data at this stage; when @@ -303,7 +303,7 @@ ; State Idle Receiving Receiving ;-------------------- - extern i2csu_write_data + extern i2csu_write_data ; ; Called to notify the main program that the master PIC has ; transmitted a byte of data. Provides the byte we received. @@ -316,7 +316,7 @@ ; SLAVE - READS (ie, transmission of data to the master) ;-------------------- - extern i2csu_read_begin + extern i2csu_read_begin ; ; Called to notify the main program that the master PIC has selected ; this slave to talk to, for reading. The main program should invoke @@ -327,7 +327,7 @@ ; State Idle Transmit-Wait ;-------------------- - extern i2cs_read_data + extern i2cs_read_data ; Transmits the byte of data to the master ; ; Beforehand At call On return @@ -338,7 +338,7 @@ ; in i2clib.incm, which does the same thing. ;-------------------- - extern i2csu_read_another + extern i2csu_read_another ; ; Called to notify the main program that the master PIC has continued ; by asking for another byte of data. The main program should once diff --git a/detpic/make-panicworthy b/detpic/make-panicworthy index 9f127cf..94db34f 100755 --- a/detpic/make-panicworthy +++ b/detpic/make-panicworthy @@ -36,7 +36,7 @@ if (m/^(\w*)\s+code\b/) { } elsif (m/^(\w*)\s+(?:equ)\b/) { } elsif (m/^\s+extern\s+(\w+)\b/) { mangle($1); - print " extern $pfx$1;##\n" or die $! + print " extern $pfx$1;##\n" or die $! unless $manglout; } elsif (!$inmacro && defined $codesection) { if (!s/^\;/;\#\#/) { @@ -49,7 +49,7 @@ if (m/^(\w*)\s+code\b/) { $l= ''; } if (m/^\s+include\s+(\S+)\s+$/ && exists $mapinclude{$1}) { - $l= " include $mapinclude{$1}\n"; + $l= " include $mapinclude{$1}\n"; } print $l or die $! unless $manglout; diff --git a/detpic/mascan.asm b/detpic/mascan.asm index 6ebc485..a9f63d6 100644 --- a/detpic/mascan.asm +++ b/detpic/mascan.asm @@ -1,10 +1,10 @@ ;====================================================================== ; MASTER - SCANNING ETC. - include common.inc + include common.inc ;---------------------------------------------------------------------- - udata_acs + udata_acs ; for reading and detection: b res 1 ; byte just read @@ -31,7 +31,7 @@ i2c_getwritebyte_yes bc_f STATUS, Z ; yes, we want to write this byte return ; from i2cmu_write_next_byte - code + code ;---------------------------------------- i2cmu_write_next_byte ; add calls to getwritebyte_ here: @@ -331,10 +331,10 @@ mascan_init_ifabsent bra mascan_init_loop ; we've read the whole flash table - if slavetable == 0x400 + if slavetable == 0x400 bt_f_if1 FSR0H, 0 bra mascan_bad_toomany - endif + endif clr_f POSTINC0 ; ste_slave mov_lw (1< is new reverse bit return - code + code ;---------- polarity_local_init load_perpic_tblptr picno2revmasks, 2 @@ -268,4 +268,4 @@ polarity_getwritebyte return ;====================================================================== - include final.inc + include final.inc diff --git a/detpic/reverse.fin b/detpic/reverse.fin index fc313d4..2b9bb45 100644 --- a/detpic/reverse.fin +++ b/detpic/reverse.fin @@ -1,6 +1,6 @@ - extern command_polarity - extern polarity_local_do - extern polarity_local_init - extern polarity_master_init - extern polarity_needwrite - extern polarity_getwritebyte + extern command_polarity + extern polarity_local_do + extern polarity_local_init + extern polarity_master_init + extern polarity_needwrite + extern polarity_getwritebyte diff --git a/detpic/serout.asm b/detpic/serout.asm index b7925bc..9875e65 100644 --- a/detpic/serout.asm +++ b/detpic/serout.asm @@ -1,8 +1,8 @@ ;====================================================================== ; SERIAL PORT - TRANSMISSION TO HOST - include common.inc - code + include common.inc + code ;---------------------------------------- serial_addbyte ; W byte to xmit to host trashed @@ -113,4 +113,4 @@ serialtxbuf_init goto serial_addbyte ;====================================================================== - include final.inc + include final.inc diff --git a/detpic/serout.fin b/detpic/serout.fin index 894bd57..b379166 100644 --- a/detpic/serout.fin +++ b/detpic/serout.fin @@ -1,6 +1,6 @@ - extern serial_addbyte - extern serial_addbyte_another - extern serialtx_intrl - extern serialtxfc_init - extern serialtxbuf_init - extern portb_read + extern serial_addbyte + extern serial_addbyte_another + extern serialtx_intrl + extern serialtxfc_init + extern serialtxbuf_init + extern portb_read diff --git a/detpic/tick.asm b/detpic/tick.asm index a039eb6..00ac380 100644 --- a/detpic/tick.asm +++ b/detpic/tick.asm @@ -4,12 +4,12 @@ ; after tick_init, and after interrupts enabled, ; we call _tick every 1ms and _tickdiv every ms. - include common.inc + include common.inc - udata_acs + udata_acs tickdiv_count res 1 - code + code ;---------------------------------------- tick_init ; Timer 2 any used for tick @@ -55,4 +55,4 @@ tickdiv_do intrl_handled_nostack ;---------------------------------------------------------------------- - include final.inc + include final.inc diff --git a/detpic/tick.fin b/detpic/tick.fin index 18adad3..a0013e4 100644 --- a/detpic/tick.fin +++ b/detpic/tick.fin @@ -1,2 +1,2 @@ - extern tick_init - extern tick_intrl + extern tick_init + extern tick_intrl diff --git a/detpic/variables.asm b/detpic/variables.asm index 65df513..afcba6e 100644 --- a/detpic/variables.asm +++ b/detpic/variables.asm @@ -1,8 +1,8 @@ ;====================================================================== - include pindata.inc + include pindata.inc - udata_acs + udata_acs picno res 1 ; from first idlocs byte idloc1 res 1 ; from 2nd idlocs byte; bit 7 is master: @@ -63,7 +63,7 @@ slavetable_section udata slavetable ; each board actually present has an entry in this table ste_szln2 equ 3 ste_size equ (1<> 7, ucfirst($boardtype[$num]), $base & 0x7f, $num); } o_section_end_fill($num, 0, 2); @@ -530,7 +530,7 @@ sub writeasm_pt { ; or boards with no points are all-bits-0. END for ($num=0; $num<@boardtype; $num++) { - if (!defined $boardtype[$num]) { o(" dw 0\t\t\t\t; $num"); next; } + if (!defined $boardtype[$num]) { o(" dw 0\t\t\t\t; $num"); next; } die if $maxptixln2 < 4; # must be whole no. of 16-bit words $elemsize= 1 << ($maxptixln2-3); for ($byte=0; $byte < $elemsize; $byte++) { @@ -557,7 +557,7 @@ END ; Index: 00Dppppp where D is 1 iff detectors board and p is pt ix ; Value: 0ppp0bbb where p is port num and b is bit num; or 0xff END - o(" radix hex\n"); + o(" radix hex\n"); for ($typeix=0; $typeix<2; $typeix++) { $type= qw(reversers detectors)[$typeix]; die $type unless $pin_info{$type}; @@ -574,7 +574,7 @@ END } o("\n"); } - o(" radix dec\n\n"); + o(" radix dec\n\n"); } sub writeasm_reverse { @@ -594,7 +594,7 @@ END $pu->[1] =~ m/^([04])\,\d,(0x\w{2})$/ or die; push @{ $portae[!!$1] }, $2; } - o(' db '); + o(' db '); o(join(', ', map { @$_ ? join('|',@$_) : '0' } @portae)); o(sprintf " ; %d\n",$num); } @@ -606,14 +606,14 @@ sub writeasm () { close STDOUT or die $!; open STDOUT, ">$basename+pindata.asm" or die $!; o("; autogenerated - do not edit\n"); - o(" include pindata.inc\n". - " radix dec\n". + o(" include pindata.inc\n". + " radix dec\n". "ff equ 0xff\n"); $each= 10; for $k (@objkinds) { &{"writeasm_$k"}(); } - o("\n end\n"); + o("\n end\n"); } mainread(); writeout(); -- 2.30.2