I am updating source code for freertos but I have some error,I don't understand why I got these error,please help me ( freerots wrote for p33FJ256GP710,I want to modify for p30f6014A ) problem is : port.c: In function 'prvSetupTimerInterrupt': port.c:277: error: 'TCON_16BIT' has no member named 'TCKPS0' port.c:278: error: 'TCON_16BIT' has no member named 'TCKPS1' funciton is : /* * Setup a timer for a regular tick. */ static void prvSetupTimerInterrupt( void ) { const unsigned portLONG ulCompareMatch = ( configCPU_CLOCK_HZ / portTIMER_PRESCALE ) / configTICK_RATE_HZ; /* Prescale of 8. */ T1CON = 0; TMR1 = 0; PR1 = ( unsigned portSHORT ) ulCompareMatch; /* Setup timer 1 interrupt priority. */ IPC0bits.T1IP = configKERNEL_INTERRUPT_PRIORITY; /* Clear the interrupt as a starting condition. */ IFS0bits.T1IF = 0; /* Enable the interrupt. */ IEC0bits.T1IE = 1; /* Setup the prescale value. */ T1CONbits.TCKPS0 = 1; T1CONbits.TCKPS1 = 0; /* Start the timer. */ T1CONbits.TON = 1; }
Savas Takan wrote: > port.c: In function 'prvSetupTimerInterrupt': > port.c:277: error: 'TCON_16BIT' has no member named 'TCKPS0' > port.c:278: error: 'TCON_16BIT' has no member named 'TCKPS1' > It is saying that in this code: > /* Setup the prescale value. */ > T1CONbits.TCKPS0 = 1; > T1CONbits.TCKPS1 = 0; > T1CONbits is a TCON_16BIT structure, but that TCKPS0 and TCKPS1 are not members. Find the struct TCON_16BIT definition and see what members it does have. I notice that you have cross-posted this question on the Microchip forum, which might explain why I did not recognise p30f6014A as an ARM part reference! It appears to be a dsPIC. This is an ARM forum - are you lost!? I found this definition in p30f6014.h via Google: /* Generic structure for Timer 1 Control Register */ typedef struct tagTCON_16BIT { unsigned :1; unsigned TCS :1; unsigned TSYNC :1; unsigned :1; unsigned TCKPS :2; unsigned TGATE :1; unsigned :6; unsigned TSIDL :1; unsigned :1; unsigned TON :1; } TCON_16BIT; and indeed there are no TCKPS0/1 members. So you should not be surprised perhaps. My guess is that the dsPIC30F6014 timer hardware differs significantly from dsPIC33FJ256GP710. PICs are like that, nasty. There is no getting away from it, if you are porting between two differing platforms you are going to have to get out the data sheet/user manuals for both parts. You also must realise that dsPIC is not an ARM! ;-) Clifford
I did these changes on the p30fxxxx.h and the compiler continue. I divided the TCKPS in two in the struct ( change the 2 by 1 and copy y paste below it), then add the number 0 and 1 to each one. /* Generic structure for Timer 1 Control Register */ typedef struct tagTCON_16BIT { unsigned :1; unsigned TCS :1; unsigned TSYNC :1; unsigned :1; unsigned TCKPS0 :1; unsigned TCKPS1 :1; unsigned TGATE :1; unsigned :6; unsigned TSIDL :1; unsigned :1; unsigned TON :1; } TCON_16BIT;
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.