I am using the KDS Version: 2.0.0; Eclipse Version: Kepler 4.3.2; FRDM-K64F
So, I am trying to understand the KDS, PE, and Kinetis all at the same time, meanwhile trying to create
a small driver that other engineers in the company can use. The first driver would be a clock (hours, minutes, seconds, milli-seconds).
I found that thru the component library, I can add components like the RT1:RealTime_LDD.
Under component help, I found the following code:
LDD_TDeviceData *MyRT1Ptr;
LDD_TError Error;
uint32_t i, time;
float one_loop_us;
void main(void)
{
MyRT11ptr = RT1_Init((LDD_TUserData *)NULL);
...
Error = RT1_Reset(MyRT1Ptr);
for (i = 0; i < 60000; ++i);
if (RT1_GetTimeUS(RT1_DeviceData, &time) == ERR_OK)
{
one_loop_us = time / 60000.0;
}
}
Instead of using RT1_GetTimeUS, I used RT1_GetTimeMS for milli-second. I need to run my code in a 1ms loop.
I tried applying the code in my main.c and got some errors:
In the RT1_GetTimeMS(RT1_DeviceData, &time) == ERR_OK), it complained that RT1_DeviceData was undeclared? Looking at the sample
code I noticed, that indeed RT1_DeviceData was not declared so I declared it as: uint16_t RT1_DeviceData. So, now I am getting two warnings
passing argument1 of 'RT1_GetTimeMS' makes pointer from integer without a cast[enabled by default]. I have no idea what this means or how to
correct it?
Why do they dived time/60000.0?