From: ian Date: Thu, 31 Jan 2008 00:58:21 +0000 (+0000) Subject: document use of PORTB interrupt-on-change X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=72dc3759b0ed5a7484aac3c55710fdb71696fd10;p=trains.git document use of PORTB interrupt-on-change --- diff --git a/detpic/common.inc b/detpic/common.inc index 055f32b..8fc7b73 100644 --- a/detpic/common.inc +++ b/detpic/common.inc @@ -36,6 +36,7 @@ tickdiv_us equ tick_us * tickdiv ; t_dolocal Low ISR High ISR ; FSR1 Low ISR High ISR (detect[1]) ; FSR2 High ISR (nmra[1]) High ISR (detect[1]) +; PORTB Special read handling[2] Used normally ; ; Main loop detection scan detection scan ; High ISR NMRA output I2C service @@ -78,6 +79,10 @@ tickdiv_us equ tick_us * tickdiv ; detect_slave_init. Likewise FSR2 is reserved exclusively ; for the NMRA output ISR after nmra_init. ; +; [2] On the master PIC we the interrupt-on-change feature of PORTB. +; This means that routines mustn't casually read PORTB. Instead, +; they should call portb_read from serout.asm. +; ; General-purpose hardware allocation: ; ; Master Slave @@ -110,11 +115,11 @@ tickdiv_us equ tick_us * tickdiv ; ; _intrl Low ISR service routine. ; Checks for any relevant interrupt. -; If not, just returns. +; If not, just returns ; If found, services it and then does either ; intrl_handled or intrl_handled_nostack ; neither of which return; the latter is -; faster but implies a promise +; faster but implies a promise ; ;---------------------------------------------------------------------- ; MACROS