;-------------------------------------------------------- ; File Created by SDCC : free open source ANSI-C Compiler ; Version 2.9.7 #5883 (Jul 21 2010) (CYGWIN) ; This file was generated Thu Dec 30 16:14:27 2010 ;-------------------------------------------------------- ; PIC16 port for the Microchip 16-bit core micros ;-------------------------------------------------------- list p=18f2680 radix dec ;-------------------------------------------------------- ; public variables in this module ;-------------------------------------------------------- global _ECANInitialize global _ECANSendMessage global _ECANReceiveMessage global _ECANSetOperationMode global __CANIDToRegs global __RegsToCANID global __ECANRxFilterHitInfo ;-------------------------------------------------------- ; extern variables in this module ;-------------------------------------------------------- extern __gptrget1 extern __gptrput1 extern _RXF6SIDHbits extern _RXF6SIDLbits extern _RXF6EIDHbits extern _RXF6EIDLbits extern _RXF7SIDHbits extern _RXF7SIDLbits extern _RXF7EIDHbits extern _RXF7EIDLbits extern _RXF8SIDHbits extern _RXF8SIDLbits extern _RXF8EIDHbits extern _RXF8EIDLbits extern _RXF9SIDHbits extern _RXF9SIDLbits extern _RXF9EIDHbits extern _RXF9EIDLbits extern _RXF10SIDHbits extern _RXF10SIDLbits extern _RXF10EIDHbits extern _RXF10EIDLbits extern _RXF11SIDHbits extern _RXF11SIDLbits extern _RXF11EIDHbits extern _RXF11EIDLbits extern _RXF12SIDHbits extern _RXF12SIDLbits extern _RXF12EIDHbits extern _RXF12EIDLbits extern _RXF13SIDHbits extern _RXF13SIDLbits extern _RXF13EIDHbits extern _RXF13EIDLbits extern _RXF14SIDHbits extern _RXF14SIDLbits extern _RXF14EIDHbits extern _RXF14EIDLbits extern _RXF15SIDHbits extern _RXF15SIDLbits extern _RXF15EIDHbits extern _RXF15EIDLbits extern _RXFCON0bits extern _RXFCON1bits extern _SDFLCbits extern _RXFBCON0bits extern _RXFBCON1bits extern _RXFBCON2bits extern _RXFBCON3bits extern _RXFBCON4bits extern _RXFBCON5bits extern _RXFBCON6bits extern _RXFBCON7bits extern _MSEL0bits extern _MSEL1bits extern _MSEL2bits extern _MSEL3bits extern _BSEL0bits extern _BIE0bits extern _TXBIEbits extern _B0CONbits extern _B0SIDHbits extern _B0SIDLbits extern _B0EIDHbits extern _B0EIDLbits extern _B0DLCbits extern _B0D0bits extern _B0D1bits extern _B0D2bits extern _B0D3bits extern _B0D4bits extern _B0D5bits extern _B0D6bits extern _B0D7bits extern _CANSTAT_RO9bits extern _CANCON_RO9bits extern _B1CONbits extern _B1SIDHbits extern _B1SIDLbits extern _B1EIDHbits extern _B1EIDLbits extern _B1DLCbits extern _B1D0bits extern _B1D1bits extern _B1D2bits extern _B1D3bits extern _B1D4bits extern _B1D5bits extern _B1D6bits extern _B1D7bits extern _CANSTAT_RO8bits extern _CANCON_RO8bits extern _B2CONbits extern _B2SIDHbits extern _B2SIDLbits extern _B2EIDHbits extern _B2EIDLbits extern _B2DLCbits extern _B2D0bits extern _B2D1bits extern _B2D2bits extern _B2D3bits extern _B2D4bits extern _B2D5bits extern _B2D6bits extern _B2D7bits extern _CANSTAT_RO7bits extern _CANCON_RO7bits extern _B3CONbits extern _B3SIDHbits extern _B3SIDLbits extern _B3EIDHbits extern _B3EIDLbits extern _B3DLCbits extern _B3D0bits extern _B3D1bits extern _B3D2bits extern _B3D3bits extern _B3D4bits extern _B3D5bits extern _B3D6bits extern _B3D7bits extern _CANSTAT_RO6bits extern _CANCON_RO6bits extern _B4CONbits extern _B4SIDHbits extern _B4SIDLbits extern _B4EIDHbits extern _B4EIDLbits extern _B4DLCbits extern _B4D0bits extern _B4D1bits extern _B4D2bits extern _B4D3bits extern _B4D4bits extern _B4D5bits extern _B4D6bits extern _B4D7bits extern _CANSTAT_RO5bits extern _CANCON_RO5bits extern _B5CONbits extern _B5SIDHbits extern _B5SIDLbits extern _B5EIDHbits extern _B5EIDLbits extern _B5DLCbits extern _B5D0bits extern _B5D1bits extern _B5D2bits extern _B5D3bits extern _B5D4bits extern _B5D5bits extern _B5D6bits extern _B5D7bits extern _CANSTAT_RO4bits extern _CANCON_RO4bits extern _RXF0SIDHbits extern _RXF0SIDLbits extern _RXF0EIDHbits extern _RXF0EIDLbits extern _RXF1SIDHbits extern _RXF1SIDLbits extern _RXF1EIDHbits extern _RXF1EIDLbits extern _RXF2SIDHbits extern _RXF2SIDLbits extern _RXF2EIDHbits extern _RXF2EIDLbits extern _RXF3SIDHbits extern _RXF3SIDLbits extern _RXF3EIDHbits extern _RXF3EIDLbits extern _RXF4SIDHbits extern _RXF4SIDLbits extern _RXF4EIDHbits extern _RXF4EIDLbits extern _RXF5SIDHbits extern _RXF5SIDLbits extern _RXF5EIDHbits extern _RXF5EIDLbits extern _RXM0SIDHbits extern _RXM0SIDLbits extern _RXM0EIDHbits extern _RXM0EIDLbits extern _RXM1SIDHbits extern _RXM1SIDLbits extern _RXM1EIDHbits extern _RXM1EIDLbits extern _TXB2CONbits extern _TXB2SIDHbits extern _TXB2SIDLbits extern _TXB2EIDHbits extern _TXB2EIDLbits extern _TXB2DLCbits extern _TXB2D0bits extern _TXB2D1bits extern _TXB2D2bits extern _TXB2D3bits extern _TXB2D4bits extern _TXB2D5bits extern _TXB2D6bits extern _TXB2D7bits extern _CANSTAT_RO3bits extern _CANCON_RO3bits extern _TXB1CONbits extern _TXB1SIDHbits extern _TXB1SIDLbits extern _TXB1EIDHbits extern _TXB1EIDLbits extern _TXB1DLCbits extern _TXB1D0bits extern _TXB1D1bits extern _TXB1D2bits extern _TXB1D3bits extern _TXB1D4bits extern _TXB1D5bits extern _TXB1D6bits extern _TXB1D7bits extern _CANSTAT_RO2bits extern _CANCON_RO2bits extern _TXB0CONbits extern _TXB0SIDHbits extern _TXB0SIDLbits extern _TXB0EIDHbits extern _TXB0EIDLbits extern _TXB0DLCbits extern _TXB0D0bits extern _TXB0D1bits extern _TXB0D2bits extern _TXB0D3bits extern _TXB0D4bits extern _TXB0D5bits extern _TXB0D6bits extern _TXB0D7bits extern _CANSTAT_RO1bits extern _CANCON_RO1bits extern _RXB1CONbits extern _RXB1SIDHbits extern _RXB1SIDLbits extern _RXB1EIDHbits extern _RXB1EIDLbits extern _RXB1DLCbits extern _RXB1D0bits extern _RXB1D1bits extern _RXB1D2bits extern _RXB1D3bits extern _RXB1D4bits extern _RXB1D5bits extern _RXB1D6bits extern _RXB1D7bits extern _CANSTAT_RO0bits extern _CANCON_RO0bits extern _RXB0CONbits extern _RXB0SIDHbits extern _RXB0SIDLbits extern _RXB0EIDHbits extern _RXB0EIDLbits extern _RXB0DLCbits extern _RXB0D0bits extern _RXB0D1bits extern _RXB0D2bits extern _RXB0D3bits extern _RXB0D4bits extern _RXB0D5bits extern _RXB0D6bits extern _RXB0D7bits extern _CANSTATbits extern _CANCONbits extern _BRGCON1bits extern _BRGCON2bits extern _BRGCON3bits extern _CIOCONbits extern _COMSTATbits extern _RXERRCNTbits extern _TXERRCNTbits extern _ECANCONbits extern _PORTAbits extern _PORTBbits extern _PORTCbits extern _LATAbits extern _LATBbits extern _LATCbits extern _DDRAbits extern _TRISAbits extern _DDRBbits extern _TRISBbits extern _DDRCbits extern _TRISCbits extern _OSCTUNEbits extern _PIE1bits extern _PIR1bits extern _IPR1bits extern _PIE2bits extern _PIR2bits extern _IPR2bits extern _PIE3bits extern _PIR3bits extern _IPR3bits extern _EECON1bits extern _RCSTAbits extern _TXSTAbits extern _T3CONbits extern _BAUDCONbits extern _CCP1CONbits extern _ADCON2bits extern _ADCON1bits extern _ADCON0bits extern _SSPCON2bits extern _SSPCON1bits extern _SSPSTATbits extern _T2CONbits extern _T1CONbits extern _RCONbits extern _WDTCONbits extern _HLVDCONbits extern _LVDCONbits extern _OSCCONbits extern _T0CONbits extern _STATUSbits extern _INTCON3bits extern _INTCON2bits extern _INTCONbits extern _STKPTRbits extern _RXF6SIDH extern _RXF6SIDL extern _RXF6EIDH extern _RXF6EIDL extern _RXF7SIDH extern _RXF7SIDL extern _RXF7EIDH extern _RXF7EIDL extern _RXF8SIDH extern _RXF8SIDL extern _RXF8EIDH extern _RXF8EIDL extern _RXF9SIDH extern _RXF9SIDL extern _RXF9EIDH extern _RXF9EIDL extern _RXF10SIDH extern _RXF10SIDL extern _RXF10EIDH extern _RXF10EIDL extern _RXF11SIDH extern _RXF11SIDL extern _RXF11EIDH extern _RXF11EIDL extern _RXF12SIDH extern _RXF12SIDL extern _RXF12EIDH extern _RXF12EIDL extern _RXF13SIDH extern _RXF13SIDL extern _RXF13EIDH extern _RXF13EIDL extern _RXF14SIDH extern _RXF14SIDL extern _RXF14EIDH extern _RXF14EIDL extern _RXF15SIDH extern _RXF15SIDL extern _RXF15EIDH extern _RXF15EIDL extern _RXFCON0 extern _RXFCON1 extern _SDFLC extern _RXFBCON0 extern _RXFBCON1 extern _RXFBCON2 extern _RXFBCON3 extern _RXFBCON4 extern _RXFBCON5 extern _RXFBCON6 extern _RXFBCON7 extern _MSEL0 extern _MSEL1 extern _MSEL2 extern _MSEL3 extern _BSEL0 extern _BIE0 extern _TXBIE extern _B0CON extern _B0SIDH extern _B0SIDL extern _B0EIDH extern _B0EIDL extern _B0DLC extern _B0D0 extern _B0D1 extern _B0D2 extern _B0D3 extern _B0D4 extern _B0D5 extern _B0D6 extern _B0D7 extern _CANSTAT_RO9 extern _CANCON_RO9 extern _B1CON extern _B1SIDH extern _B1SIDL extern _B1EIDH extern _B1EIDL extern _B1DLC extern _B1D0 extern _B1D1 extern _B1D2 extern _B1D3 extern _B1D4 extern _B1D5 extern _B1D6 extern _B1D7 extern _CANSTAT_RO8 extern _CANCON_RO8 extern _B2CON extern _B2SIDH extern _B2SIDL extern _B2EIDH extern _B2EIDL extern _B2DLC extern _B2D0 extern _B2D1 extern _B2D2 extern _B2D3 extern _B2D4 extern _B2D5 extern _B2D6 extern _B2D7 extern _CANSTAT_RO7 extern _CANCON_RO7 extern _B3CON extern _B3SIDH extern _B3SIDL extern _B3EIDH extern _B3EIDL extern _B3DLC extern _B3D0 extern _B3D1 extern _B3D2 extern _B3D3 extern _B3D4 extern _B3D5 extern _B3D6 extern _B3D7 extern _CANSTAT_RO6 extern _CANCON_RO6 extern _B4CON extern _B4SIDH extern _B4SIDL extern _B4EIDH extern _B4EIDL extern _B4DLC extern _B4D0 extern _B4D1 extern _B4D2 extern _B4D3 extern _B4D4 extern _B4D5 extern _B4D6 extern _B4D7 extern _CANSTAT_RO5 extern _CANCON_RO5 extern _B5CON extern _B5SIDH extern _B5SIDL extern _B5EIDH extern _B5EIDL extern _B5DLC extern _B5D0 extern _B5D1 extern _B5D2 extern _B5D3 extern _B5D4 extern _B5D5 extern _B5D6 extern _B5D7 extern _CANSTAT_RO4 extern _CANCON_RO4 extern _RXF0SIDH extern _RXF0SIDL extern _RXF0EIDH extern _RXF0EIDL extern _RXF1SIDH extern _RXF1SIDL extern _RXF1EIDH extern _RXF1EIDL extern _RXF2SIDH extern _RXF2SIDL extern _RXF2EIDH extern _RXF2EIDL extern _RXF3SIDH extern _RXF3SIDL extern _RXF3EIDH extern _RXF3EIDL extern _RXF4SIDH extern _RXF4SIDL extern _RXF4EIDH extern _RXF4EIDL extern _RXF5SIDH extern _RXF5SIDL extern _RXF5EIDH extern _RXF5EIDL extern _RXM0SIDH extern _RXM0SIDL extern _RXM0EIDH extern _RXM0EIDL extern _RXM1SIDH extern _RXM1SIDL extern _RXM1EIDH extern _RXM1EIDL extern _TXB2CON extern _TXB2SIDH extern _TXB2SIDL extern _TXB2EIDH extern _TXB2EIDL extern _TXB2DLC extern _TXB2D0 extern _TXB2D1 extern _TXB2D2 extern _TXB2D3 extern _TXB2D4 extern _TXB2D5 extern _TXB2D6 extern _TXB2D7 extern _CANSTAT_RO3 extern _CANCON_RO3 extern _TXB1CON extern _TXB1SIDH extern _TXB1SIDL extern _TXB1EIDH extern _TXB1EIDL extern _TXB1DLC extern _TXB1D0 extern _TXB1D1 extern _TXB1D2 extern _TXB1D3 extern _TXB1D4 extern _TXB1D5 extern _TXB1D6 extern _TXB1D7 extern _CANSTAT_RO2 extern _CANCON_RO2 extern _TXB0CON extern _TXB0SIDH extern _TXB0SIDL extern _TXB0EIDH extern _TXB0EIDL extern _TXB0DLC extern _TXB0D0 extern _TXB0D1 extern _TXB0D2 extern _TXB0D3 extern _TXB0D4 extern _TXB0D5 extern _TXB0D6 extern _TXB0D7 extern _CANSTAT_RO1 extern _CANCON_RO1 extern _RXB1CON extern _RXB1SIDH extern _RXB1SIDL extern _RXB1EIDH extern _RXB1EIDL extern _RXB1DLC extern _RXB1D0 extern _RXB1D1 extern _RXB1D2 extern _RXB1D3 extern _RXB1D4 extern _RXB1D5 extern _RXB1D6 extern _RXB1D7 extern _CANSTAT_RO0 extern _CANCON_RO0 extern _RXB0CON extern _RXB0SIDH extern _RXB0SIDL extern _RXB0EIDH extern _RXB0EIDL extern _RXB0DLC extern _RXB0D0 extern _RXB0D1 extern _RXB0D2 extern _RXB0D3 extern _RXB0D4 extern _RXB0D5 extern _RXB0D6 extern _RXB0D7 extern _CANSTAT extern _CANCON extern _BRGCON1 extern _BRGCON2 extern _BRGCON3 extern _CIOCON extern _COMSTAT extern _RXERRCNT extern _TXERRCNT extern _ECANCON extern _PORTA extern _PORTB extern _PORTC extern _LATA extern _LATB extern _LATC extern _DDRA extern _TRISA extern _DDRB extern _TRISB extern _DDRC extern _TRISC extern _OSCTUNE extern _PIE1 extern _PIR1 extern _IPR1 extern _PIE2 extern _PIR2 extern _IPR2 extern _PIE3 extern _PIR3 extern _IPR3 extern _EECON1 extern _EECON2 extern _EEDATA extern _EEADR extern _EEADRH extern _RCSTA extern _TXSTA extern _TXREG extern _RCREG extern _SPBRG extern _SPBRGH extern _T3CON extern _TMR3L extern _TMR3H extern _BAUDCON extern _CCP1CON extern _CCPR1 extern _CCPR1L extern _CCPR1H extern _ADCON2 extern _ADCON1 extern _ADCON0 extern _ADRES extern _ADRESL extern _ADRESH extern _SSPCON2 extern _SSPCON1 extern _SSPSTAT extern _SSPADD extern _SSPBUF extern _T2CON extern _PR2 extern _TMR2 extern _T1CON extern _TMR1L extern _TMR1H extern _RCON extern _WDTCON extern _HLVDCON extern _LVDCON extern _OSCCON extern _T0CON extern _TMR0L extern _TMR0H extern _STATUS extern _FSR2L extern _FSR2H extern _PLUSW2 extern _PREINC2 extern _POSTDEC2 extern _POSTINC2 extern _INDF2 extern _BSR extern _FSR1L extern _FSR1H extern _PLUSW1 extern _PREINC1 extern _POSTDEC1 extern _POSTINC1 extern _INDF1 extern _WREG extern _FSR0L extern _FSR0H extern _PLUSW0 extern _PREINC0 extern _POSTDEC0 extern _POSTINC0 extern _INDF0 extern _INTCON3 extern _INTCON2 extern _INTCON extern _PROD extern _PRODL extern _PRODH extern _TABLAT extern _TBLPTR extern _TBLPTRL extern _TBLPTRH extern _TBLPTRU extern _PC extern _PCL extern _PCLATH extern _PCLATU extern _STKPTR extern _TOS extern _TOSL extern _TOSH extern _TOSU ;-------------------------------------------------------- ; Equates to used internal registers ;-------------------------------------------------------- STATUS equ 0xfd8 WREG equ 0xfe8 FSR0L equ 0xfe9 FSR0H equ 0xfea FSR1L equ 0xfe1 FSR2L equ 0xfd9 INDF0 equ 0xfef POSTINC0 equ 0xfee POSTDEC1 equ 0xfe5 PREINC1 equ 0xfe4 PLUSW2 equ 0xfdb PRODL equ 0xff3 PRODH equ 0xff4 ; Internal registers .registers udata_ovr 0x0000 r0x00 res 1 r0x01 res 1 r0x02 res 1 r0x03 res 1 r0x04 res 1 r0x05 res 1 r0x06 res 1 r0x07 res 1 r0x08 res 1 r0x09 res 1 r0x0a res 1 r0x0b res 1 r0x0c res 1 r0x0d res 1 r0x0e res 1 r0x0f res 1 r0x10 res 1 r0x11 res 1 r0x12 res 1 r0x13 res 1 r0x14 res 1 r0x15 res 1 udata_ecan_0 udata _ECANSendMessage_pb_1_1 res 27 udata_ecan_1 udata __ECANRxFilterHitInfo res 1 udata_ecan_2 udata _ECANReceiveMessage_temp_1_1 res 1 udata_ecan_3 udata __CANIDToRegs_val_1_1 res 4 ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- ; I code from now on! ; ; Starting pCode block S_ecan___RegsToCANID code __RegsToCANID: ; .line 1149; ecan.c void _RegsToCANID( BYTE* ptr, MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVFF r0x01, POSTDEC1 MOVFF r0x02, POSTDEC1 MOVFF r0x03, POSTDEC1 MOVFF r0x04, POSTDEC1 MOVFF r0x05, POSTDEC1 MOVFF r0x06, POSTDEC1 MOVFF r0x07, POSTDEC1 MOVFF r0x08, POSTDEC1 MOVFF r0x09, POSTDEC1 MOVFF r0x0a, POSTDEC1 MOVFF r0x0b, POSTDEC1 MOVFF r0x0c, POSTDEC1 MOVFF r0x0d, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 MOVLW 0x03 MOVFF PLUSW2, r0x01 MOVLW 0x04 MOVFF PLUSW2, r0x02 MOVLW 0x05 MOVFF PLUSW2, r0x03 MOVLW 0x06 MOVFF PLUSW2, r0x04 MOVLW 0x07 MOVFF PLUSW2, r0x05 MOVLW 0x08 MOVFF PLUSW2, r0x06 ; .line 1157; ecan.c if ( type == ECAN_MSG_STD ) MOVF r0x06, W BTFSS STATUS, 2 BRA _00227_DS_ ; .line 1160; ecan.c Value->BYTES.BYTE_1 = (*ptr << 3); // Copy SIDH<4:0> to SID<7:3> MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x06 SWAPF r0x06, W RRNCF WREG, W ANDLW 0xf8 MOVWF r0x07 MOVFF r0x07, POSTDEC1 MOVFF r0x03, FSR0L MOVFF r0x04, PRODL MOVF r0x05, W CALL __gptrput1 ; .line 1161; ecan.c Value->BYTES.BYTE_2 = *ptr >> 5; // Copy SIDH<7:5> to SID<10:8> MOVF r0x03, W ADDLW 0x01 MOVWF r0x08 MOVLW 0x00 ADDWFC r0x04, W MOVWF r0x09 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x0a SWAPF r0x06, W RRNCF WREG, W ANDLW 0x07 MOVWF r0x06 MOVFF r0x06, POSTDEC1 MOVFF r0x08, FSR0L MOVFF r0x09, PRODL MOVF r0x0a, W CALL __gptrput1 ; .line 1162; ecan.c ptr++; // Point to SIDL INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F ; .line 1163; ecan.c Value->BYTES.BYTE_1 |= (*ptr >> 5); // Copy SIDL<7:6> to SID<2:0> MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x06 SWAPF r0x06, W RRNCF WREG, W ANDLW 0x07 MOVWF r0x06 MOVF r0x06, W IORWF r0x07, F MOVFF r0x07, POSTDEC1 MOVFF r0x03, FSR0L MOVFF r0x04, PRODL MOVF r0x05, W CALL __gptrput1 ; .line 1164; ecan.c Value->BYTES.BYTE_3 = 0x00; MOVF r0x03, W ADDLW 0x02 MOVWF r0x06 MOVLW 0x00 ADDWFC r0x04, W MOVWF r0x07 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x08 MOVLW 0x00 MOVWF POSTDEC1 MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrput1 ; .line 1165; ecan.c Value->BYTES.BYTE_4 = 0x00; MOVF r0x03, W ADDLW 0x03 MOVWF r0x06 MOVLW 0x00 ADDWFC r0x04, W MOVWF r0x07 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x08 MOVLW 0x00 MOVWF POSTDEC1 MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrput1 BRA _00229_DS_ _00227_DS_: ; .line 1170; ecan.c Value->BYTES.BYTE_3 = (*ptr << 5); // Copy SIDH<2:0> to EID<23:21> MOVF r0x03, W ADDLW 0x02 MOVWF r0x06 MOVLW 0x00 ADDWFC r0x04, W MOVWF r0x07 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x08 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x09 SWAPF r0x09, W RLNCF WREG, W ANDLW 0xe0 MOVWF r0x0a MOVFF r0x0a, POSTDEC1 MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrput1 ; .line 1171; ecan.c Value->BYTES.BYTE_4 = (*ptr >> 3); // Copy SIDH<7:3> to EID<29:25> MOVF r0x03, W ADDLW 0x03 MOVWF r0x0b MOVLW 0x00 ADDWFC r0x04, W MOVWF r0x0c MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x0d SWAPF r0x09, W RLNCF WREG, W ANDLW 0x1f MOVWF r0x09 MOVFF r0x09, POSTDEC1 MOVFF r0x0b, FSR0L MOVFF r0x0c, PRODL MOVF r0x0d, W CALL __gptrput1 ; .line 1172; ecan.c ptr++; // Point to SIDL INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F ; ;;!!! pic16_aopOp:1071 called for a spillLocation -- assigning WREG instead --- CHECK ; .line 1173; ecan.c Value->BYTES.BYTE_3 |= (*ptr & 0x03); // Copy SIDH<1:0> to EID<17:16> MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrget1 MOVWF WREG MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x09 MOVLW 0x03 ANDWF r0x09, W MOVWF r0x0b MOVF r0x0b, W IORWF r0x0a, F MOVFF r0x0a, POSTDEC1 MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrput1 ; ;;!!! pic16_aopOp:1071 called for a spillLocation -- assigning WREG instead --- CHECK ; .line 1175; ecan.c Value->BYTES.BYTE_3 |= ((*ptr & 0xe0) >> 3); // Copy SIDL<7:6> to EID<20:18> MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrget1 MOVWF WREG MOVLW 0xe0 ANDWF r0x09, F SWAPF r0x09, W RLNCF WREG, W ANDLW 0x1f MOVWF r0x09 MOVF r0x09, W IORWF r0x0a, F MOVFF r0x0a, POSTDEC1 MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrput1 ; .line 1176; ecan.c ptr++; // Point to EIDH INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F ; .line 1177; ecan.c Value->BYTES.BYTE_2 = *ptr; // Copy EIDH<15:8> to EID<15:8> MOVF r0x03, W ADDLW 0x01 MOVWF r0x06 MOVLW 0x00 ADDWFC r0x04, W MOVWF r0x07 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x08 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x09 MOVFF r0x09, POSTDEC1 MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrput1 ; .line 1178; ecan.c ptr++; // Point to EIDL INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F ; .line 1179; ecan.c Value->BYTES.BYTE_1 = *ptr; // Copy EIDH<7:0> to EID<7:0> MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x00 MOVFF r0x00, POSTDEC1 MOVFF r0x03, FSR0L MOVFF r0x04, PRODL MOVF r0x05, W CALL __gptrput1 _00229_DS_: MOVFF PREINC1, r0x0d MOVFF PREINC1, r0x0c MOVFF PREINC1, r0x0b MOVFF PREINC1, r0x0a MOVFF PREINC1, r0x09 MOVFF PREINC1, r0x08 MOVFF PREINC1, r0x07 MOVFF PREINC1, r0x06 MOVFF PREINC1, r0x05 MOVFF PREINC1, r0x04 MOVFF PREINC1, r0x03 MOVFF PREINC1, r0x02 MOVFF PREINC1, r0x01 MOVFF PREINC1, r0x00 MOVFF PREINC1, FSR2L RETURN ; ; Starting pCode block S_ecan___CANIDToRegs code __CANIDToRegs: ; .line 1092; ecan.c void _CANIDToRegs(BYTE* ptr, MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVFF r0x01, POSTDEC1 MOVFF r0x02, POSTDEC1 MOVFF r0x03, POSTDEC1 MOVFF r0x04, POSTDEC1 MOVFF r0x05, POSTDEC1 MOVFF r0x06, POSTDEC1 MOVFF r0x07, POSTDEC1 MOVFF r0x08, POSTDEC1 MOVFF r0x09, POSTDEC1 MOVFF r0x0a, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 MOVLW 0x03 MOVFF PLUSW2, r0x01 MOVLW 0x04 MOVFF PLUSW2, r0x02 MOVLW 0x05 MOVFF PLUSW2, __CANIDToRegs_val_1_1 MOVLW 0x06 MOVFF PLUSW2, (__CANIDToRegs_val_1_1 + 1) MOVLW 0x07 MOVFF PLUSW2, (__CANIDToRegs_val_1_1 + 2) MOVLW 0x08 MOVFF PLUSW2, (__CANIDToRegs_val_1_1 + 3) MOVLW 0x09 MOVFF PLUSW2, r0x03 ; .line 1098; ecan.c Value = (CAN_MESSAGE_ID*)&val; MOVLW HIGH(__CANIDToRegs_val_1_1) MOVWF r0x05 MOVLW LOW(__CANIDToRegs_val_1_1) MOVWF r0x04 MOVLW 0x80 MOVWF r0x06 ; .line 1100; ecan.c if ( type == ECAN_MSG_STD ) MOVF r0x03, W BTFSS STATUS, 2 BRA _00219_DS_ ; .line 1103; ecan.c *ptr = Value->BYTES.BYTE_1 >> 3; // Copy SID<7:3> to SIDH<4:0> MOVFF r0x04, FSR0L MOVFF r0x05, PRODL MOVF r0x06, W CALL __gptrget1 MOVWF r0x03 SWAPF r0x03, W RLNCF WREG, W ANDLW 0x1f MOVWF r0x07 MOVFF r0x07, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 ; .line 1104; ecan.c *ptr |= (Value->BYTES.BYTE_2 << 5); // Copy SID<10:8> to SIDH<7:5> MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x07 MOVF r0x04, W ADDLW 0x01 MOVWF r0x08 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x09 MOVLW 0x00 ADDWFC r0x06, W MOVWF r0x0a MOVFF r0x08, FSR0L MOVFF r0x09, PRODL MOVF r0x0a, W CALL __gptrget1 MOVWF r0x08 SWAPF r0x08, W RLNCF WREG, W ANDLW 0xe0 MOVWF r0x09 MOVF r0x09, W IORWF r0x07, F MOVFF r0x07, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 ; .line 1105; ecan.c ptr++; // Point to SIDL INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F ; .line 1106; ecan.c *ptr = Value->BYTES.BYTE_1 << 5; // Copy SID<2:0> to SIDL<7:5> SWAPF r0x03, W RLNCF WREG, W ANDLW 0xe0 MOVWF r0x07 MOVFF r0x07, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 BRA _00221_DS_ _00219_DS_: ; .line 1111; ecan.c *ptr = Value->BYTES.BYTE_3 >> 5; // Copy EID<23:21> to SIDH<2:0> MOVF r0x04, W ADDLW 0x02 MOVWF r0x03 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x07 MOVLW 0x00 ADDWFC r0x06, W MOVWF r0x08 MOVFF r0x03, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrget1 MOVWF r0x03 SWAPF r0x03, W RRNCF WREG, W ANDLW 0x07 MOVWF r0x07 MOVFF r0x07, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 ; .line 1112; ecan.c *ptr |= Value->BYTES.BYTE_4 << 3; // Copy EID<28:24> to SIDH<7:3> MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x07 MOVF r0x04, W ADDLW 0x03 MOVWF r0x08 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x09 MOVLW 0x00 ADDWFC r0x06, W MOVWF r0x0a MOVFF r0x08, FSR0L MOVFF r0x09, PRODL MOVF r0x0a, W CALL __gptrget1 MOVWF r0x08 SWAPF r0x08, W RRNCF WREG, W ANDLW 0xf8 MOVWF r0x09 MOVF r0x09, W IORWF r0x07, F MOVFF r0x07, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 ; .line 1113; ecan.c ptr++; // Point to SIDL INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F ; .line 1114; ecan.c *ptr = (Value->BYTES.BYTE_3 << 3) & 0xE0; // Copy EID<20:18> to SIDL<7:5> SWAPF r0x03, W RRNCF WREG, W ANDLW 0xf8 MOVWF r0x07 MOVLW 0xe0 ANDWF r0x07, F MOVFF r0x07, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 ; .line 1116; ecan.c *ptr |= 0b00001000; // Set EXIDEN bit to SIDL<3> BSF r0x07, 3 MOVFF r0x07, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 ; .line 1117; ecan.c *ptr |= Value->BYTES.BYTE_3 & 0x03; // Copy EID<17:16> to SIDL<1:0> MOVLW 0x03 ANDWF r0x03, F MOVF r0x03, W IORWF r0x07, F MOVFF r0x07, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 ; .line 1118; ecan.c ptr++; // Point to EIDH INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F ; .line 1119; ecan.c *ptr = Value->BYTES.BYTE_2; // Copy EID<15:8> to EIDH<7:0> MOVF r0x04, W ADDLW 0x01 MOVWF r0x03 MOVLW 0x00 ADDWFC r0x05, W MOVWF r0x07 MOVLW 0x00 ADDWFC r0x06, W MOVWF r0x08 MOVFF r0x03, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrget1 MOVWF r0x03 MOVFF r0x03, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 ; .line 1120; ecan.c ptr++; // Point to EIDL INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F ; .line 1121; ecan.c *ptr = Value->BYTES.BYTE_1; // Copy EID<7:0> to EIDL<7:0> MOVFF r0x04, FSR0L MOVFF r0x05, PRODL MOVF r0x06, W CALL __gptrget1 MOVWF r0x04 MOVFF r0x04, POSTDEC1 MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrput1 _00221_DS_: MOVFF PREINC1, r0x0a MOVFF PREINC1, r0x09 MOVFF PREINC1, r0x08 MOVFF PREINC1, r0x07 MOVFF PREINC1, r0x06 MOVFF PREINC1, r0x05 MOVFF PREINC1, r0x04 MOVFF PREINC1, r0x03 MOVFF PREINC1, r0x02 MOVFF PREINC1, r0x01 MOVFF PREINC1, r0x00 MOVFF PREINC1, FSR2L RETURN ; ; Starting pCode block S_ecan__ECANSetOperationMode code _ECANSetOperationMode: ; .line 1007; ecan.c void ECANSetOperationMode(ECAN_OP_MODE mode) MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVFF r0x01, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 ; .line 1009; ecan.c CANCON &= 0x1F; // clear previous mode MOVLW 0x1f ANDWF _CANCON, F ; .line 1010; ecan.c CANCON |= mode; // set new mode MOVF r0x00, W IORWF _CANCON, F _00203_DS_: ; .line 1012; ecan.c while( ECANGetOperationMode() != mode ); // Wait till desired mode is set. MOVLW 0xe0 ANDWF _CANCON, W MOVWF r0x01 MOVF r0x01, W XORWF r0x00, W BNZ _00203_DS_ MOVFF PREINC1, r0x01 MOVFF PREINC1, r0x00 MOVFF PREINC1, FSR2L RETURN ; ; Starting pCode block S_ecan__ECANReceiveMessage code _ECANReceiveMessage: ; .line 795; ecan.c BOOL ECANReceiveMessage(unsigned long *id, MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVFF r0x01, POSTDEC1 MOVFF r0x02, POSTDEC1 MOVFF r0x03, POSTDEC1 MOVFF r0x04, POSTDEC1 MOVFF r0x05, POSTDEC1 MOVFF r0x06, POSTDEC1 MOVFF r0x07, POSTDEC1 MOVFF r0x08, POSTDEC1 MOVFF r0x09, POSTDEC1 MOVFF r0x0a, POSTDEC1 MOVFF r0x0b, POSTDEC1 MOVFF r0x0c, POSTDEC1 MOVFF r0x0d, POSTDEC1 MOVFF r0x0e, POSTDEC1 MOVFF r0x0f, POSTDEC1 MOVFF r0x10, POSTDEC1 MOVFF r0x11, POSTDEC1 MOVFF r0x12, POSTDEC1 MOVFF r0x13, POSTDEC1 MOVFF r0x14, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 MOVLW 0x03 MOVFF PLUSW2, r0x01 MOVLW 0x04 MOVFF PLUSW2, r0x02 MOVLW 0x05 MOVFF PLUSW2, r0x03 MOVLW 0x06 MOVFF PLUSW2, r0x04 MOVLW 0x07 MOVFF PLUSW2, r0x05 MOVLW 0x08 MOVFF PLUSW2, r0x06 MOVLW 0x09 MOVFF PLUSW2, r0x07 MOVLW 0x0a MOVFF PLUSW2, r0x08 MOVLW 0x0b MOVFF PLUSW2, r0x09 MOVLW 0x0c MOVFF PLUSW2, r0x0a MOVLW 0x0d MOVFF PLUSW2, r0x0b BANKSEL __ECANRxFilterHitInfo ; .line 808; ecan.c _ECANRxFilterHitInfo.Val = 0; CLRF __ECANRxFilterHitInfo, B ; .line 820; ecan.c if ( RXB0CON_RXFUL ) BTFSS _RXB0CONbits, 7 BRA _00163_DS_ ; .line 823; ecan.c PIR3_RXB0IF = 0; BCF _PIR3bits, 0 ; .line 826; ecan.c if ( COMSTAT_RXB0OVFL ) BTFSS _COMSTATbits, 7 BRA _00154_DS_ ; .line 828; ecan.c *msgFlags |= ECAN_RX_OVERFLOW; MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrget1 MOVWF r0x0c BSF r0x0c, 3 MOVFF r0x0c, POSTDEC1 MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrput1 ; .line 829; ecan.c COMSTAT_RXB0OVFL = 0; BCF _COMSTATbits, 7 _00154_DS_: ; .line 832; ecan.c _ECANRxFilterHitInfo.bits.b0 = RXB0CON_FILHIT0; CLRF r0x0c BTFSC _RXB0CONbits, 0 INCF r0x0c, F MOVF r0x0c, W ANDLW 0x01 MOVWF PRODH BANKSEL __ECANRxFilterHitInfo MOVF __ECANRxFilterHitInfo, W, B ANDLW 0xfe IORWF PRODH, W BANKSEL __ECANRxFilterHitInfo MOVWF __ECANRxFilterHitInfo, B ; .line 834; ecan.c ptr = (BYTE*)&RXB0CON; MOVLW HIGH(_RXB0CON) MOVWF r0x0d MOVLW LOW(_RXB0CON) MOVWF r0x0c MOVLW 0x80 MOVWF r0x0e BRA _00165_DS_ _00163_DS_: BANKSEL _RXB1CONbits ; .line 837; ecan.c else if ( RXB1CON_RXFUL ) BTFSS _RXB1CONbits, 7, B BRA _00160_DS_ ; .line 840; ecan.c PIR3_RXB1IF = 0; BCF _PIR3bits, 1 ; .line 843; ecan.c if ( COMSTAT_RXB1OVFL ) BTFSS _COMSTATbits, 6 BRA _00156_DS_ ; .line 845; ecan.c *msgFlags |= ECAN_RX_OVERFLOW; MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrget1 MOVWF r0x0f BSF r0x0f, 3 MOVFF r0x0f, POSTDEC1 MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrput1 ; .line 846; ecan.c COMSTAT_RXB1OVFL = 0; BCF _COMSTATbits, 6 _00156_DS_: ; .line 849; ecan.c _ECANRxFilterHitInfo.Val = RXB1CON & 0x07; MOVLW 0x07 BANKSEL _RXB1CON ANDWF _RXB1CON, W, B MOVWF r0x0f MOVF r0x0f, W BANKSEL __ECANRxFilterHitInfo MOVWF __ECANRxFilterHitInfo, B ; ;;!!! pic16_aopOp:1071 called for a spillLocation -- assigning WREG instead --- CHECK ; .line 851; ecan.c if ( _ECANRxFilterHitInfo.Val < 0x02 ) MOVFF __ECANRxFilterHitInfo, WREG MOVLW 0x02 SUBWF r0x0f, W BC _00158_DS_ ; .line 852; ecan.c *msgFlags |= ECAN_RX_DBL_BUFFERED; MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrget1 MOVWF r0x0f BSF r0x0f, 7 MOVFF r0x0f, POSTDEC1 MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrput1 _00158_DS_: ; .line 855; ecan.c ptr = (BYTE*)&RXB1CON; MOVLW HIGH(_RXB1CON) MOVWF r0x0d MOVLW LOW(_RXB1CON) MOVWF r0x0c MOVLW 0x80 MOVWF r0x0e BRA _00165_DS_ _00160_DS_: ; .line 858; ecan.c return FALSE; CLRF WREG BRA _00177_DS_ _00165_DS_: ; .line 938; ecan.c savedPtr = ptr; MOVFF r0x0c, r0x0f MOVFF r0x0d, r0x10 MOVFF r0x0e, r0x11 ; .line 939; ecan.c *msgFlags = 0; MOVLW 0x00 MOVWF POSTDEC1 MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrput1 ; .line 942; ecan.c temp.Val = *(ptr+5); MOVF r0x0c, W ADDLW 0x05 MOVWF r0x12 MOVLW 0x00 ADDWFC r0x0d, W MOVWF r0x13 MOVLW 0x00 ADDWFC r0x0e, W MOVWF r0x14 MOVFF r0x12, FSR0L MOVFF r0x13, PRODL MOVF r0x14, W CALL __gptrget1 MOVWF r0x12 MOVF r0x12, W BANKSEL _ECANReceiveMessage_temp_1_1 MOVWF _ECANReceiveMessage_temp_1_1, B ; ;;!!! pic16_aopOp:1071 called for a spillLocation -- assigning WREG instead --- CHECK ; .line 943; ecan.c *data1Len = temp.Val & 0b00001111; MOVFF _ECANReceiveMessage_temp_1_1, WREG MOVLW 0x0f ANDWF r0x12, F MOVFF r0x12, POSTDEC1 MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrput1 BANKSEL _ECANReceiveMessage_temp_1_1 ; .line 946; ecan.c if ( temp.bits.b6 ) BTFSS _ECANReceiveMessage_temp_1_1, 6, B BRA _00167_DS_ ; .line 947; ecan.c *msgFlags |= ECAN_RX_RTR_FRAME; MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrget1 MOVWF r0x12 BSF r0x12, 6 MOVFF r0x12, POSTDEC1 MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrput1 _00167_DS_: ; .line 950; ecan.c temp.Val = *(ptr+2); MOVF r0x0c, W ADDLW 0x02 MOVWF r0x12 MOVLW 0x00 ADDWFC r0x0d, W MOVWF r0x13 MOVLW 0x00 ADDWFC r0x0e, W MOVWF r0x14 MOVFF r0x12, FSR0L MOVFF r0x13, PRODL MOVF r0x14, W CALL __gptrget1 MOVWF r0x12 MOVF r0x12, W BANKSEL _ECANReceiveMessage_temp_1_1 MOVWF _ECANReceiveMessage_temp_1_1, B BANKSEL _ECANReceiveMessage_temp_1_1 ; .line 951; ecan.c if ( temp.bits.b3 ) BTFSS _ECANReceiveMessage_temp_1_1, 3, B BRA _00169_DS_ ; .line 953; ecan.c *msgFlags |= ECAN_RX_XTD_FRAME; MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrget1 MOVWF r0x12 BSF r0x12, 5 MOVFF r0x12, POSTDEC1 MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrput1 ; .line 954; ecan.c temp.Val = ECAN_MSG_XTD; MOVLW 0x01 BANKSEL _ECANReceiveMessage_temp_1_1 MOVWF _ECANReceiveMessage_temp_1_1, B BRA _00170_DS_ _00169_DS_: BANKSEL _ECANReceiveMessage_temp_1_1 ; .line 957; ecan.c temp.Val = ECAN_MSG_STD; CLRF _ECANReceiveMessage_temp_1_1, B _00170_DS_: ; .line 959; ecan.c _RegsToCANID(ptr+1, id, temp.Val); MOVF r0x0c, W ADDLW 0x01 MOVWF r0x12 MOVLW 0x00 ADDWFC r0x0d, W MOVWF r0x13 MOVLW 0x00 ADDWFC r0x0e, W MOVWF r0x14 BANKSEL _ECANReceiveMessage_temp_1_1 MOVF _ECANReceiveMessage_temp_1_1, W, B MOVWF POSTDEC1 MOVF r0x02, W MOVWF POSTDEC1 MOVF r0x01, W MOVWF POSTDEC1 MOVF r0x00, W MOVWF POSTDEC1 MOVF r0x14, W MOVWF POSTDEC1 MOVF r0x13, W MOVWF POSTDEC1 MOVF r0x12, W MOVWF POSTDEC1 CALL __RegsToCANID MOVLW 0x07 ADDWF FSR1L, F ; .line 962; ecan.c ptr += 6; MOVLW 0x06 ADDWF r0x0c, F MOVLW 0x00 ADDWFC r0x0d, F MOVLW 0x00 ADDWFC r0x0e, F ; .line 963; ecan.c temp.Val = *data1Len; MOVFF r0x06, FSR0L MOVFF r0x07, PRODL MOVF r0x08, W CALL __gptrget1 MOVWF r0x06 MOVF r0x06, W BANKSEL _ECANReceiveMessage_temp_1_1 MOVWF _ECANReceiveMessage_temp_1_1, B ; .line 964; ecan.c for ( i = 0; i < temp.Val; i++ ) MOVFF r0x0c, r0x00 MOVFF r0x0d, r0x01 MOVFF r0x0e, r0x02 CLRF r0x06 _00173_DS_: MOVFF r0x06, r0x07 CLRF r0x08 BTFSC r0x06, 7 SETF r0x08 MOVFF _ECANReceiveMessage_temp_1_1, r0x0c CLRF r0x0d MOVF r0x08, W ADDLW 0x80 MOVWF PRODL MOVF r0x0d, W ADDLW 0x80 SUBWF PRODL, W BNZ _00198_DS_ MOVF r0x0c, W SUBWF r0x07, W _00198_DS_: BC _00176_DS_ ; .line 965; ecan.c *data1++ = *ptr++; MOVFF r0x00, FSR0L MOVFF r0x01, PRODL MOVF r0x02, W CALL __gptrget1 MOVWF r0x07 INCF r0x00, F BTFSC STATUS, 0 INCF r0x01, F BTFSC STATUS, 0 INCF r0x02, F MOVFF r0x07, POSTDEC1 MOVFF r0x03, FSR0L MOVFF r0x04, PRODL MOVF r0x05, W CALL __gptrput1 INCF r0x03, F BTFSC STATUS, 0 INCF r0x04, F BTFSC STATUS, 0 INCF r0x05, F ; .line 964; ecan.c for ( i = 0; i < temp.Val; i++ ) INCF r0x06, F BRA _00173_DS_ _00176_DS_: ; .line 968; ecan.c if ( PIR3_IRXIF ) BTFSS _PIR3bits, 7 BRA _00172_DS_ ; .line 970; ecan.c *msgFlags |= ECAN_RX_INVALID_MSG; MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrget1 MOVWF r0x00 BSF r0x00, 4 MOVFF r0x00, POSTDEC1 MOVFF r0x09, FSR0L MOVFF r0x0a, PRODL MOVF r0x0b, W CALL __gptrput1 ; .line 971; ecan.c PIR3_IRXIF = 0; BCF _PIR3bits, 7 _00172_DS_: ; .line 975; ecan.c *savedPtr &= 0x7f; MOVFF r0x0f, FSR0L MOVFF r0x10, PRODL MOVF r0x11, W CALL __gptrget1 MOVWF r0x00 BCF r0x00, 7 MOVFF r0x00, POSTDEC1 MOVFF r0x0f, FSR0L MOVFF r0x10, PRODL MOVF r0x11, W CALL __gptrput1 ; .line 986; ecan.c return TRUE; MOVLW 0x01 _00177_DS_: MOVFF PREINC1, r0x14 MOVFF PREINC1, r0x13 MOVFF PREINC1, r0x12 MOVFF PREINC1, r0x11 MOVFF PREINC1, r0x10 MOVFF PREINC1, r0x0f MOVFF PREINC1, r0x0e MOVFF PREINC1, r0x0d MOVFF PREINC1, r0x0c MOVFF PREINC1, r0x0b MOVFF PREINC1, r0x0a MOVFF PREINC1, r0x09 MOVFF PREINC1, r0x08 MOVFF PREINC1, r0x07 MOVFF PREINC1, r0x06 MOVFF PREINC1, r0x05 MOVFF PREINC1, r0x04 MOVFF PREINC1, r0x03 MOVFF PREINC1, r0x02 MOVFF PREINC1, r0x01 MOVFF PREINC1, r0x00 MOVFF PREINC1, FSR2L RETURN ; ; Starting pCode block S_ecan__ECANSendMessage code _ECANSendMessage: ; .line 609; ecan.c BOOL ECANSendMessage( unsigned long id, MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L MOVFF r0x00, POSTDEC1 MOVFF r0x01, POSTDEC1 MOVFF r0x02, POSTDEC1 MOVFF r0x03, POSTDEC1 MOVFF r0x04, POSTDEC1 MOVFF r0x05, POSTDEC1 MOVFF r0x06, POSTDEC1 MOVFF r0x07, POSTDEC1 MOVFF r0x08, POSTDEC1 MOVFF r0x09, POSTDEC1 MOVFF r0x0a, POSTDEC1 MOVFF r0x0b, POSTDEC1 MOVFF r0x0c, POSTDEC1 MOVFF r0x0d, POSTDEC1 MOVFF r0x0e, POSTDEC1 MOVFF r0x0f, POSTDEC1 MOVFF r0x10, POSTDEC1 MOVFF r0x11, POSTDEC1 MOVFF r0x12, POSTDEC1 MOVFF r0x13, POSTDEC1 MOVFF r0x14, POSTDEC1 MOVFF r0x15, POSTDEC1 MOVLW 0x02 MOVFF PLUSW2, r0x00 MOVLW 0x03 MOVFF PLUSW2, r0x01 MOVLW 0x04 MOVFF PLUSW2, r0x02 MOVLW 0x05 MOVFF PLUSW2, r0x03 MOVLW 0x06 MOVFF PLUSW2, r0x04 MOVLW 0x07 MOVFF PLUSW2, r0x05 MOVLW 0x08 MOVFF PLUSW2, r0x06 MOVLW 0x09 MOVFF PLUSW2, r0x07 MOVLW 0x0a MOVFF PLUSW2, r0x08 ; .line 637; ecan.c pb[0]=(BYTE*)&TXB0CON; MOVLW HIGH(_TXB0CON) MOVWF r0x0a MOVLW LOW(_TXB0CON) MOVWF r0x09 MOVLW 0x80 MOVWF r0x0b MOVF r0x09, W BANKSEL _ECANSendMessage_pb_1_1 MOVWF _ECANSendMessage_pb_1_1, B MOVF r0x0a, W BANKSEL (_ECANSendMessage_pb_1_1 + 1) MOVWF (_ECANSendMessage_pb_1_1 + 1), B MOVF r0x0b, W BANKSEL (_ECANSendMessage_pb_1_1 + 2) MOVWF (_ECANSendMessage_pb_1_1 + 2), B ; .line 638; ecan.c pb[1]=(BYTE*)&TXB1CON; MOVLW HIGH(_TXB1CON) MOVWF r0x0a MOVLW LOW(_TXB1CON) MOVWF r0x09 MOVLW 0x80 MOVWF r0x0b MOVF r0x09, W BANKSEL (_ECANSendMessage_pb_1_1 + 3) MOVWF (_ECANSendMessage_pb_1_1 + 3), B MOVF r0x0a, W BANKSEL (_ECANSendMessage_pb_1_1 + 4) MOVWF (_ECANSendMessage_pb_1_1 + 4), B MOVF r0x0b, W BANKSEL (_ECANSendMessage_pb_1_1 + 5) MOVWF (_ECANSendMessage_pb_1_1 + 5), B ; .line 639; ecan.c pb[2]=(BYTE*)&TXB2CON; MOVLW HIGH(_TXB2CON) MOVWF r0x0a MOVLW LOW(_TXB2CON) MOVWF r0x09 MOVLW 0x80 MOVWF r0x0b MOVF r0x09, W BANKSEL (_ECANSendMessage_pb_1_1 + 6) MOVWF (_ECANSendMessage_pb_1_1 + 6), B MOVF r0x0a, W BANKSEL (_ECANSendMessage_pb_1_1 + 7) MOVWF (_ECANSendMessage_pb_1_1 + 7), B MOVF r0x0b, W BANKSEL (_ECANSendMessage_pb_1_1 + 8) MOVWF (_ECANSendMessage_pb_1_1 + 8), B ; .line 669; ecan.c for ( i = 0; i < buffers; i++ ) CLRF r0x09 CLRF r0x0a _00124_DS_: MOVLW 0x02 SUBWF r0x09, W BTFSC STATUS, 0 BRA _00127_DS_ ; .line 689; ecan.c ptr = pb[i]; MOVLW LOW(_ECANSendMessage_pb_1_1) ADDWF r0x0a, W MOVWF r0x0b CLRF r0x0c MOVLW HIGH(_ECANSendMessage_pb_1_1) ADDWFC r0x0c, F MOVFF r0x0b, FSR0L MOVFF r0x0c, FSR0H MOVFF POSTINC0, r0x0b MOVFF POSTINC0, r0x0c MOVFF INDF0, r0x0d ; .line 690; ecan.c tempPtr = ptr; MOVFF r0x0b, r0x0e MOVFF r0x0c, r0x0f MOVFF r0x0d, r0x10 ; .line 716; ecan.c if ( !(*ptr & 0x08) ) MOVFF r0x0b, FSR0L MOVFF r0x0c, PRODL MOVF r0x0d, W CALL __gptrget1 MOVWF r0x11 BTFSC r0x11, 3 BRA _00126_DS_ ; .line 719; ecan.c *ptr &= ~ECAN_TX_PRIORITY_BITS; MOVLW 0xfc ANDWF r0x11, F MOVFF r0x11, POSTDEC1 MOVFF r0x0b, FSR0L MOVFF r0x0c, PRODL MOVF r0x0d, W CALL __gptrput1 ; .line 720; ecan.c *ptr |= msgFlags & ECAN_TX_PRIORITY_BITS; MOVFF r0x0b, FSR0L MOVFF r0x0c, PRODL MOVF r0x0d, W CALL __gptrget1 MOVWF r0x11 MOVLW 0x03 ANDWF r0x08, W MOVWF r0x12 MOVF r0x12, W IORWF r0x11, F MOVFF r0x11, POSTDEC1 MOVFF r0x0b, FSR0L MOVFF r0x0c, PRODL MOVF r0x0d, W CALL __gptrput1 ; .line 723; ecan.c if ( msgFlags & ECAN_TX_RTR_BIT ) BTFSS r0x08, 6 BRA _00111_DS_ ; .line 724; ecan.c temp = 0x40 | data1Len; MOVLW 0x40 IORWF r0x07, W MOVWF r0x11 BRA _00112_DS_ _00111_DS_: ; .line 726; ecan.c temp = data1Len; MOVFF r0x07, r0x11 _00112_DS_: ; .line 728; ecan.c *(ptr+5) = temp; MOVF r0x0b, W ADDLW 0x05 MOVWF r0x12 MOVLW 0x00 ADDWFC r0x0c, W MOVWF r0x13 MOVLW 0x00 ADDWFC r0x0d, W MOVWF r0x14 MOVFF r0x11, POSTDEC1 MOVFF r0x12, FSR0L MOVFF r0x13, PRODL MOVF r0x14, W CALL __gptrput1 ; .line 731; ecan.c if ( msgFlags & ECAN_TX_FRAME_BIT ) BTFSS r0x08, 5 BRA _00114_DS_ ; .line 732; ecan.c temp = ECAN_MSG_XTD; MOVLW 0x01 MOVWF r0x11 BRA _00115_DS_ _00114_DS_: ; .line 735; ecan.c temp = ECAN_MSG_STD; CLRF r0x11 _00115_DS_: ; .line 738; ecan.c _CANIDToRegs((BYTE*)(ptr+1), id, temp); MOVF r0x0b, W ADDLW 0x01 MOVWF r0x12 MOVLW 0x00 ADDWFC r0x0c, W MOVWF r0x13 MOVLW 0x00 ADDWFC r0x0d, W MOVWF r0x14 MOVF r0x11, W MOVWF POSTDEC1 MOVF r0x03, W MOVWF POSTDEC1 MOVF r0x02, W MOVWF POSTDEC1 MOVF r0x01, W MOVWF POSTDEC1 MOVF r0x00, W MOVWF POSTDEC1 MOVF r0x14, W MOVWF POSTDEC1 MOVF r0x13, W MOVWF POSTDEC1 MOVF r0x12, W MOVWF POSTDEC1 CALL __CANIDToRegs MOVLW 0x08 ADDWF FSR1L, F ; .line 741; ecan.c ptr += 6; MOVLW 0x06 ADDWF r0x0b, F MOVLW 0x00 ADDWFC r0x0c, F MOVLW 0x00 ADDWFC r0x0d, F ; .line 743; ecan.c for ( j = 0 ; j < data1Len; j++ ) MOVFF r0x04, r0x11 MOVFF r0x05, r0x12 MOVFF r0x06, r0x13 CLRF r0x14 _00120_DS_: MOVF r0x07, W SUBWF r0x14, W BC _00123_DS_ ; .line 744; ecan.c *ptr++ = *data1++; MOVFF r0x11, FSR0L MOVFF r0x12, PRODL MOVF r0x13, W CALL __gptrget1 MOVWF r0x15 INCF r0x11, F BTFSC STATUS, 0 INCF r0x12, F BTFSC STATUS, 0 INCF r0x13, F MOVFF r0x15, POSTDEC1 MOVFF r0x0b, FSR0L MOVFF r0x0c, PRODL MOVF r0x0d, W CALL __gptrput1 INCF r0x0b, F BTFSC STATUS, 0 INCF r0x0c, F BTFSC STATUS, 0 INCF r0x0d, F ; .line 743; ecan.c for ( j = 0 ; j < data1Len; j++ ) INCF r0x14, F BRA _00120_DS_ _00123_DS_: ; .line 748; ecan.c if ( !(*tempPtr & 0x04) ) MOVFF r0x0e, FSR0L MOVFF r0x0f, PRODL MOVF r0x10, W CALL __gptrget1 MOVWF r0x0b BTFSC r0x0b, 2 BRA _00117_DS_ ; .line 749; ecan.c *tempPtr |= 0x08; BSF r0x0b, 3 MOVFF r0x0b, POSTDEC1 MOVFF r0x0e, FSR0L MOVFF r0x0f, PRODL MOVF r0x10, W CALL __gptrput1 _00117_DS_: ; .line 751; ecan.c return TRUE; MOVLW 0x01 BRA _00128_DS_ _00126_DS_: ; .line 669; ecan.c for ( i = 0; i < buffers; i++ ) MOVLW 0x03 ADDWF r0x0a, F INCF r0x09, F BRA _00124_DS_ _00127_DS_: ; .line 756; ecan.c return FALSE; CLRF WREG _00128_DS_: MOVFF PREINC1, r0x15 MOVFF PREINC1, r0x14 MOVFF PREINC1, r0x13 MOVFF PREINC1, r0x12 MOVFF PREINC1, r0x11 MOVFF PREINC1, r0x10 MOVFF PREINC1, r0x0f MOVFF PREINC1, r0x0e MOVFF PREINC1, r0x0d MOVFF PREINC1, r0x0c MOVFF PREINC1, r0x0b MOVFF PREINC1, r0x0a MOVFF PREINC1, r0x09 MOVFF PREINC1, r0x08 MOVFF PREINC1, r0x07 MOVFF PREINC1, r0x06 MOVFF PREINC1, r0x05 MOVFF PREINC1, r0x04 MOVFF PREINC1, r0x03 MOVFF PREINC1, r0x02 MOVFF PREINC1, r0x01 MOVFF PREINC1, r0x00 MOVFF PREINC1, FSR2L RETURN ; ; Starting pCode block S_ecan__ECANInitialize code _ECANInitialize: ; .line 163; ecan.c void ECANInitialize(void) MOVFF FSR2L, POSTDEC1 MOVFF FSR1L, FSR2L ; .line 167; ecan.c ECANSetOperationMode(ECAN_OP_MODE_CONFIG); MOVLW 0x80 MOVWF POSTDEC1 CALL _ECANSetOperationMode INCF FSR1L, F ; .line 171; ecan.c BRGCON1 = ((ECAN_SJW_VAL-1) << 6) | (ECAN_BRP_VAL-1); MOVLW 0x01 MOVWF _BRGCON1 ; .line 172; ecan.c BRGCON2 = (ECAN_PHSEG2_MODE_VAL << 7) | \ MOVLW 0xae MOVWF _BRGCON2 ; .line 178; ecan.c (ECAN_PHSEG2_VAL-1); MOVLW 0x05 MOVWF _BRGCON3 ; .line 181; ecan.c CIOCON = ECAN_TX2_SOURCE_VAL << 7 | \ MOVLW 0x20 MOVWF _CIOCON ; .line 188; ecan.c ECANCON_MDSEL1 = 0; BCF _ECANCONbits, 7 ; .line 189; ecan.c ECANCON_MDSEL0 = 0; BCF _ECANCONbits, 6 ; .line 194; ecan.c RXB0CON = (ECAN_RXB0_MODE_VAL << 5) | (ECAN_RXB0_DBL_BUFFER_MODE_VAL << 2); MOVLW 0x04 MOVWF _RXB0CON BANKSEL _RXB1CON ; .line 195; ecan.c RXB1CON = ECAN_RXB1_MODE_VAL << 5; CLRF _RXB1CON, B BANKSEL _RXF0SIDH ; .line 289; ecan.c _SetStdRXFnValue(RXF0, ECAN_RXF0_VAL); CLRF _RXF0SIDH, B BANKSEL _RXF0SIDL CLRF _RXF0SIDL, B BANKSEL _RXF1SIDH ; .line 297; ecan.c _SetStdRXFnValue(RXF1, ECAN_RXF1_VAL); CLRF _RXF1SIDH, B BANKSEL _RXF1SIDL CLRF _RXF1SIDL, B BANKSEL _RXF2SIDH ; .line 306; ecan.c _SetStdRXFnValue(RXF2, ECAN_RXF2_VAL); CLRF _RXF2SIDH, B BANKSEL _RXF2SIDL CLRF _RXF2SIDL, B BANKSEL _RXF3SIDH ; .line 315; ecan.c _SetStdRXFnValue(RXF3, ECAN_RXF3_VAL); CLRF _RXF3SIDH, B BANKSEL _RXF3SIDL CLRF _RXF3SIDL, B BANKSEL _RXF4SIDH ; .line 324; ecan.c _SetStdRXFnValue(RXF4, ECAN_RXF4_VAL); CLRF _RXF4SIDH, B BANKSEL _RXF4SIDL CLRF _RXF4SIDL, B BANKSEL _RXF5SIDH ; .line 332; ecan.c _SetStdRXFnValue(RXF5, ECAN_RXF4_VAL); CLRF _RXF5SIDH, B BANKSEL _RXF5SIDL CLRF _RXF5SIDL, B BANKSEL _RXM0SIDH ; .line 474; ecan.c _SetStdRXMnValue(0, ECAN_RXM0_VAL); CLRF _RXM0SIDH, B BANKSEL _RXM0SIDL CLRF _RXM0SIDL, B BANKSEL _RXM0SIDLbits ; .line 475; ecan.c RXM0SIDL_EXIDEN = 0; BCF _RXM0SIDLbits, 3, B BANKSEL _RXM1SIDH ; .line 482; ecan.c _SetStdRXMnValue(1, ECAN_RXM1_VAL); CLRF _RXM1SIDH, B BANKSEL _RXM1SIDL CLRF _RXM1SIDL, B BANKSEL _RXM1SIDLbits ; .line 483; ecan.c RXM1SIDL_EXIDEN = 0; BCF _RXM1SIDLbits, 3, B ; .line 494; ecan.c ECANSetOperationMode(ECAN_INIT_MODE); MOVLW 0x00 MOVWF POSTDEC1 CALL _ECANSetOperationMode INCF FSR1L, F MOVFF PREINC1, FSR2L RETURN ; Statistics: ; code size: 3294 (0x0cde) bytes ( 2.51%) ; 1647 (0x066f) words ; udata size: 33 (0x0021) bytes ( 0.86%) ; access size: 22 (0x0016) bytes end