View previous topic :: View next topic |
Author |
Message |
Eddy71ua
Joined: 23 Sep 2009 Posts: 55 Location: Ukraine
|
Function get_ticks(); does not work v4.119 |
Posted: Thu Mar 03, 2011 7:58 am |
|
|
I try to use of function "get_ticks ();" and get an error message :
Quote: |
*** Error 99 "TestC.c" Line 11(5,44): Option invalid Bad Option: TICKS
*** Error 12 "TestC.c" Line 19(25,26): Undefined identifier -- get_ticks
2 Errors, 0 Warnings.
|
Code: |
#include <12F675.h>
#device adc=8
#FUSES WDT
#FUSES EC_IO
#FUSES NOCPD
#FUSES PROTECT
#FUSES NOMCLR
#FUSES PUT
#FUSES BROWNOUT
#use delay(clock=20000000,RESTART_WDT)
#USE TIMER(TIMER=1,TICKS=1ms,BITS=16,NOISR)
#use fast_io(a)
//---------------------------------
//---------------------------------
void main(){
unsigned int16 current_tick;
//--------------------------//
for(;;){
current_tick = get_ticks();
}
} |
In the file "ccs_c_manual.pdf" description of the function # USE_TIMER present, but in the help file (button F11 in the MPLAB) function absent. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Mar 03, 2011 2:41 pm |
|
|
I guess, you should read the manual more thoroughly. The option name isn't TICKS. It's compiling fine with V4.119, once corrected. |
|
|
Eddy71ua
Joined: 23 Sep 2009 Posts: 55 Location: Ukraine
|
|
Posted: Thu Mar 03, 2011 3:16 pm |
|
|
Quote: |
Examples: #USE_TIMER(TIMER=1,TICKS=1ms,BITS=16,NOISR)
void main(void) {
unsigned int16 current_tick;
current_tick = get_ticks();
}
|
ccs_c_manual.pdf, page 174. What wrong?
I try compile in MPLAB project. |
|
|
Eddy71ua
Joined: 23 Sep 2009 Posts: 55 Location: Ukraine
|
[solved] |
Posted: Thu Mar 03, 2011 3:26 pm |
|
|
In help file:
Quote: |
#USE_TIMER(TIMER=1,TICKS=1ms,BITS=16,NOISR)
|
I change to:
Quote: |
#use timer(TIMER=1,TICK=1ms,BITS=16,ISR)
|
Build done. Error in Help file |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Mar 03, 2011 3:37 pm |
|
|
Quote: | Error in Help file. |
I see. The online help is correct. |
|
|
|