;-------------------------------------------------------- ; File Created by SDCC : free open source ANSI-C Compiler ; Version 3.0.0 #6037 (Oct 31 2010) (Linux) ; This file was generated Mon Jan 30 00:10:42 2012 ;-------------------------------------------------------- .module servo .optsdcc -mmcs51 --model-medium ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- .globl _servoSetSpeed_PARM_2 .globl _servoSetTargetHighRes_PARM_2 .globl _servoSetTarget_PARM_2 .globl _servosStart_PARM_2 .globl _servoCounter .globl _ISR_T1 .globl _servosStart .globl _servosStop .globl _servosStarted .globl _servosMoving .globl _servoSetTarget .globl _servoSetTargetHighRes .globl _servoGetTarget .globl _servoGetPosition .globl _servoGetTargetHighRes .globl _servoGetPositionHighRes .globl _servoSetSpeed .globl _servoGetSpeed ;-------------------------------------------------------- ; special function registers ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 Fservo$P0$0$0 == 0x0080 _P0 = 0x0080 Fservo$SP$0$0 == 0x0081 _SP = 0x0081 Fservo$DPL0$0$0 == 0x0082 _DPL0 = 0x0082 Fservo$DPH0$0$0 == 0x0083 _DPH0 = 0x0083 Fservo$DPL1$0$0 == 0x0084 _DPL1 = 0x0084 Fservo$DPH1$0$0 == 0x0085 _DPH1 = 0x0085 Fservo$U0CSR$0$0 == 0x0086 _U0CSR = 0x0086 Fservo$PCON$0$0 == 0x0087 _PCON = 0x0087 Fservo$TCON$0$0 == 0x0088 _TCON = 0x0088 Fservo$P0IFG$0$0 == 0x0089 _P0IFG = 0x0089 Fservo$P1IFG$0$0 == 0x008a _P1IFG = 0x008a Fservo$P2IFG$0$0 == 0x008b _P2IFG = 0x008b Fservo$PICTL$0$0 == 0x008c _PICTL = 0x008c Fservo$P1IEN$0$0 == 0x008d _P1IEN = 0x008d Fservo$P0INP$0$0 == 0x008f _P0INP = 0x008f Fservo$P1$0$0 == 0x0090 _P1 = 0x0090 Fservo$RFIM$0$0 == 0x0091 _RFIM = 0x0091 Fservo$DPS$0$0 == 0x0092 _DPS = 0x0092 Fservo$MPAGE$0$0 == 0x0093 _MPAGE = 0x0093 Fservo$ENDIAN$0$0 == 0x0095 _ENDIAN = 0x0095 Fservo$S0CON$0$0 == 0x0098 _S0CON = 0x0098 Fservo$IEN2$0$0 == 0x009a _IEN2 = 0x009a Fservo$S1CON$0$0 == 0x009b _S1CON = 0x009b Fservo$T2CT$0$0 == 0x009c _T2CT = 0x009c Fservo$T2PR$0$0 == 0x009d _T2PR = 0x009d Fservo$T2CTL$0$0 == 0x009e _T2CTL = 0x009e Fservo$P2$0$0 == 0x00a0 _P2 = 0x00a0 Fservo$WORIRQ$0$0 == 0x00a1 _WORIRQ = 0x00a1 Fservo$WORCTRL$0$0 == 0x00a2 _WORCTRL = 0x00a2 Fservo$WOREVT0$0$0 == 0x00a3 _WOREVT0 = 0x00a3 Fservo$WOREVT1$0$0 == 0x00a4 _WOREVT1 = 0x00a4 Fservo$WORTIME0$0$0 == 0x00a5 _WORTIME0 = 0x00a5 Fservo$WORTIME1$0$0 == 0x00a6 _WORTIME1 = 0x00a6 Fservo$IEN0$0$0 == 0x00a8 _IEN0 = 0x00a8 Fservo$IP0$0$0 == 0x00a9 _IP0 = 0x00a9 Fservo$FWT$0$0 == 0x00ab _FWT = 0x00ab Fservo$FADDRL$0$0 == 0x00ac _FADDRL = 0x00ac Fservo$FADDRH$0$0 == 0x00ad _FADDRH = 0x00ad Fservo$FCTL$0$0 == 0x00ae _FCTL = 0x00ae Fservo$FWDATA$0$0 == 0x00af _FWDATA = 0x00af Fservo$ENCDI$0$0 == 0x00b1 _ENCDI = 0x00b1 Fservo$ENCDO$0$0 == 0x00b2 _ENCDO = 0x00b2 Fservo$ENCCS$0$0 == 0x00b3 _ENCCS = 0x00b3 Fservo$ADCCON1$0$0 == 0x00b4 _ADCCON1 = 0x00b4 Fservo$ADCCON2$0$0 == 0x00b5 _ADCCON2 = 0x00b5 Fservo$ADCCON3$0$0 == 0x00b6 _ADCCON3 = 0x00b6 Fservo$IEN1$0$0 == 0x00b8 _IEN1 = 0x00b8 Fservo$IP1$0$0 == 0x00b9 _IP1 = 0x00b9 Fservo$ADCL$0$0 == 0x00ba _ADCL = 0x00ba Fservo$ADCH$0$0 == 0x00bb _ADCH = 0x00bb Fservo$RNDL$0$0 == 0x00bc _RNDL = 0x00bc Fservo$RNDH$0$0 == 0x00bd _RNDH = 0x00bd Fservo$SLEEP$0$0 == 0x00be _SLEEP = 0x00be Fservo$IRCON$0$0 == 0x00c0 _IRCON = 0x00c0 Fservo$U0DBUF$0$0 == 0x00c1 _U0DBUF = 0x00c1 Fservo$U0BAUD$0$0 == 0x00c2 _U0BAUD = 0x00c2 Fservo$U0UCR$0$0 == 0x00c4 _U0UCR = 0x00c4 Fservo$U0GCR$0$0 == 0x00c5 _U0GCR = 0x00c5 Fservo$CLKCON$0$0 == 0x00c6 _CLKCON = 0x00c6 Fservo$MEMCTR$0$0 == 0x00c7 _MEMCTR = 0x00c7 Fservo$WDCTL$0$0 == 0x00c9 _WDCTL = 0x00c9 Fservo$T3CNT$0$0 == 0x00ca _T3CNT = 0x00ca Fservo$T3CTL$0$0 == 0x00cb _T3CTL = 0x00cb Fservo$T3CCTL0$0$0 == 0x00cc _T3CCTL0 = 0x00cc Fservo$T3CC0$0$0 == 0x00cd _T3CC0 = 0x00cd Fservo$T3CCTL1$0$0 == 0x00ce _T3CCTL1 = 0x00ce Fservo$T3CC1$0$0 == 0x00cf _T3CC1 = 0x00cf Fservo$PSW$0$0 == 0x00d0 _PSW = 0x00d0 Fservo$DMAIRQ$0$0 == 0x00d1 _DMAIRQ = 0x00d1 Fservo$DMA1CFGL$0$0 == 0x00d2 _DMA1CFGL = 0x00d2 Fservo$DMA1CFGH$0$0 == 0x00d3 _DMA1CFGH = 0x00d3 Fservo$DMA0CFGL$0$0 == 0x00d4 _DMA0CFGL = 0x00d4 Fservo$DMA0CFGH$0$0 == 0x00d5 _DMA0CFGH = 0x00d5 Fservo$DMAARM$0$0 == 0x00d6 _DMAARM = 0x00d6 Fservo$DMAREQ$0$0 == 0x00d7 _DMAREQ = 0x00d7 Fservo$TIMIF$0$0 == 0x00d8 _TIMIF = 0x00d8 Fservo$RFD$0$0 == 0x00d9 _RFD = 0x00d9 Fservo$T1CC0L$0$0 == 0x00da _T1CC0L = 0x00da Fservo$T1CC0H$0$0 == 0x00db _T1CC0H = 0x00db Fservo$T1CC1L$0$0 == 0x00dc _T1CC1L = 0x00dc Fservo$T1CC1H$0$0 == 0x00dd _T1CC1H = 0x00dd Fservo$T1CC2L$0$0 == 0x00de _T1CC2L = 0x00de Fservo$T1CC2H$0$0 == 0x00df _T1CC2H = 0x00df Fservo$ACC$0$0 == 0x00e0 _ACC = 0x00e0 Fservo$RFST$0$0 == 0x00e1 _RFST = 0x00e1 Fservo$T1CNTL$0$0 == 0x00e2 _T1CNTL = 0x00e2 Fservo$T1CNTH$0$0 == 0x00e3 _T1CNTH = 0x00e3 Fservo$T1CTL$0$0 == 0x00e4 _T1CTL = 0x00e4 Fservo$T1CCTL0$0$0 == 0x00e5 _T1CCTL0 = 0x00e5 Fservo$T1CCTL1$0$0 == 0x00e6 _T1CCTL1 = 0x00e6 Fservo$T1CCTL2$0$0 == 0x00e7 _T1CCTL2 = 0x00e7 Fservo$IRCON2$0$0 == 0x00e8 _IRCON2 = 0x00e8 Fservo$RFIF$0$0 == 0x00e9 _RFIF = 0x00e9 Fservo$T4CNT$0$0 == 0x00ea _T4CNT = 0x00ea Fservo$T4CTL$0$0 == 0x00eb _T4CTL = 0x00eb Fservo$T4CCTL0$0$0 == 0x00ec _T4CCTL0 = 0x00ec Fservo$T4CC0$0$0 == 0x00ed _T4CC0 = 0x00ed Fservo$T4CCTL1$0$0 == 0x00ee _T4CCTL1 = 0x00ee Fservo$T4CC1$0$0 == 0x00ef _T4CC1 = 0x00ef Fservo$B$0$0 == 0x00f0 _B = 0x00f0 Fservo$PERCFG$0$0 == 0x00f1 _PERCFG = 0x00f1 Fservo$ADCCFG$0$0 == 0x00f2 _ADCCFG = 0x00f2 Fservo$P0SEL$0$0 == 0x00f3 _P0SEL = 0x00f3 Fservo$P1SEL$0$0 == 0x00f4 _P1SEL = 0x00f4 Fservo$P2SEL$0$0 == 0x00f5 _P2SEL = 0x00f5 Fservo$P1INP$0$0 == 0x00f6 _P1INP = 0x00f6 Fservo$P2INP$0$0 == 0x00f7 _P2INP = 0x00f7 Fservo$U1CSR$0$0 == 0x00f8 _U1CSR = 0x00f8 Fservo$U1DBUF$0$0 == 0x00f9 _U1DBUF = 0x00f9 Fservo$U1BAUD$0$0 == 0x00fa _U1BAUD = 0x00fa Fservo$U1UCR$0$0 == 0x00fb _U1UCR = 0x00fb Fservo$U1GCR$0$0 == 0x00fc _U1GCR = 0x00fc Fservo$P0DIR$0$0 == 0x00fd _P0DIR = 0x00fd Fservo$P1DIR$0$0 == 0x00fe _P1DIR = 0x00fe Fservo$P2DIR$0$0 == 0x00ff _P2DIR = 0x00ff Fservo$DMA0CFG$0$0 == 0xffffd5d4 _DMA0CFG = 0xffffd5d4 Fservo$DMA1CFG$0$0 == 0xffffd3d2 _DMA1CFG = 0xffffd3d2 Fservo$FADDR$0$0 == 0xffffadac _FADDR = 0xffffadac Fservo$ADC$0$0 == 0xffffbbba _ADC = 0xffffbbba Fservo$T1CC0$0$0 == 0xffffdbda _T1CC0 = 0xffffdbda Fservo$T1CC1$0$0 == 0xffffdddc _T1CC1 = 0xffffdddc Fservo$T1CC2$0$0 == 0xffffdfde _T1CC2 = 0xffffdfde ;-------------------------------------------------------- ; special function bits ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 Fservo$P0_0$0$0 == 0x0080 _P0_0 = 0x0080 Fservo$P0_1$0$0 == 0x0081 _P0_1 = 0x0081 Fservo$P0_2$0$0 == 0x0082 _P0_2 = 0x0082 Fservo$P0_3$0$0 == 0x0083 _P0_3 = 0x0083 Fservo$P0_4$0$0 == 0x0084 _P0_4 = 0x0084 Fservo$P0_5$0$0 == 0x0085 _P0_5 = 0x0085 Fservo$P0_6$0$0 == 0x0086 _P0_6 = 0x0086 Fservo$P0_7$0$0 == 0x0087 _P0_7 = 0x0087 Fservo$_TCON_0$0$0 == 0x0088 __TCON_0 = 0x0088 Fservo$RFTXRXIF$0$0 == 0x0089 _RFTXRXIF = 0x0089 Fservo$_TCON_2$0$0 == 0x008a __TCON_2 = 0x008a Fservo$URX0IF$0$0 == 0x008b _URX0IF = 0x008b Fservo$_TCON_4$0$0 == 0x008c __TCON_4 = 0x008c Fservo$ADCIF$0$0 == 0x008d _ADCIF = 0x008d Fservo$_TCON_6$0$0 == 0x008e __TCON_6 = 0x008e Fservo$URX1IF$0$0 == 0x008f _URX1IF = 0x008f Fservo$P1_0$0$0 == 0x0090 _P1_0 = 0x0090 Fservo$P1_1$0$0 == 0x0091 _P1_1 = 0x0091 Fservo$P1_2$0$0 == 0x0092 _P1_2 = 0x0092 Fservo$P1_3$0$0 == 0x0093 _P1_3 = 0x0093 Fservo$P1_4$0$0 == 0x0094 _P1_4 = 0x0094 Fservo$P1_5$0$0 == 0x0095 _P1_5 = 0x0095 Fservo$P1_6$0$0 == 0x0096 _P1_6 = 0x0096 Fservo$P1_7$0$0 == 0x0097 _P1_7 = 0x0097 Fservo$ENCIF_0$0$0 == 0x0098 _ENCIF_0 = 0x0098 Fservo$ENCIF_1$0$0 == 0x0099 _ENCIF_1 = 0x0099 Fservo$_SOCON2$0$0 == 0x009a __SOCON2 = 0x009a Fservo$_SOCON3$0$0 == 0x009b __SOCON3 = 0x009b Fservo$_SOCON4$0$0 == 0x009c __SOCON4 = 0x009c Fservo$_SOCON5$0$0 == 0x009d __SOCON5 = 0x009d Fservo$_SOCON6$0$0 == 0x009e __SOCON6 = 0x009e Fservo$_SOCON7$0$0 == 0x009f __SOCON7 = 0x009f Fservo$P2_0$0$0 == 0x00a0 _P2_0 = 0x00a0 Fservo$P2_1$0$0 == 0x00a1 _P2_1 = 0x00a1 Fservo$P2_2$0$0 == 0x00a2 _P2_2 = 0x00a2 Fservo$P2_3$0$0 == 0x00a3 _P2_3 = 0x00a3 Fservo$P2_4$0$0 == 0x00a4 _P2_4 = 0x00a4 Fservo$P2_5$0$0 == 0x00a5 _P2_5 = 0x00a5 Fservo$P2_6$0$0 == 0x00a6 _P2_6 = 0x00a6 Fservo$P2_7$0$0 == 0x00a7 _P2_7 = 0x00a7 Fservo$RFTXRXIE$0$0 == 0x00a8 _RFTXRXIE = 0x00a8 Fservo$ADCIE$0$0 == 0x00a9 _ADCIE = 0x00a9 Fservo$URX0IE$0$0 == 0x00aa _URX0IE = 0x00aa Fservo$URX1IE$0$0 == 0x00ab _URX1IE = 0x00ab Fservo$ENCIE$0$0 == 0x00ac _ENCIE = 0x00ac Fservo$STIE$0$0 == 0x00ad _STIE = 0x00ad Fservo$_IEN06$0$0 == 0x00ae __IEN06 = 0x00ae Fservo$EA$0$0 == 0x00af _EA = 0x00af Fservo$DMAIE$0$0 == 0x00b8 _DMAIE = 0x00b8 Fservo$T1IE$0$0 == 0x00b9 _T1IE = 0x00b9 Fservo$T2IE$0$0 == 0x00ba _T2IE = 0x00ba Fservo$T3IE$0$0 == 0x00bb _T3IE = 0x00bb Fservo$T4IE$0$0 == 0x00bc _T4IE = 0x00bc Fservo$P0IE$0$0 == 0x00bd _P0IE = 0x00bd Fservo$_IEN16$0$0 == 0x00be __IEN16 = 0x00be Fservo$_IEN17$0$0 == 0x00bf __IEN17 = 0x00bf Fservo$DMAIF$0$0 == 0x00c0 _DMAIF = 0x00c0 Fservo$T1IF$0$0 == 0x00c1 _T1IF = 0x00c1 Fservo$T2IF$0$0 == 0x00c2 _T2IF = 0x00c2 Fservo$T3IF$0$0 == 0x00c3 _T3IF = 0x00c3 Fservo$T4IF$0$0 == 0x00c4 _T4IF = 0x00c4 Fservo$P0IF$0$0 == 0x00c5 _P0IF = 0x00c5 Fservo$_IRCON6$0$0 == 0x00c6 __IRCON6 = 0x00c6 Fservo$STIF$0$0 == 0x00c7 _STIF = 0x00c7 Fservo$P$0$0 == 0x00d0 _P = 0x00d0 Fservo$F1$0$0 == 0x00d1 _F1 = 0x00d1 Fservo$OV$0$0 == 0x00d2 _OV = 0x00d2 Fservo$RS0$0$0 == 0x00d3 _RS0 = 0x00d3 Fservo$RS1$0$0 == 0x00d4 _RS1 = 0x00d4 Fservo$F0$0$0 == 0x00d5 _F0 = 0x00d5 Fservo$AC$0$0 == 0x00d6 _AC = 0x00d6 Fservo$CY$0$0 == 0x00d7 _CY = 0x00d7 Fservo$T3OVFIF$0$0 == 0x00d8 _T3OVFIF = 0x00d8 Fservo$T3CH0IF$0$0 == 0x00d9 _T3CH0IF = 0x00d9 Fservo$T3CH1IF$0$0 == 0x00da _T3CH1IF = 0x00da Fservo$T4OVFIF$0$0 == 0x00db _T4OVFIF = 0x00db Fservo$T4CH0IF$0$0 == 0x00dc _T4CH0IF = 0x00dc Fservo$T4CH1IF$0$0 == 0x00dd _T4CH1IF = 0x00dd Fservo$OVFIM$0$0 == 0x00de _OVFIM = 0x00de Fservo$_TIMIF7$0$0 == 0x00df __TIMIF7 = 0x00df Fservo$ACC_0$0$0 == 0x00e0 _ACC_0 = 0x00e0 Fservo$ACC_1$0$0 == 0x00e1 _ACC_1 = 0x00e1 Fservo$ACC_2$0$0 == 0x00e2 _ACC_2 = 0x00e2 Fservo$ACC_3$0$0 == 0x00e3 _ACC_3 = 0x00e3 Fservo$ACC_4$0$0 == 0x00e4 _ACC_4 = 0x00e4 Fservo$ACC_5$0$0 == 0x00e5 _ACC_5 = 0x00e5 Fservo$ACC_6$0$0 == 0x00e6 _ACC_6 = 0x00e6 Fservo$ACC_7$0$0 == 0x00e7 _ACC_7 = 0x00e7 Fservo$P2IF$0$0 == 0x00e8 _P2IF = 0x00e8 Fservo$UTX0IF$0$0 == 0x00e9 _UTX0IF = 0x00e9 Fservo$UTX1IF$0$0 == 0x00ea _UTX1IF = 0x00ea Fservo$P1IF$0$0 == 0x00eb _P1IF = 0x00eb Fservo$WDTIF$0$0 == 0x00ec _WDTIF = 0x00ec Fservo$_IRCON25$0$0 == 0x00ed __IRCON25 = 0x00ed Fservo$_IRCON26$0$0 == 0x00ee __IRCON26 = 0x00ee Fservo$_IRCON27$0$0 == 0x00ef __IRCON27 = 0x00ef Fservo$B_0$0$0 == 0x00f0 _B_0 = 0x00f0 Fservo$B_1$0$0 == 0x00f1 _B_1 = 0x00f1 Fservo$B_2$0$0 == 0x00f2 _B_2 = 0x00f2 Fservo$B_3$0$0 == 0x00f3 _B_3 = 0x00f3 Fservo$B_4$0$0 == 0x00f4 _B_4 = 0x00f4 Fservo$B_5$0$0 == 0x00f5 _B_5 = 0x00f5 Fservo$B_6$0$0 == 0x00f6 _B_6 = 0x00f6 Fservo$B_7$0$0 == 0x00f7 _B_7 = 0x00f7 Fservo$U1ACTIVE$0$0 == 0x00f8 _U1ACTIVE = 0x00f8 Fservo$U1TX_BYTE$0$0 == 0x00f9 _U1TX_BYTE = 0x00f9 Fservo$U1RX_BYTE$0$0 == 0x00fa _U1RX_BYTE = 0x00fa Fservo$U1ERR$0$0 == 0x00fb _U1ERR = 0x00fb Fservo$U1FE$0$0 == 0x00fc _U1FE = 0x00fc Fservo$U1SLAVE$0$0 == 0x00fd _U1SLAVE = 0x00fd Fservo$U1RE$0$0 == 0x00fe _U1RE = 0x00fe Fservo$U1MODE$0$0 == 0x00ff _U1MODE = 0x00ff ;-------------------------------------------------------- ; overlayable register banks ;-------------------------------------------------------- .area REG_BANK_0 (REL,OVR,DATA) .ds 8 ;-------------------------------------------------------- ; internal ram data ;-------------------------------------------------------- .area DSEG (DATA) G$servoCounter$0$0==. _servoCounter:: .ds 1 LISR_T1$sloc0$1$0==. _ISR_T1_sloc0_1_0: .ds 2 ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- .area OSEG (OVR,DATA) ;-------------------------------------------------------- ; indirectly addressable internal ram data ;-------------------------------------------------------- .area ISEG (DATA) ;-------------------------------------------------------- ; absolute internal ram data ;-------------------------------------------------------- .area IABS (ABS,DATA) .area IABS (ABS,DATA) ;-------------------------------------------------------- ; bit data ;-------------------------------------------------------- .area BSEG (BIT) Fservo$servosStartedFlag$0$0==. _servosStartedFlag: .ds 1 Fservo$servosMovingFlag$0$0==. _servosMovingFlag: .ds 1 ;-------------------------------------------------------- ; paged external ram data ;-------------------------------------------------------- .area PSEG (PAG,XDATA) Fservo$servoPinsOnPort0$0$0==. _servoPinsOnPort0: .ds 1 Fservo$servoPinsOnPort1$0$0==. _servoPinsOnPort1: .ds 1 LISR_T1$d$3$3==. _ISR_T1_d_3_3: .ds 2 LservosStart$numPins$1$1==. _servosStart_PARM_2: .ds 1 LservoSetTarget$targetMicroseconds$1$1==. _servoSetTarget_PARM_2: .ds 2 LservoSetTargetHighRes$target$1$1==. _servoSetTargetHighRes_PARM_2: .ds 2 LservoSetTargetHighRes$d$1$1==. _servoSetTargetHighRes_d_1_1: .ds 2 LservoSetSpeed$speed$1$1==. _servoSetSpeed_PARM_2: .ds 2 ;-------------------------------------------------------- ; external ram data ;-------------------------------------------------------- .area XSEG (XDATA) Fservo$SYNC1$0$0 == 0xdf00 _SYNC1 = 0xdf00 Fservo$SYNC0$0$0 == 0xdf01 _SYNC0 = 0xdf01 Fservo$PKTLEN$0$0 == 0xdf02 _PKTLEN = 0xdf02 Fservo$PKTCTRL1$0$0 == 0xdf03 _PKTCTRL1 = 0xdf03 Fservo$PKTCTRL0$0$0 == 0xdf04 _PKTCTRL0 = 0xdf04 Fservo$ADDR$0$0 == 0xdf05 _ADDR = 0xdf05 Fservo$CHANNR$0$0 == 0xdf06 _CHANNR = 0xdf06 Fservo$FSCTRL1$0$0 == 0xdf07 _FSCTRL1 = 0xdf07 Fservo$FSCTRL0$0$0 == 0xdf08 _FSCTRL0 = 0xdf08 Fservo$FREQ2$0$0 == 0xdf09 _FREQ2 = 0xdf09 Fservo$FREQ1$0$0 == 0xdf0a _FREQ1 = 0xdf0a Fservo$FREQ0$0$0 == 0xdf0b _FREQ0 = 0xdf0b Fservo$MDMCFG4$0$0 == 0xdf0c _MDMCFG4 = 0xdf0c Fservo$MDMCFG3$0$0 == 0xdf0d _MDMCFG3 = 0xdf0d Fservo$MDMCFG2$0$0 == 0xdf0e _MDMCFG2 = 0xdf0e Fservo$MDMCFG1$0$0 == 0xdf0f _MDMCFG1 = 0xdf0f Fservo$MDMCFG0$0$0 == 0xdf10 _MDMCFG0 = 0xdf10 Fservo$DEVIATN$0$0 == 0xdf11 _DEVIATN = 0xdf11 Fservo$MCSM2$0$0 == 0xdf12 _MCSM2 = 0xdf12 Fservo$MCSM1$0$0 == 0xdf13 _MCSM1 = 0xdf13 Fservo$MCSM0$0$0 == 0xdf14 _MCSM0 = 0xdf14 Fservo$FOCCFG$0$0 == 0xdf15 _FOCCFG = 0xdf15 Fservo$BSCFG$0$0 == 0xdf16 _BSCFG = 0xdf16 Fservo$AGCCTRL2$0$0 == 0xdf17 _AGCCTRL2 = 0xdf17 Fservo$AGCCTRL1$0$0 == 0xdf18 _AGCCTRL1 = 0xdf18 Fservo$AGCCTRL0$0$0 == 0xdf19 _AGCCTRL0 = 0xdf19 Fservo$FREND1$0$0 == 0xdf1a _FREND1 = 0xdf1a Fservo$FREND0$0$0 == 0xdf1b _FREND0 = 0xdf1b Fservo$FSCAL3$0$0 == 0xdf1c _FSCAL3 = 0xdf1c Fservo$FSCAL2$0$0 == 0xdf1d _FSCAL2 = 0xdf1d Fservo$FSCAL1$0$0 == 0xdf1e _FSCAL1 = 0xdf1e Fservo$FSCAL0$0$0 == 0xdf1f _FSCAL0 = 0xdf1f Fservo$TEST2$0$0 == 0xdf23 _TEST2 = 0xdf23 Fservo$TEST1$0$0 == 0xdf24 _TEST1 = 0xdf24 Fservo$TEST0$0$0 == 0xdf25 _TEST0 = 0xdf25 Fservo$PA_TABLE0$0$0 == 0xdf2e _PA_TABLE0 = 0xdf2e Fservo$IOCFG2$0$0 == 0xdf2f _IOCFG2 = 0xdf2f Fservo$IOCFG1$0$0 == 0xdf30 _IOCFG1 = 0xdf30 Fservo$IOCFG0$0$0 == 0xdf31 _IOCFG0 = 0xdf31 Fservo$PARTNUM$0$0 == 0xdf36 _PARTNUM = 0xdf36 Fservo$VERSION$0$0 == 0xdf37 _VERSION = 0xdf37 Fservo$FREQEST$0$0 == 0xdf38 _FREQEST = 0xdf38 Fservo$LQI$0$0 == 0xdf39 _LQI = 0xdf39 Fservo$RSSI$0$0 == 0xdf3a _RSSI = 0xdf3a Fservo$MARCSTATE$0$0 == 0xdf3b _MARCSTATE = 0xdf3b Fservo$PKTSTATUS$0$0 == 0xdf3c _PKTSTATUS = 0xdf3c Fservo$VCO_VC_DAC$0$0 == 0xdf3d _VCO_VC_DAC = 0xdf3d Fservo$I2SCFG0$0$0 == 0xdf40 _I2SCFG0 = 0xdf40 Fservo$I2SCFG1$0$0 == 0xdf41 _I2SCFG1 = 0xdf41 Fservo$I2SDATL$0$0 == 0xdf42 _I2SDATL = 0xdf42 Fservo$I2SDATH$0$0 == 0xdf43 _I2SDATH = 0xdf43 Fservo$I2SWCNT$0$0 == 0xdf44 _I2SWCNT = 0xdf44 Fservo$I2SSTAT$0$0 == 0xdf45 _I2SSTAT = 0xdf45 Fservo$I2SCLKF0$0$0 == 0xdf46 _I2SCLKF0 = 0xdf46 Fservo$I2SCLKF1$0$0 == 0xdf47 _I2SCLKF1 = 0xdf47 Fservo$I2SCLKF2$0$0 == 0xdf48 _I2SCLKF2 = 0xdf48 Fservo$USBADDR$0$0 == 0xde00 _USBADDR = 0xde00 Fservo$USBPOW$0$0 == 0xde01 _USBPOW = 0xde01 Fservo$USBIIF$0$0 == 0xde02 _USBIIF = 0xde02 Fservo$USBOIF$0$0 == 0xde04 _USBOIF = 0xde04 Fservo$USBCIF$0$0 == 0xde06 _USBCIF = 0xde06 Fservo$USBIIE$0$0 == 0xde07 _USBIIE = 0xde07 Fservo$USBOIE$0$0 == 0xde09 _USBOIE = 0xde09 Fservo$USBCIE$0$0 == 0xde0b _USBCIE = 0xde0b Fservo$USBFRML$0$0 == 0xde0c _USBFRML = 0xde0c Fservo$USBFRMH$0$0 == 0xde0d _USBFRMH = 0xde0d Fservo$USBINDEX$0$0 == 0xde0e _USBINDEX = 0xde0e Fservo$USBMAXI$0$0 == 0xde10 _USBMAXI = 0xde10 Fservo$USBCSIL$0$0 == 0xde11 _USBCSIL = 0xde11 Fservo$USBCSIH$0$0 == 0xde12 _USBCSIH = 0xde12 Fservo$USBMAXO$0$0 == 0xde13 _USBMAXO = 0xde13 Fservo$USBCSOL$0$0 == 0xde14 _USBCSOL = 0xde14 Fservo$USBCSOH$0$0 == 0xde15 _USBCSOH = 0xde15 Fservo$USBCNTL$0$0 == 0xde16 _USBCNTL = 0xde16 Fservo$USBCNTH$0$0 == 0xde17 _USBCNTH = 0xde17 Fservo$USBF0$0$0 == 0xde20 _USBF0 = 0xde20 Fservo$USBF1$0$0 == 0xde22 _USBF1 = 0xde22 Fservo$USBF2$0$0 == 0xde24 _USBF2 = 0xde24 Fservo$USBF3$0$0 == 0xde26 _USBF3 = 0xde26 Fservo$USBF4$0$0 == 0xde28 _USBF4 = 0xde28 Fservo$USBF5$0$0 == 0xde2a _USBF5 = 0xde2a Fservo$servoAssignment$0$0==. _servoAssignment: .ds 6 Fservo$servoData$0$0==. _servoData: .ds 48 ;-------------------------------------------------------- ; absolute external ram data ;-------------------------------------------------------- .area XABS (ABS,XDATA) ;-------------------------------------------------------- ; external initialized ram data ;-------------------------------------------------------- .area XISEG (XDATA) .area HOME (CODE) .area GSINIT0 (CODE) .area GSINIT1 (CODE) .area GSINIT2 (CODE) .area GSINIT3 (CODE) .area GSINIT4 (CODE) .area GSINIT5 (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area CSEG (CODE) ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- .area HOME (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area GSINIT (CODE) G$servoGetSpeed$0$0 ==. C$servo.c$34$1$1 ==. ; libraries/src/servo/servo.c:34: volatile uint8 DATA servoCounter = 0; mov _servoCounter,#0x00 G$servoGetSpeed$0$0 ==. C$servo.c$28$1$1 ==. ; libraries/src/servo/servo.c:28: static BIT servosStartedFlag = 0; clr _servosStartedFlag G$servoGetSpeed$0$0 ==. C$servo.c$32$1$1 ==. ; libraries/src/servo/servo.c:32: static volatile BIT servosMovingFlag = 0; clr _servosMovingFlag ;-------------------------------------------------------- ; Home ;-------------------------------------------------------- .area HOME (CODE) .area HOME (CODE) ;-------------------------------------------------------- ; code ;-------------------------------------------------------- .area CSEG (CODE) ;------------------------------------------------------------ ;Allocation info for local variables in function 'ISR_T1' ;------------------------------------------------------------ ;sloc0 Allocated with name '_ISR_T1_sloc0_1_0' ;------------------------------------------------------------ G$ISR_T1$0$0 ==. C$servo.c$59$0$0 ==. ; libraries/src/servo/servo.c:59: ISR(T1, 0) ; ----------------------------------------- ; function ISR_T1 ; ----------------------------------------- _ISR_T1: ar2 = 0x02 ar3 = 0x03 ar4 = 0x04 ar5 = 0x05 ar6 = 0x06 ar7 = 0x07 ar0 = 0x00 ar1 = 0x01 push acc push dpl push dph push ar2 push ar3 push ar4 push ar5 push ar6 push ar7 push ar0 push psw mov psw,#0x00 C$servo.c$63$1$1 ==. ; libraries/src/servo/servo.c:63: switch(servoCounter++) mov r2,_servoCounter inc _servoCounter mov a,#0x06 cjne a,ar2,00137$ 00137$: jnc 00138$ ljmp 00126$ 00138$: mov a,r2 add a,r2 add a,r2 mov dptr,#00139$ jmp @a+dptr 00139$: ljmp 00101$ ljmp 00103$ ljmp 00105$ ljmp 00102$ ljmp 00104$ ljmp 00106$ ljmp 00107$ C$servo.c$65$2$2 ==. ; libraries/src/servo/servo.c:65: case 0: 00101$: C$servo.c$66$2$2 ==. ; libraries/src/servo/servo.c:66: PERCFG &= ~(1<<6); // PERCFG.T1CFG = 0: Move Timer 1 to Alt. 1 location (P0_2, P0_3, P0_4) anl _PERCFG,#0xBF C$servo.c$67$2$2 ==. ; libraries/src/servo/servo.c:67: P0SEL |= servoPinsOnPort0; mov r0,#_servoPinsOnPort0 movx a,@r0 orl _P0SEL,a C$servo.c$68$2$2 ==. ; libraries/src/servo/servo.c:68: T1CC0 = servoData[0].positionReg; // NOTE: T1CCx is buffered, so these commands mov dptr,#(_servoData + 0x0004) movx a,@dptr mov _T1CC0,a inc dptr movx a,@dptr mov (_T1CC0 >> 8),a C$servo.c$69$2$2 ==. ; libraries/src/servo/servo.c:69: T1CC1 = servoData[1].positionReg; // don't take effect until the next timer period. mov dptr,#(_servoData + 0x000c) movx a,@dptr mov _T1CC1,a inc dptr movx a,@dptr mov (_T1CC1 >> 8),a C$servo.c$70$2$2 ==. ; libraries/src/servo/servo.c:70: T1CC2 = servoData[2].positionReg; mov dptr,#(_servoData + 0x0014) movx a,@dptr mov _T1CC2,a inc dptr movx a,@dptr mov (_T1CC2 >> 8),a C$servo.c$71$2$2 ==. ; libraries/src/servo/servo.c:71: break; ljmp 00126$ C$servo.c$73$2$2 ==. ; libraries/src/servo/servo.c:73: case 3: 00102$: C$servo.c$74$2$2 ==. ; libraries/src/servo/servo.c:74: PERCFG |= (1<<6); // PERCFG.T1CFG = 1: Move Timer 1 to Alt. 2 location (P1_2, P1_1, P1_0) orl _PERCFG,#0x40 C$servo.c$75$2$2 ==. ; libraries/src/servo/servo.c:75: P1SEL |= servoPinsOnPort1; mov r0,#_servoPinsOnPort1 movx a,@r0 orl _P1SEL,a C$servo.c$76$2$2 ==. ; libraries/src/servo/servo.c:76: T1CC0 = servoData[3].positionReg; mov dptr,#(_servoData + 0x001c) movx a,@dptr mov _T1CC0,a inc dptr movx a,@dptr mov (_T1CC0 >> 8),a C$servo.c$77$2$2 ==. ; libraries/src/servo/servo.c:77: T1CC1 = servoData[4].positionReg; mov dptr,#(_servoData + 0x0024) movx a,@dptr mov _T1CC1,a inc dptr movx a,@dptr mov (_T1CC1 >> 8),a C$servo.c$78$2$2 ==. ; libraries/src/servo/servo.c:78: T1CC2 = servoData[5].positionReg; mov dptr,#(_servoData + 0x002c) movx a,@dptr mov _T1CC2,a inc dptr movx a,@dptr mov (_T1CC2 >> 8),a C$servo.c$79$2$2 ==. ; libraries/src/servo/servo.c:79: break; ljmp 00126$ C$servo.c$81$2$2 ==. ; libraries/src/servo/servo.c:81: case 1: 00103$: C$servo.c$82$2$2 ==. ; libraries/src/servo/servo.c:82: case 4: 00104$: C$servo.c$84$2$2 ==. ; libraries/src/servo/servo.c:84: T1CC0 = T1CC1 = T1CC2 = 0xFFFF; mov _T1CC2,#0xFF mov (_T1CC2 >> 8),#0xFF mov _T1CC1,#0xFF mov (_T1CC1 >> 8),#0xFF mov _T1CC0,#0xFF mov (_T1CC0 >> 8),#0xFF C$servo.c$85$2$2 ==. ; libraries/src/servo/servo.c:85: break; ljmp 00126$ C$servo.c$87$2$2 ==. ; libraries/src/servo/servo.c:87: case 2: 00105$: C$servo.c$89$2$2 ==. ; libraries/src/servo/servo.c:89: P0SEL &= ~servoPinsOnPort0; mov r0,#_servoPinsOnPort0 movx a,@r0 cpl a mov r2,a anl _P0SEL,a C$servo.c$90$2$2 ==. ; libraries/src/servo/servo.c:90: break; ljmp 00126$ C$servo.c$92$2$2 ==. ; libraries/src/servo/servo.c:92: case 5: 00106$: C$servo.c$94$2$2 ==. ; libraries/src/servo/servo.c:94: P1SEL &= ~servoPinsOnPort1; mov r0,#_servoPinsOnPort1 movx a,@r0 cpl a mov r2,a anl _P1SEL,a C$servo.c$95$2$2 ==. ; libraries/src/servo/servo.c:95: break; ljmp 00126$ C$servo.c$97$2$2 ==. ; libraries/src/servo/servo.c:97: case 6: 00107$: C$servo.c$99$2$2 ==. ; libraries/src/servo/servo.c:99: servoCounter = 0; mov _servoCounter,#0x00 C$servo.c$110$2$2 ==. ; libraries/src/servo/servo.c:110: servosMovingFlag = 0; clr _servosMovingFlag C$servo.c$112$1$1 ==. ; libraries/src/servo/servo.c:112: for(i = 0; i < MAX_SERVOS; i++) mov r2,#0x00 00122$: cjne r2,#0x06,00140$ 00140$: jc 00141$ ljmp 00126$ 00141$: C$servo.c$114$3$3 ==. ; libraries/src/servo/servo.c:114: volatile struct SERVO_DATA XDATA * d = servoData + i; mov ar3,r2 clr a rr a anl a,#0xf8 xch a,r3 swap a rr a xch a,r3 xrl a,r3 xch a,r3 anl a,#0xf8 xch a,r3 xrl a,r3 mov r4,a mov a,r3 add a,#_servoData mov r3,a mov a,r4 addc a,#(_servoData >> 8) mov r4,a mov r0,#_ISR_T1_d_3_3 mov a,r3 movx @r0,a inc r0 mov a,r4 movx @r0,a C$servo.c$115$3$3 ==. ; libraries/src/servo/servo.c:115: uint16 pos = d->position; mov dpl,r3 mov dph,r4 inc dptr inc dptr movx a,@dptr mov r5,a inc dptr movx a,@dptr mov r6,a C$servo.c$117$3$3 ==. ; libraries/src/servo/servo.c:117: if (d->speed && pos) mov a,#0x06 add a,r3 mov dpl,a clr a addc a,r4 mov dph,a movx a,@dptr mov _ISR_T1_sloc0_1_0,a inc dptr movx a,@dptr mov (_ISR_T1_sloc0_1_0 + 1),a mov a,_ISR_T1_sloc0_1_0 orl a,(_ISR_T1_sloc0_1_0 + 1) jz 00118$ mov a,r5 orl a,r6 jz 00118$ C$servo.c$119$4$4 ==. ; libraries/src/servo/servo.c:119: if (d->target > pos) mov dpl,r3 mov dph,r4 movx a,@dptr mov r3,a inc dptr movx a,@dptr mov r4,a clr c mov a,r5 subb a,r3 mov a,r6 subb a,r4 jnc 00115$ C$servo.c$121$1$1 ==. ; libraries/src/servo/servo.c:121: if (d->target - pos < d->speed) push ar2 mov a,r3 clr c subb a,r5 mov r7,a mov a,r4 subb a,r6 mov r2,a clr c mov a,r7 subb a,_ISR_T1_sloc0_1_0 mov a,r2 subb a,(_ISR_T1_sloc0_1_0 + 1) pop ar2 jnc 00109$ C$servo.c$123$6$6 ==. ; libraries/src/servo/servo.c:123: pos = d->target; mov ar5,r3 mov ar6,r4 sjmp 00119$ 00109$: C$servo.c$127$6$7 ==. ; libraries/src/servo/servo.c:127: pos += d->speed; mov a,_ISR_T1_sloc0_1_0 add a,r5 mov r5,a mov a,(_ISR_T1_sloc0_1_0 + 1) addc a,r6 mov r6,a C$servo.c$128$6$7 ==. ; libraries/src/servo/servo.c:128: servosMovingFlag = 1; setb _servosMovingFlag sjmp 00119$ 00115$: C$servo.c$133$1$1 ==. ; libraries/src/servo/servo.c:133: if (pos - d->target < d->speed) push ar2 mov a,r5 clr c subb a,r3 mov r7,a mov a,r6 subb a,r4 mov r2,a clr c mov a,r7 subb a,_ISR_T1_sloc0_1_0 mov a,r2 subb a,(_ISR_T1_sloc0_1_0 + 1) pop ar2 jnc 00112$ C$servo.c$135$6$9 ==. ; libraries/src/servo/servo.c:135: pos = d->target; mov ar5,r3 mov ar6,r4 sjmp 00119$ 00112$: C$servo.c$139$6$10 ==. ; libraries/src/servo/servo.c:139: pos -= d->speed; mov a,r5 clr c subb a,_ISR_T1_sloc0_1_0 mov r5,a mov a,r6 subb a,(_ISR_T1_sloc0_1_0 + 1) mov r6,a C$servo.c$140$6$10 ==. ; libraries/src/servo/servo.c:140: servosMovingFlag = 1; setb _servosMovingFlag sjmp 00119$ 00118$: C$servo.c$146$4$11 ==. ; libraries/src/servo/servo.c:146: pos = d->target; mov r0,#_ISR_T1_d_3_3 movx a,@r0 mov dpl,a inc r0 movx a,@r0 mov dph,a movx a,@dptr mov r5,a inc dptr movx a,@dptr mov r6,a 00119$: C$servo.c$148$3$3 ==. ; libraries/src/servo/servo.c:148: d->position = pos; mov r0,#_ISR_T1_d_3_3 movx a,@r0 mov r3,a inc r0 movx a,@r0 mov r4,a mov dpl,r3 mov dph,r4 inc dptr inc dptr mov a,r5 movx @dptr,a inc dptr mov a,r6 movx @dptr,a C$servo.c$149$3$3 ==. ; libraries/src/servo/servo.c:149: d->positionReg = ~pos + 1; mov dpl,r3 mov dph,r4 inc dptr inc dptr inc dptr inc dptr mov a,r5 cpl a mov r5,a mov a,r6 cpl a mov r6,a inc r5 cjne r5,#0x00,00147$ inc r6 00147$: mov a,r5 movx @dptr,a inc dptr mov a,r6 movx @dptr,a C$servo.c$112$2$2 ==. ; libraries/src/servo/servo.c:112: for(i = 0; i < MAX_SERVOS; i++) inc r2 ljmp 00122$ C$servo.c$153$1$1 ==. ; libraries/src/servo/servo.c:153: } 00126$: pop psw pop ar0 pop ar7 pop ar6 pop ar5 pop ar4 pop ar3 pop ar2 pop dph pop dpl pop acc C$servo.c$154$1$1 ==. XG$ISR_T1$0$0 ==. reti ; eliminated unneeded push/pop ar1 ; eliminated unneeded push/pop b ;------------------------------------------------------------ ;Allocation info for local variables in function 'pinToInternalChannelNumber' ;------------------------------------------------------------ ;------------------------------------------------------------ Fservo$pinToInternalChannelNumber$0$0 ==. C$servo.c$156$1$1 ==. ; libraries/src/servo/servo.c:156: static uint8 pinToInternalChannelNumber(uint8 pin) ; ----------------------------------------- ; function pinToInternalChannelNumber ; ----------------------------------------- _pinToInternalChannelNumber: mov r2,dpl C$servo.c$158$1$1 ==. ; libraries/src/servo/servo.c:158: switch(pin) cjne r2,#0x02,00117$ sjmp 00101$ 00117$: cjne r2,#0x03,00118$ sjmp 00102$ 00118$: cjne r2,#0x04,00119$ sjmp 00103$ 00119$: cjne r2,#0x0A,00120$ sjmp 00106$ 00120$: cjne r2,#0x0B,00121$ sjmp 00105$ 00121$: C$servo.c$160$2$2 ==. ; libraries/src/servo/servo.c:160: case 2: return 0; cjne r2,#0x0C,00107$ sjmp 00104$ 00101$: mov dpl,#0x00 C$servo.c$161$2$2 ==. ; libraries/src/servo/servo.c:161: case 3: return 1; ret 00102$: mov dpl,#0x01 C$servo.c$162$2$2 ==. ; libraries/src/servo/servo.c:162: case 4: return 2; ret 00103$: mov dpl,#0x02 C$servo.c$163$2$2 ==. ; libraries/src/servo/servo.c:163: case 12: return 3; ret 00104$: mov dpl,#0x03 C$servo.c$164$2$2 ==. ; libraries/src/servo/servo.c:164: case 11: return 4; ret 00105$: mov dpl,#0x04 C$servo.c$165$2$2 ==. ; libraries/src/servo/servo.c:165: case 10: return 5; ret 00106$: mov dpl,#0x05 C$servo.c$166$2$2 ==. ; libraries/src/servo/servo.c:166: default: return 0; C$servo.c$167$1$1 ==. ; libraries/src/servo/servo.c:167: } C$servo.c$168$1$1 ==. XFservo$pinToInternalChannelNumber$0$0 ==. ret 00107$: mov dpl,#0x00 ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servosStart' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servosStart$0$0 ==. C$servo.c$170$1$1 ==. ; libraries/src/servo/servo.c:170: void servosStart(uint8 XDATA * pins, uint8 numPins) ; ----------------------------------------- ; function servosStart ; ----------------------------------------- _servosStart: mov r2,dpl mov r3,dph C$servo.c$174$1$1 ==. ; libraries/src/servo/servo.c:174: if (servosStartedFlag) jnb _servosStartedFlag,00102$ C$servo.c$176$2$2 ==. ; libraries/src/servo/servo.c:176: servosStop(); push ar2 push ar3 lcall _servosStop pop ar3 pop ar2 00102$: C$servo.c$184$1$1 ==. ; libraries/src/servo/servo.c:184: if (pins != 0) mov a,r2 orl a,r3 jnz 00131$ ljmp 00115$ 00131$: C$servo.c$186$2$3 ==. ; libraries/src/servo/servo.c:186: servoPinsOnPort0 = servoPinsOnPort1 = 0; mov r0,#_servoPinsOnPort1 clr a movx @r0,a mov r0,#_servoPinsOnPort0 clr a movx @r0,a C$servo.c$187$4$5 ==. ; libraries/src/servo/servo.c:187: for (i = 0; i < MAX_SERVOS; i++) mov r4,#0x00 00116$: cjne r4,#0x06,00132$ 00132$: jc 00133$ ljmp 00119$ 00133$: C$servo.c$189$3$4 ==. ; libraries/src/servo/servo.c:189: servoData[i].target = 0; mov a,r4 swap a rr a anl a,#0xf8 mov r5,a add a,#_servoData mov dpl,a clr a addc a,#(_servoData >> 8) mov dph,a clr a movx @dptr,a inc dptr movx @dptr,a C$servo.c$190$3$4 ==. ; libraries/src/servo/servo.c:190: servoData[i].position = 0; mov a,r5 add a,#_servoData mov r6,a clr a addc a,#(_servoData >> 8) mov r7,a mov dpl,r6 mov dph,r7 inc dptr inc dptr clr a movx @dptr,a inc dptr movx @dptr,a C$servo.c$191$3$4 ==. ; libraries/src/servo/servo.c:191: servoData[i].positionReg = 0; mov a,r5 add a,#_servoData mov r6,a clr a addc a,#(_servoData >> 8) mov r7,a mov dpl,r6 mov dph,r7 inc dptr inc dptr inc dptr inc dptr clr a movx @dptr,a inc dptr movx @dptr,a C$servo.c$192$3$4 ==. ; libraries/src/servo/servo.c:192: servoData[i].speed = 0; mov a,r5 add a,#_servoData mov r5,a clr a addc a,#(_servoData >> 8) mov r6,a mov a,#0x06 add a,r5 mov dpl,a clr a addc a,r6 mov dph,a clr a movx @dptr,a inc dptr movx @dptr,a C$servo.c$194$3$4 ==. ; libraries/src/servo/servo.c:194: if (i < numPins) mov r0,#_servosStart_PARM_2 clr c movx a,@r0 mov b,a mov a,r4 subb a,b jc 00134$ ljmp 00118$ 00134$: C$servo.c$196$4$5 ==. ; libraries/src/servo/servo.c:196: uint8 internalChannelNumber = pinToInternalChannelNumber(pins[i]); mov a,r4 add a,r2 mov dpl,a clr a addc a,r3 mov dph,a movx a,@dptr mov dpl,a push ar2 push ar3 push ar4 lcall _pinToInternalChannelNumber mov r5,dpl pop ar4 pop ar3 pop ar2 C$servo.c$198$4$5 ==. ; libraries/src/servo/servo.c:198: servoAssignment[i] = internalChannelNumber; mov a,r4 add a,#_servoAssignment mov dpl,a clr a addc a,#(_servoAssignment >> 8) mov dph,a mov a,r5 movx @dptr,a C$servo.c$200$4$5 ==. ; libraries/src/servo/servo.c:200: switch(internalChannelNumber) mov a,#0x05 cjne a,ar5,00135$ 00135$: jc 00118$ mov a,r5 add a,r5 add a,r5 mov dptr,#00137$ jmp @a+dptr 00137$: ljmp 00103$ ljmp 00104$ ljmp 00105$ ljmp 00106$ ljmp 00107$ ljmp 00108$ C$servo.c$202$5$6 ==. ; libraries/src/servo/servo.c:202: case 0: P0_2 = 0; servoPinsOnPort0 |= (1<<2); break; 00103$: clr _P0_2 mov r0,#_servoPinsOnPort0 movx a,@r0 orl a,#0x04 movx @r0,a C$servo.c$203$5$6 ==. ; libraries/src/servo/servo.c:203: case 1: P0_3 = 0; servoPinsOnPort0 |= (1<<3); break; sjmp 00118$ 00104$: clr _P0_3 mov r0,#_servoPinsOnPort0 movx a,@r0 orl a,#0x08 movx @r0,a C$servo.c$204$5$6 ==. ; libraries/src/servo/servo.c:204: case 2: P0_4 = 0; servoPinsOnPort0 |= (1<<4); break; sjmp 00118$ 00105$: clr _P0_4 mov r0,#_servoPinsOnPort0 movx a,@r0 orl a,#0x10 movx @r0,a C$servo.c$205$5$6 ==. ; libraries/src/servo/servo.c:205: case 3: P1_2 = 0; servoPinsOnPort1 |= (1<<2); break; sjmp 00118$ 00106$: clr _P1_2 mov r0,#_servoPinsOnPort1 movx a,@r0 orl a,#0x04 movx @r0,a C$servo.c$206$5$6 ==. ; libraries/src/servo/servo.c:206: case 4: P1_1 = 0; servoPinsOnPort1 |= (1<<1); break; sjmp 00118$ 00107$: clr _P1_1 mov r0,#_servoPinsOnPort1 movx a,@r0 orl a,#0x02 movx @r0,a C$servo.c$207$5$6 ==. ; libraries/src/servo/servo.c:207: case 5: P1_0 = 0; servoPinsOnPort1 |= (1<<0); break; sjmp 00118$ 00108$: clr _P1_0 mov r0,#_servoPinsOnPort1 movx a,@r0 orl a,#0x01 movx @r0,a C$servo.c$208$2$4 ==. ; libraries/src/servo/servo.c:208: } 00118$: C$servo.c$187$2$3 ==. ; libraries/src/servo/servo.c:187: for (i = 0; i < MAX_SERVOS; i++) inc r4 ljmp 00116$ 00119$: C$servo.c$213$2$3 ==. ; libraries/src/servo/servo.c:213: P0SEL &= ~servoPinsOnPort0; mov r0,#_servoPinsOnPort0 movx a,@r0 cpl a anl _P0SEL,a C$servo.c$214$2$3 ==. ; libraries/src/servo/servo.c:214: P0DIR |= servoPinsOnPort0; mov r0,#_servoPinsOnPort0 movx a,@r0 orl _P0DIR,a C$servo.c$215$2$3 ==. ; libraries/src/servo/servo.c:215: P1SEL &= ~servoPinsOnPort1; mov r0,#_servoPinsOnPort1 movx a,@r0 cpl a mov r2,a anl _P1SEL,a C$servo.c$216$2$3 ==. ; libraries/src/servo/servo.c:216: P1DIR |= servoPinsOnPort1; mov r0,#_servoPinsOnPort1 movx a,@r0 orl _P1DIR,a C$servo.c$218$2$3 ==. ; libraries/src/servo/servo.c:218: if (servoPinsOnPort0) mov r0,#_servoPinsOnPort0 movx a,@r0 jz 00115$ C$servo.c$223$3$7 ==. ; libraries/src/servo/servo.c:223: P2DIR |= 0b11000000; orl _P2DIR,#0xC0 00115$: C$servo.c$230$1$1 ==. ; libraries/src/servo/servo.c:230: T1CTL = 0; mov _T1CTL,#0x00 C$servo.c$231$1$1 ==. ; libraries/src/servo/servo.c:231: T1CNTL = 0; // resets high and low bytes mov _T1CNTL,#0x00 C$servo.c$232$1$1 ==. ; libraries/src/servo/servo.c:232: servoCounter = 0; mov _servoCounter,#0x00 C$servo.c$239$1$1 ==. ; libraries/src/servo/servo.c:239: T1CCTL0 = T1CCTL1 = T1CCTL2 = 0b00011100; mov _T1CCTL2,#0x1C mov _T1CCTL1,#0x1C mov _T1CCTL0,#0x1C C$servo.c$242$1$1 ==. ; libraries/src/servo/servo.c:242: T1CC0 = T1CC1 = T1CC2 = 0xFFFF; mov _T1CC2,#0xFF mov (_T1CC2 >> 8),#0xFF mov _T1CC1,#0xFF mov (_T1CC1 >> 8),#0xFF mov _T1CC0,#0xFF mov (_T1CC0 >> 8),#0xFF C$servo.c$245$1$1 ==. ; libraries/src/servo/servo.c:245: T1CTL = 0b00000001; mov _T1CTL,#0x01 C$servo.c$248$1$1 ==. ; libraries/src/servo/servo.c:248: IP0 &= ~(1<<1); anl _IP0,#0xFD C$servo.c$249$1$1 ==. ; libraries/src/servo/servo.c:249: IP1 |= (1<<1); orl _IP1,#0x02 C$servo.c$250$1$1 ==. ; libraries/src/servo/servo.c:250: T1IE = 1; // Enable the Timer 1 interrupt. setb _T1IE C$servo.c$251$1$1 ==. ; libraries/src/servo/servo.c:251: EA = 1; // Enable interrupts in general. setb _EA C$servo.c$253$1$1 ==. ; libraries/src/servo/servo.c:253: servosStartedFlag = 1; setb _servosStartedFlag C$servo.c$254$1$1 ==. XG$servosStart$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servosStop' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servosStop$0$0 ==. C$servo.c$256$1$1 ==. ; libraries/src/servo/servo.c:256: void servosStop(void) ; ----------------------------------------- ; function servosStop ; ----------------------------------------- _servosStop: C$servo.c$258$1$1 ==. ; libraries/src/servo/servo.c:258: if (!servosStartedFlag) jb _servosStartedFlag,00102$ C$servo.c$261$2$2 ==. ; libraries/src/servo/servo.c:261: return; ret 00102$: C$servo.c$264$1$1 ==. ; libraries/src/servo/servo.c:264: T1IE = 0; clr _T1IE C$servo.c$267$1$1 ==. ; libraries/src/servo/servo.c:267: while(!T1IF){}; 00103$: jnb _T1IF,00103$ C$servo.c$273$1$1 ==. ; libraries/src/servo/servo.c:273: P0SEL &= ~servoPinsOnPort0; mov r0,#_servoPinsOnPort0 movx a,@r0 cpl a anl _P0SEL,a C$servo.c$274$1$1 ==. ; libraries/src/servo/servo.c:274: P1SEL &= ~servoPinsOnPort1; mov r0,#_servoPinsOnPort1 movx a,@r0 cpl a anl _P1SEL,a C$servo.c$277$1$1 ==. ; libraries/src/servo/servo.c:277: T1CTL = 0; mov _T1CTL,#0x00 C$servo.c$279$1$1 ==. ; libraries/src/servo/servo.c:279: servosStartedFlag = 0; clr _servosStartedFlag C$servo.c$280$1$1 ==. XG$servosStop$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servosStarted' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servosStarted$0$0 ==. C$servo.c$282$1$1 ==. ; libraries/src/servo/servo.c:282: BIT servosStarted(void) ; ----------------------------------------- ; function servosStarted ; ----------------------------------------- _servosStarted: C$servo.c$284$1$1 ==. ; libraries/src/servo/servo.c:284: return servosStartedFlag; mov c,_servosStartedFlag C$servo.c$285$1$1 ==. XG$servosStarted$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servosMoving' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servosMoving$0$0 ==. C$servo.c$287$1$1 ==. ; libraries/src/servo/servo.c:287: BIT servosMoving(void) ; ----------------------------------------- ; function servosMoving ; ----------------------------------------- _servosMoving: C$servo.c$289$1$1 ==. ; libraries/src/servo/servo.c:289: return servosMovingFlag; mov c,_servosMovingFlag C$servo.c$290$1$1 ==. XG$servosMoving$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servoSetTarget' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servoSetTarget$0$0 ==. C$servo.c$292$1$1 ==. ; libraries/src/servo/servo.c:292: void servoSetTarget(uint8 servoNum, uint16 targetMicroseconds) ; ----------------------------------------- ; function servoSetTarget ; ----------------------------------------- _servoSetTarget: mov r2,dpl C$servo.c$295$1$1 ==. ; libraries/src/servo/servo.c:295: servoSetTargetHighRes(servoNum, targetMicroseconds * SERVO_TICKS_PER_MICROSECOND); mov r0,#_servoSetTarget_PARM_2 mov r1,#__mulint_PARM_2 movx a,@r0 movx @r1,a inc r0 movx a,@r0 inc r1 movx @r1,a mov dptr,#0x0018 push ar2 lcall __mulint mov r3,dpl mov r4,dph pop ar2 mov r0,#_servoSetTargetHighRes_PARM_2 mov a,r3 movx @r0,a inc r0 mov a,r4 movx @r0,a mov dpl,r2 C$servo.c$296$1$1 ==. XG$servoSetTarget$0$0 ==. ljmp _servoSetTargetHighRes ;------------------------------------------------------------ ;Allocation info for local variables in function 'servoSetTargetHighRes' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servoSetTargetHighRes$0$0 ==. C$servo.c$298$1$1 ==. ; libraries/src/servo/servo.c:298: void servoSetTargetHighRes(uint8 servoNum, uint16 target) ; ----------------------------------------- ; function servoSetTargetHighRes ; ----------------------------------------- _servoSetTargetHighRes: C$servo.c$300$1$1 ==. ; libraries/src/servo/servo.c:300: volatile struct SERVO_DATA XDATA * d = servoData + servoAssignment[servoNum]; mov a,dpl add a,#_servoAssignment mov dpl,a clr a addc a,#(_servoAssignment >> 8) mov dph,a movx a,@dptr mov r2,a clr a rr a anl a,#0xf8 xch a,r2 swap a rr a xch a,r2 xrl a,r2 xch a,r2 anl a,#0xf8 xch a,r2 xrl a,r2 mov r3,a mov a,r2 add a,#_servoData mov r2,a mov a,r3 addc a,#(_servoData >> 8) mov r3,a C$servo.c$304$1$1 ==. ; libraries/src/servo/servo.c:304: T1IE = 0; // Make sure we don't get interrupted in the middle of an update. clr _T1IE C$servo.c$307$1$1 ==. ; libraries/src/servo/servo.c:307: if (d->speed == 0 || d->target == 0 || target == 0) mov a,#0x06 add a,r2 mov dpl,a clr a addc a,r3 mov dph,a movx a,@dptr mov r4,a inc dptr movx a,@dptr mov r5,a orl a,r4 jz 00103$ mov dpl,r2 mov dph,r3 movx a,@dptr mov r4,a inc dptr movx a,@dptr mov r5,a orl a,r4 jz 00103$ mov r0,#_servoSetTargetHighRes_PARM_2 movx a,@r0 mov b,a inc r0 movx a,@r0 orl a,b jnz 00104$ 00103$: C$servo.c$309$2$2 ==. ; libraries/src/servo/servo.c:309: d->position = target; mov dpl,r2 mov dph,r3 inc dptr inc dptr mov r0,#_servoSetTargetHighRes_PARM_2 movx a,@r0 movx @dptr,a inc dptr inc r0 movx a,@r0 movx @dptr,a C$servo.c$310$2$2 ==. ; libraries/src/servo/servo.c:310: d->positionReg = ~target + 1; mov dpl,r2 mov dph,r3 inc dptr inc dptr inc dptr inc dptr mov r0,#_servoSetTargetHighRes_PARM_2 movx a,@r0 cpl a mov r4,a inc r0 movx a,@r0 cpl a mov r5,a inc r4 cjne r4,#0x00,00116$ inc r5 00116$: mov a,r4 movx @dptr,a inc dptr mov a,r5 movx @dptr,a sjmp 00105$ 00104$: C$servo.c$312$1$1 ==. ; libraries/src/servo/servo.c:312: else if (target != d->position) mov dpl,r2 mov dph,r3 inc dptr inc dptr movx a,@dptr mov r4,a inc dptr movx a,@dptr mov r5,a mov r0,#_servoSetTargetHighRes_PARM_2 movx a,@r0 cjne a,ar4,00117$ inc r0 movx a,@r0 cjne a,ar5,00117$ sjmp 00105$ 00117$: C$servo.c$314$2$3 ==. ; libraries/src/servo/servo.c:314: servosMovingFlag = 1; setb _servosMovingFlag 00105$: C$servo.c$317$1$1 ==. ; libraries/src/servo/servo.c:317: d->target = target; mov dpl,r2 mov dph,r3 mov r0,#_servoSetTargetHighRes_PARM_2 movx a,@r0 movx @dptr,a inc dptr inc r0 movx a,@r0 movx @dptr,a C$servo.c$319$1$1 ==. ; libraries/src/servo/servo.c:319: T1IE = servosStartedFlag; mov c,_servosStartedFlag mov _T1IE,c C$servo.c$320$1$1 ==. XG$servoSetTargetHighRes$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servoGetTarget' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servoGetTarget$0$0 ==. C$servo.c$322$1$1 ==. ; libraries/src/servo/servo.c:322: uint16 servoGetTarget(uint8 servoNum) ; ----------------------------------------- ; function servoGetTarget ; ----------------------------------------- _servoGetTarget: C$servo.c$324$1$1 ==. ; libraries/src/servo/servo.c:324: return servoData[servoAssignment[servoNum]].target / SERVO_TICKS_PER_MICROSECOND; mov a,dpl add a,#_servoAssignment mov dpl,a clr a addc a,#(_servoAssignment >> 8) mov dph,a movx a,@dptr swap a rr a anl a,#0xf8 add a,#_servoData mov dpl,a clr a addc a,#(_servoData >> 8) mov dph,a movx a,@dptr mov r2,a inc dptr movx a,@dptr mov r3,a mov r0,#__divuint_PARM_2 mov a,#0x18 movx @r0,a inc r0 clr a movx @r0,a mov dpl,r2 mov dph,r3 C$servo.c$325$1$1 ==. XG$servoGetTarget$0$0 ==. ljmp __divuint ;------------------------------------------------------------ ;Allocation info for local variables in function 'servoGetPosition' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servoGetPosition$0$0 ==. C$servo.c$327$1$1 ==. ; libraries/src/servo/servo.c:327: uint16 servoGetPosition(uint8 servoNum) ; ----------------------------------------- ; function servoGetPosition ; ----------------------------------------- _servoGetPosition: C$servo.c$329$1$1 ==. ; libraries/src/servo/servo.c:329: return servoGetPositionHighRes(servoNum) / SERVO_TICKS_PER_MICROSECOND; lcall _servoGetPositionHighRes mov r0,#__divuint_PARM_2 mov a,#0x18 movx @r0,a inc r0 clr a movx @r0,a C$servo.c$330$1$1 ==. XG$servoGetPosition$0$0 ==. ljmp __divuint ;------------------------------------------------------------ ;Allocation info for local variables in function 'servoGetTargetHighRes' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servoGetTargetHighRes$0$0 ==. C$servo.c$332$1$1 ==. ; libraries/src/servo/servo.c:332: uint16 servoGetTargetHighRes(uint8 servoNum) ; ----------------------------------------- ; function servoGetTargetHighRes ; ----------------------------------------- _servoGetTargetHighRes: C$servo.c$334$1$1 ==. ; libraries/src/servo/servo.c:334: return servoData[servoAssignment[servoNum]].target; mov a,dpl add a,#_servoAssignment mov dpl,a clr a addc a,#(_servoAssignment >> 8) mov dph,a movx a,@dptr swap a rr a anl a,#0xf8 add a,#_servoData mov dpl,a clr a addc a,#(_servoData >> 8) mov dph,a movx a,@dptr mov r2,a inc dptr movx a,@dptr C$servo.c$335$1$1 ==. XG$servoGetTargetHighRes$0$0 ==. mov dpl,r2 mov dph,a ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servoGetPositionHighRes' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servoGetPositionHighRes$0$0 ==. C$servo.c$337$1$1 ==. ; libraries/src/servo/servo.c:337: uint16 servoGetPositionHighRes(uint8 servoNum) ; ----------------------------------------- ; function servoGetPositionHighRes ; ----------------------------------------- _servoGetPositionHighRes: mov r2,dpl C$servo.c$340$1$1 ==. ; libraries/src/servo/servo.c:340: T1IE = 0; // Make sure we don't get interrupted in the middle of reading the position. clr _T1IE C$servo.c$341$1$1 ==. ; libraries/src/servo/servo.c:341: position = servoData[servoAssignment[servoNum]].position; mov a,r2 add a,#_servoAssignment mov dpl,a clr a addc a,#(_servoAssignment >> 8) mov dph,a movx a,@dptr swap a rr a anl a,#0xf8 add a,#_servoData mov r2,a clr a addc a,#(_servoData >> 8) mov r3,a mov dpl,r2 mov dph,r3 inc dptr inc dptr movx a,@dptr mov r2,a inc dptr movx a,@dptr mov r3,a C$servo.c$342$1$1 ==. ; libraries/src/servo/servo.c:342: T1IE = servosStartedFlag; mov c,_servosStartedFlag mov _T1IE,c C$servo.c$343$1$1 ==. ; libraries/src/servo/servo.c:343: return position; mov dpl,r2 mov dph,r3 C$servo.c$344$1$1 ==. XG$servoGetPositionHighRes$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servoSetSpeed' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servoSetSpeed$0$0 ==. C$servo.c$346$1$1 ==. ; libraries/src/servo/servo.c:346: void servoSetSpeed(uint8 servoNum, uint16 speed) ; ----------------------------------------- ; function servoSetSpeed ; ----------------------------------------- _servoSetSpeed: mov r2,dpl C$servo.c$348$1$1 ==. ; libraries/src/servo/servo.c:348: T1IE = 0; // Make sure we don't get interrupted in the middle of an update. clr _T1IE C$servo.c$349$1$1 ==. ; libraries/src/servo/servo.c:349: servoData[servoAssignment[servoNum]].speed = speed; mov a,r2 add a,#_servoAssignment mov dpl,a clr a addc a,#(_servoAssignment >> 8) mov dph,a movx a,@dptr swap a rr a anl a,#0xf8 add a,#_servoData mov r2,a clr a addc a,#(_servoData >> 8) mov r3,a mov a,#0x06 add a,r2 mov dpl,a clr a addc a,r3 mov dph,a mov r0,#_servoSetSpeed_PARM_2 movx a,@r0 movx @dptr,a inc dptr inc r0 movx a,@r0 movx @dptr,a C$servo.c$350$1$1 ==. ; libraries/src/servo/servo.c:350: T1IE = servosStartedFlag; mov c,_servosStartedFlag mov _T1IE,c C$servo.c$351$1$1 ==. XG$servoSetSpeed$0$0 ==. ret ;------------------------------------------------------------ ;Allocation info for local variables in function 'servoGetSpeed' ;------------------------------------------------------------ ;------------------------------------------------------------ G$servoGetSpeed$0$0 ==. C$servo.c$353$1$1 ==. ; libraries/src/servo/servo.c:353: uint16 servoGetSpeed(uint8 servoNum) ; ----------------------------------------- ; function servoGetSpeed ; ----------------------------------------- _servoGetSpeed: C$servo.c$355$1$1 ==. ; libraries/src/servo/servo.c:355: return servoData[servoAssignment[servoNum]].speed; mov a,dpl add a,#_servoAssignment mov dpl,a clr a addc a,#(_servoAssignment >> 8) mov dph,a movx a,@dptr swap a rr a anl a,#0xf8 add a,#_servoData mov r2,a clr a addc a,#(_servoData >> 8) mov r3,a mov a,#0x06 add a,r2 mov dpl,a clr a addc a,r3 mov dph,a movx a,@dptr mov r2,a inc dptr movx a,@dptr C$servo.c$356$1$1 ==. XG$servoGetSpeed$0$0 ==. mov dpl,r2 mov dph,a ret .area CSEG (CODE) .area CONST (CODE) .area XINIT (CODE) .area CABS (ABS,CODE)