typedef struct {
int8 tm_year;
int8 tm_temp; // Not used by built in functions, place holder do not use
int8 tm_mday;
int8 tm_mon;
int8 tm_hour;
int8 tm_wday;
int8 tm_sec;
int8 tm_min;
int8 tm_isdst; // Not used by built in functions
} rtc_time_t;

Then it should not give you an error.

Ttelmah

Joined: 11 Mar 2010Posts: 12736

Posted: Fri Feb 16, 2018 2:50 am

The other possibility, since it is the function line that is complaining, not the data definitions, is that he is not including the actual code to supply the function. Quote from "time.h":

Quote:

/// This file only provides the prototypes and definitions needed to ///
/// proved a time alogrithm that follows the C standard library. You ///
/// also need to include/link the actual library that performs the time ///
/// base. As of this writing CCS provides the following compatible ///
/// timebase libraries: ///
/// rtcperipheral.c - for PICs with internal real time clock. ///
/// ds1305.c - external DS1305 real time clock. ///
/// rtcticks.c - Use a PIC's timer with CCS #use timer() library.

Time.h, only provides the prototypes. There have to be physical routines included as well to actually do the work...

jeremiah

Joined: 20 Jul 2010Posts: 974

Posted: Fri Feb 16, 2018 9:44 am

Ttelmah wrote:

The other possibility, since it is the function line that is complaining, not the data definitions, is that he is not including the actual code to supply the function. Quote from "time.h":

Time.h, only provides the prototypes. There have to be physical routines included as well to actually do the work...

I would agree. The error actually says that there is no definition for the function, which means, it isn't included or it is included below that function. Either way, the code at the function call hasn't yet seen a definition of the function.

davidnewone

Joined: 15 Feb 2018Posts: 3

Posted: Fri Feb 16, 2018 12:18 pm

jeremiah wrote:

Ttelmah wrote:

The other possibility, since it is the function line that is complaining, not the data definitions, is that he is not including the actual code to supply the function. Quote from "time.h":

Time.h, only provides the prototypes. There have to be physical routines included as well to actually do the work...

I would agree. The error actually says that there is no definition for the function, which means, it isn't included or it is included below that function. Either way, the code at the function call hasn't yet seen a definition of the function.

I included my own time.h using a copy of official time.h. But the pb is still present. Nevertheless, a little bit different:
[img]http://zupimages.net/viewer.php?id=18/07/amq1.jpg[/img] (alt+q)
thanks for the help

Ttelmah

Joined: 11 Mar 2010Posts: 12736

Posted: Fri Feb 16, 2018 12:23 pm

You are missing the point.

time.h, _requires_ a separate set of code to give the actual code. The three available from CCS are:
rtcperipheral.c, ds1305.c & rtcticks.c, to use an internal timer, the hardware RTC peripheral of the ds1305 chip.
time.h is not designed to be used on it's own. It needs these other parts, or one to do the same job supplied by you.

PCM programmer

Joined: 06 Sep 2003Posts: 20172

Posted: Fri Feb 16, 2018 12:25 pm

Right, but the error shown in his image is about CPUDIV1.
He can fix it by changing it to NOCPUDIV. That's the correct fuse
for the 18F25J50 as shown in his image file.

temtronic

Joined: 01 Jul 2010Posts: 5878Location: Greensville,Ontario

Posted: Fri Feb 16, 2018 1:06 pm

OK. I have to ask ..
What does 'pb' mean in the title ??
It's been a long week..so far 4 Mondays.....sigh.

Jay

Ttelmah

Joined: 11 Mar 2010Posts: 12736

Posted: Fri Feb 16, 2018 1:16 pm

The original problem he is showing just an function used but not defined error for the line:

time(&Ttime); // Here is the pb of compilation ..

In the image he posts, he has probably just got something wrong in his modified file (as you say the CPUDIV fuse). However the underlined line, is because he is using time, not Ttime. Stupid naming.

The story behind this is as follows. At work we have a little "kitchenette". My boss had a plastic cutting board which he used every day to cut sandwiches, fruit, etc. Until I caught a coworker placing the solder paste on it as he was taking it from the fridge. So for xmas I made the cutting board in the picture.

...Coworker is no longer around.

Ttelmah

Joined: 11 Mar 2010Posts: 12736

Posted: Sat Feb 17, 2018 2:23 am

Good story, and I like the board.

davidnewone

Joined: 15 Feb 2018Posts: 3

Of course, RTC !

Posted: Sat Feb 17, 2018 7:22 am

Ttelmah wrote:

You are missing the point.

time.h, _requires_ a separate set of code to give the actual code. The three available from CCS are:
rtcperipheral.c, ds1305.c & rtcticks.c, to use an internal timer, the hardware RTC peripheral of the ds1305 chip.
time.h is not designed to be used on it's own. It needs these other parts, or one to do the same job supplied by you.