chiark / gitweb /
panic is a macro and doesn't work properly after ifbit0/btfss et al
authorian <ian>
Sun, 3 Jul 2005 21:14:34 +0000 (21:14 +0000)
committerian <ian>
Sun, 3 Jul 2005 21:14:34 +0000 (21:14 +0000)
cebpic/i2c-test-reply.asm

index 1d444b49891006c55c3ea3687f3631f86de7aee5..97f80c84b913d202eaf1865a171aabb180881f99 100644 (file)
@@ -532,15 +532,21 @@ serial_rx_isr
 
        debug   'f'
 
-       ifbit1  SSPCON2,ACKSTAT         ; check for ack from slave (=0), if no
+       ifbit0  SSPCON2,ACKSTAT         ; check for ack from slave (=0), if no
+       bra     serial_rx_isr_ifnot_noack1
        panic   morse_SA                ; then panic, else
+serial_rx_isr_ifnot_noack1
 
        debug   'g'
 
        movff   RCREG,SSPBUF            ; copy byte from serial to i2c buffer
        call    wait_for_i2c_interrupt
-       btfsc   SSPCON2,ACKSTAT,0       ; check for ack from slave (=0), if no
+
+       ifbit0  SSPCON2,ACKSTAT         ; check for ack from slave (=0), if no
+       bra     serial_rx_isr_ifnot_noack2
        panic   morse_SD                ; then panic, else
+serial_rx_isr_ifnot_noack2
+
        bsf     SSPCON2,PEN,0           ; i2c STOP
        call    wait_for_i2c_interrupt