From f393dcb7b3de156ccaf4c20c9a9a8eab18a03181 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 4 Jan 2005 20:25:33 +0000 Subject: [PATCH] fit in 80 columns --- cebpic/nmra-stream.asm | 57 +++++++++++++++++++++++------------------- detpic/nmra-stream.asm | 57 +++++++++++++++++++++++------------------- 2 files changed, 62 insertions(+), 52 deletions(-) diff --git a/cebpic/nmra-stream.asm b/cebpic/nmra-stream.asm index adb3264..c6640a7 100644 --- a/cebpic/nmra-stream.asm +++ b/cebpic/nmra-stream.asm @@ -1,5 +1,6 @@ -; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: high H = green, low L = red, float Z = black +; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: +; high H = green, low L = red, float Z = black @@ -20,7 +21,7 @@ TOTRACKBIT equ 0x3 ; byte 3: bit location of pointer within byte org 0 goto initialise -;***************************************************************************************** +;**************************************************************************** ; high priority interrupt @@ -32,11 +33,11 @@ TOTRACKBIT equ 0x3 ; byte 3: bit location of pointer within byte org 000018h goto interrupt_low -;***************************************************************************************** +;**************************************************************************** code -;***************************************************************************************** +;**************************************************************************** macros @@ -49,11 +50,13 @@ debug macro debugvalue endm debug_serial_transmit -*** check and wait for flag so that it works if we debug twice in quick succession -iwj - movwf TXREG,0 ; move contents of W (i.e. debugvalue) to TXREG for transmission +*** check and wait for flag so that it +*** works if we debug twice in quick succession -iwj + movwf TXREG,0 ; move contents of W (i.e. debugvalue) + ; to TXREG for transmission return -;***************************************************************************************** +;**************************************************************************** initialise @@ -75,7 +78,7 @@ initialise bsf SPBRG,7,0 bsf SPBRG,0,0 -;----------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------- ; timer 0 set-up @@ -92,7 +95,7 @@ initialise bcf T0CON,0,0 ; } -;----------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------- ; initialise buffers (for BSR5, for nmra from-serial/to-track buffers) @@ -100,12 +103,12 @@ initialise movwf BSR,0 ; set BSR to 5 clrf NMRACTRL,0 ; for bits relevant to control of nmra stream - clrf FROMSERIAL,0 ; for location of write-from-usart pointer within BSR5 - clrf TOTRACK,0 ; for location of send-to-track pointer within BSR5 + clrf FROMSERIAL,0 ; for loc'n of write-from-usart ptr within BSR5 + clrf TOTRACK,0 ; for loc'n of send-to-track ptr within BSR5 ; all in access bank -;----------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------- ; initialise next action/transmit bit @@ -125,7 +128,7 @@ initialise bsf PORTC,1,0 ; booster pwm high -;----------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------- ; interrupt set-up @@ -147,7 +150,7 @@ initialise *** generate a spurious high-priority interrupt -iwj -;***************************************************************************************** +;**************************************************************************** main_loop_led call led_green @@ -155,29 +158,29 @@ main_loop_led *** do you really mean to set the led green in a tight loop ?? -iwj -;***************************************************************************************** +;**************************************************************************** interrupt_high goto panic -;***************************************************************************************** +;**************************************************************************** interrupt_low ; check which interrupt. Branch to serial_receive or timer or return - btfss PIR1,5,0 ; check whether serial receive interrupt bit set + btfss PIR1,5,0 ; check whether serial recv interrupt bit set goto serial_receive btfss INTCON,2,0 ; check whether timer0 interrupt set goto timer0_interrupt goto panic -; if 2 interrupts are set at once the 2nd will generate a new interrupt on leaving -; the interrupt routine +; if 2 interrupts are set at once the 2nd will generate a new +; interrupt on leaving the interrupt routine ; *** we hope and trust -iwj -;***************************************************************************************** +;**************************************************************************** serial_receive movff FROMSERIAL,FSR0L ; set low byte of IND0 pointer @@ -218,13 +221,13 @@ fromserial_overflow return -;***************************************************************************************** +;**************************************************************************** timer0_interrupt bcf INTCON,2,0 ; clear interrupt-set bit movlw 0x6E - movwf W,TMR0L ; set timer0 to 0x6E (so that interrupt takes 58us) + movwf W,TMR0L ; set timer0 to 0x6E (so interrupt takes 58us) ; check next action - if 0, change to 1 and return @@ -316,7 +319,8 @@ advance_bit advance_pointer -; currently on bit 7 of the byte, after having read rest of byte to track; check whether it is 1 or 0 +; currently on bit 7 of the byte, after having read rest of byte to +; track; check whether it is 1 or 0 movff TOTRACK,FSR1L movlw 5 @@ -379,7 +383,7 @@ advance_read_byte -;***************************************************************************************** +;**************************************************************************** led_green @@ -388,7 +392,8 @@ led_green return led_black - bsf TRISD,2,0 ; make pin RD2 an input (i.e. set Z, black) (DS100) + bsf TRISD,2,0 ; make pin RD2 an input (i.e. set Z, black) + ; (DS100) return led_red @@ -405,6 +410,6 @@ panic_loop call led_red goto panic_loop -;***************************************************************************************** +;**************************************************************************** end diff --git a/detpic/nmra-stream.asm b/detpic/nmra-stream.asm index adb3264..c6640a7 100644 --- a/detpic/nmra-stream.asm +++ b/detpic/nmra-stream.asm @@ -1,5 +1,6 @@ -; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: high H = green, low L = red, float Z = black +; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: +; high H = green, low L = red, float Z = black @@ -20,7 +21,7 @@ TOTRACKBIT equ 0x3 ; byte 3: bit location of pointer within byte org 0 goto initialise -;***************************************************************************************** +;**************************************************************************** ; high priority interrupt @@ -32,11 +33,11 @@ TOTRACKBIT equ 0x3 ; byte 3: bit location of pointer within byte org 000018h goto interrupt_low -;***************************************************************************************** +;**************************************************************************** code -;***************************************************************************************** +;**************************************************************************** macros @@ -49,11 +50,13 @@ debug macro debugvalue endm debug_serial_transmit -*** check and wait for flag so that it works if we debug twice in quick succession -iwj - movwf TXREG,0 ; move contents of W (i.e. debugvalue) to TXREG for transmission +*** check and wait for flag so that it +*** works if we debug twice in quick succession -iwj + movwf TXREG,0 ; move contents of W (i.e. debugvalue) + ; to TXREG for transmission return -;***************************************************************************************** +;**************************************************************************** initialise @@ -75,7 +78,7 @@ initialise bsf SPBRG,7,0 bsf SPBRG,0,0 -;----------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------- ; timer 0 set-up @@ -92,7 +95,7 @@ initialise bcf T0CON,0,0 ; } -;----------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------- ; initialise buffers (for BSR5, for nmra from-serial/to-track buffers) @@ -100,12 +103,12 @@ initialise movwf BSR,0 ; set BSR to 5 clrf NMRACTRL,0 ; for bits relevant to control of nmra stream - clrf FROMSERIAL,0 ; for location of write-from-usart pointer within BSR5 - clrf TOTRACK,0 ; for location of send-to-track pointer within BSR5 + clrf FROMSERIAL,0 ; for loc'n of write-from-usart ptr within BSR5 + clrf TOTRACK,0 ; for loc'n of send-to-track ptr within BSR5 ; all in access bank -;----------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------- ; initialise next action/transmit bit @@ -125,7 +128,7 @@ initialise bsf PORTC,1,0 ; booster pwm high -;----------------------------------------------------------------------------------------- +;---------------------------------------------------------------------------- ; interrupt set-up @@ -147,7 +150,7 @@ initialise *** generate a spurious high-priority interrupt -iwj -;***************************************************************************************** +;**************************************************************************** main_loop_led call led_green @@ -155,29 +158,29 @@ main_loop_led *** do you really mean to set the led green in a tight loop ?? -iwj -;***************************************************************************************** +;**************************************************************************** interrupt_high goto panic -;***************************************************************************************** +;**************************************************************************** interrupt_low ; check which interrupt. Branch to serial_receive or timer or return - btfss PIR1,5,0 ; check whether serial receive interrupt bit set + btfss PIR1,5,0 ; check whether serial recv interrupt bit set goto serial_receive btfss INTCON,2,0 ; check whether timer0 interrupt set goto timer0_interrupt goto panic -; if 2 interrupts are set at once the 2nd will generate a new interrupt on leaving -; the interrupt routine +; if 2 interrupts are set at once the 2nd will generate a new +; interrupt on leaving the interrupt routine ; *** we hope and trust -iwj -;***************************************************************************************** +;**************************************************************************** serial_receive movff FROMSERIAL,FSR0L ; set low byte of IND0 pointer @@ -218,13 +221,13 @@ fromserial_overflow return -;***************************************************************************************** +;**************************************************************************** timer0_interrupt bcf INTCON,2,0 ; clear interrupt-set bit movlw 0x6E - movwf W,TMR0L ; set timer0 to 0x6E (so that interrupt takes 58us) + movwf W,TMR0L ; set timer0 to 0x6E (so interrupt takes 58us) ; check next action - if 0, change to 1 and return @@ -316,7 +319,8 @@ advance_bit advance_pointer -; currently on bit 7 of the byte, after having read rest of byte to track; check whether it is 1 or 0 +; currently on bit 7 of the byte, after having read rest of byte to +; track; check whether it is 1 or 0 movff TOTRACK,FSR1L movlw 5 @@ -379,7 +383,7 @@ advance_read_byte -;***************************************************************************************** +;**************************************************************************** led_green @@ -388,7 +392,8 @@ led_green return led_black - bsf TRISD,2,0 ; make pin RD2 an input (i.e. set Z, black) (DS100) + bsf TRISD,2,0 ; make pin RD2 an input (i.e. set Z, black) + ; (DS100) return led_red @@ -405,6 +410,6 @@ panic_loop call led_red goto panic_loop -;***************************************************************************************** +;**************************************************************************** end -- 2.30.2