Closed ghost closed 10 years ago
Did you find out why this doesn't work? I also have arch with a PIF. I have both the 1200 and 7000 models on a Revision B raspberry pi.
Thanks. The nanosleep call is too clever. I should not have been seduced by it. A better wrapper would be
void myNanoSleep(uint32_t ns) {
struct timespec tim;
tim.tv_sec = 0;
tim.tv_nsec = (long)ns;
nanosleep(&tim, NULL);
}
I will submit an appropriate fix. Tim
I am using the pif-board on my raspberry with archlinux as an operating system. Surely, there are some incompatibilities to expect, and here they are.
Compiling the software for the pif fails with the following compiler error:
I checked the source code, and found the calls to the nanosleep() function:
This creates a temporary array of timespec with one entry, and passes it to the const struct timespec* array in the nanosleep() function.
g++ allowed this in versions before 4.6, although passing a temporary object to a non-const reference is, iirc, illegal in C++. Newer versions of g++ throw the above error.
I circumvented this problem by making the temporary array const itself.
This may not be the most elegant solution, but it should work on all compiler versions.
Kind regards, Jali