Hi Folks,
I created a MQX project based on TWR-K60D100 GCC, and included "time.h" in. but there were some compiling errors . could you give me some hints about that. below is the screenshot.
Hi Weiping,
I have some example code attached in zip to show how to setup the MQX time manually or to use an automated process that gets the time from a NTP (network time protocol) server or if that fails then to use the MQX RTOS compiled time/date to at least get a course time/date setting.
I had created a shell command "sh_oneshot.c" that goes in the following path:
C:\Freescale\Freescale_MQX_4_X\shell\source\rtcs
Hope this help you or others.
Regards,
David
Unfortunately the time functions are not implemented - This header file (time.h) is provided for compatibility only, the implementation is fully hardware dependent.
"The ANSI library provides several functions to get the current time. In an embedded systems environment, implementations for these functions cannot be provided because different targets may use different ways to count the time."
If you need it, you have to write your own functions (if you have some Real Time Clock component on your board).