From: ceb Date: Mon, 3 Jan 2005 19:27:27 +0000 (+0000) Subject: Added debugging macro to nmra-stream.asm, to write debugging info out over X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=35d24814381fffb6718b5394b64e45eba3868193;p=trains.git Added debugging macro to nmra-stream.asm, to write debugging info out over the serial port/. --- diff --git a/cebpic/nmra-stream.asm b/cebpic/nmra-stream.asm index 6d1592c..63d92f7 100644 --- a/cebpic/nmra-stream.asm +++ b/cebpic/nmra-stream.asm @@ -36,6 +36,24 @@ TOTRACKBIT equ 0x3 ; byte 3: bit location of pointer within byte code +;***************************************************************************************** + +macros + +; macro to call subroutine to transmit over serial port for debugging +; takes 8-bit value, puts in W, invokes debug_serial_transmit + +debug macro debugvalue + movlw debugvalue + call debug_serial_transmit + endm + +debug_serial_transmit + movwf TXREG,0 ; move contents of W (i.e. debugvalue) to TXREG for transmission + return + +;***************************************************************************************** + initialise ; serial set-up diff --git a/detpic/nmra-stream.asm b/detpic/nmra-stream.asm index 6d1592c..63d92f7 100644 --- a/detpic/nmra-stream.asm +++ b/detpic/nmra-stream.asm @@ -36,6 +36,24 @@ TOTRACKBIT equ 0x3 ; byte 3: bit location of pointer within byte code +;***************************************************************************************** + +macros + +; macro to call subroutine to transmit over serial port for debugging +; takes 8-bit value, puts in W, invokes debug_serial_transmit + +debug macro debugvalue + movlw debugvalue + call debug_serial_transmit + endm + +debug_serial_transmit + movwf TXREG,0 ; move contents of W (i.e. debugvalue) to TXREG for transmission + return + +;***************************************************************************************** + initialise ; serial set-up