chiark / gitweb /
document use of PORTB interrupt-on-change
authorian <ian>
Thu, 31 Jan 2008 00:58:21 +0000 (00:58 +0000)
committerian <ian>
Thu, 31 Jan 2008 00:58:21 +0000 (00:58 +0000)
detpic/common.inc

index 055f32b5424a64b66a5927f097dc0155049ab1cc..8fc7b7379d8a0a2560c47aeed0a7da7c45b1203a 100644 (file)
@@ -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
 ;
 ; <something>_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