ctl.h and undefined reference

Comments

12 comments

  • Avatar
    Paul Curtis

    You should have created a CTL project to begin with and then all the libraries and the header file location would have been set up automatically.

    0
    Comment actions Permalink
  • Avatar
    Baptiste Chinon

    thanks, everything is fine now !

    0
    Comment actions Permalink
  • Avatar
    Daniel Abraham

    @ Baptiste: Am facing the same issue... how u got fix it, many thankz!!!

    0
    Comment actions Permalink
  • Avatar
    Baptiste Chinon

    I have created a new CrossWork Tasking Library project (known as CTL).

    0
    Comment actions Permalink
  • Avatar
    Sarah

    Hi,

     

    I am having the same problem, I do not have ctl.h in CrossWorks folder but I have ctl_api.h

    I created a project in CTL but What should I do then ?

     

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    It should be in $(StudioDir)/ctl/include - the project should have

    $(StudioDir)/ctl/include
    $(StudioDir)/include
    $(PackagesDir)/include

    in the system include directories property.

    0
    Comment actions Permalink
  • Avatar
    Sarah

    I found it in ctl directory. Thank you

    I am trying to measure the time for a function execution. I tried the following:

    Using "'ctl_get_current_time'" but the linker gives me this error:

    undefined symbol '_ctl_get_current_time'?

    Also I tried to use the "time function" defined in time.h, but I am getting the same error:

    error: undefined symbol '_time'

    How can I get the time measurement in this case?

     

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    You'll need to link in the ctl library - add $(StudioDir)/ctl/lib/libctl$(LibExt).hza to the linker | additional inputs property.

    If you just want to measure time then start a timer running and record the counter value on entry/exit to the function.

    0
    Comment actions Permalink
  • Avatar
    Sarah

    Can you give me example to do this please.

    In my program I am trying to do the following: (I am running it in the AVR simulator)

    start_time=ctl_get_current_time();

    \\do  a function

    return start_time - ctl_get_current_time();

     

    I am getting 0.

     

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    Sorry there's no timer support in the simulator.

    0
    Comment actions Permalink
  • Avatar
    Sarah

    How can I convert the recorded counter value to millisconds. For example if TCNT1=1431, how much is it in milliseconds?

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    I'd guess it will be the CPU clock frequency with possibly a divider for the timer. Have a read of the data sheet and use the registers window to see the default values.

    0
    Comment actions Permalink

Please sign in to leave a comment.