Lazarus
Programming => Operating Systems => Linux => Topic started by: chrnobel on February 27, 2014, 02:30:29 pm
-
Hi.
Does anyone know whether EpicTimer works on ARM processors, particularly Allwinner A10/20?
Or is there a replacement?
Thanks
Christian
-
I can test tonight [at work now] on my RPi if you want.
-
I Assume you are asking about this (http://wiki.freepascal.org/EpikTimer). If so:
This component was designed for cross-platform applications...
But:
Nanosecond resolution is supported on Intel Pentium versions with a Timestamp Counter.
Microsecond system clock is the default timebase.
-
I can test tonight [at work now] on my RPi if you want.
No need Graeme, I just tried it my self on RPi, and it works.
But thank you anyway.
Christian
-
@ChrNobel: you might want to update the tested platforms list at
http://wiki.lazarus.freepascal.org/EpikTimer#Dependencies_.2F_System_Requirements
-
I Assume you are asking about this (http://wiki.freepascal.org/EpikTimer). If so:
This component was designed for cross-platform applications...
I have read the Wiki, but when it states cross-platform, it is to be understood OS.
It does not specify whether it works on other processor architectures than Intel or AMD (meaning x86), but from trying on the RPi it actually also works on ARM.
-
I have read the Wiki, but when it states cross-platform, it is to be understood OS.
Well, that's your opinion ;)
I understand platform as the combination of hardware and OS. Even middleware etc depending on context.
-
@ChrNobel: you might want to update the tested platforms list at
http://wiki.lazarus.freepascal.org/EpikTimer#Dependencies_.2F_System_Requirements
Yes, but will wait until I have done some further test to be assured that there are no hick-ups, just did at quick test with EpikTimers Test Application.
Also I will make some tests with Allwinner.
-
Great, thanks!
-
I have read the Wiki, but when it states cross-platform, it is to be understood OS.
Well, that's your opinion ;)
I understand platform as the combination of hardware and OS. Even middleware etc depending on context.
That might be a matter of words, but as there seems to be differences in the way that two relatively similar architectures (Intel and AMD x86) behaves with regards to read clockticks, I would be very precarious to use the phrase crossplatform without testing.
-
I would be very precarious to use the phrase crossplatform without testing.
Of course.
-
I have read the Wiki, but when it states cross-platform, it is to be understood OS.
It does not specify whether it works on other processor architectures than Intel or AMD (meaning x86), but from trying on the RPi it actually also works on ARM.
Let me quote the source code:
// These are here for architectures that don't have a precision hardware
// timing source. They'll return zeros for overhead values. The timers
// will work but there won't be any error compensation for long
// term accuracy.
{$ELSE} // add other architectures and hardware specific tick sources here
function HasHardwareCapabilityData: Boolean; begin Result:=False end;
function HasHardwareTickCounter: Boolean; begin Result:=false end;
function HardwareTicks:TickType; begin result:=0 end;
{$ENDIF}
The source code uses fpgettimeofday and fpnanosleep which I believe should work on ARM.
And finally:
// Return microsecond normalized time source for a given platform.
// This should be sync'able to an external time standard (via NTP, for example).
function SystemTicks: TickType;
{$IFDEF Windows}
...
{$ELSE}
var t : timeval;
begin
fpgettimeofday(@t,nil);
// Build a 64 bit microsecond tick from the seconds and microsecond longints
Result := (TickType(t.tv_sec) * 1000000) + t.tv_usec;
{$ENDIF}
end;